20 std::string namef = name +
"_f";
21 FILE *fpf =
Fopen(namef.c_str(),
"w");
23 Msg::Error(
"Unable to open file '%s'", namef.c_str());
27 std::string names = name +
"_s";
28 FILE *fps =
Fopen(names.c_str(),
"w");
30 Msg::Error(
"Unable to open file '%s'", names.c_str());
39 int numf = 0, nums = 0;
42 if(!saveAll &&
f->physicals.empty())
continue;
43 numf +=
f->triangles.size();
44 std::set<MVertex *>
vset;
45 for(std::size_t i = 0; i <
f->triangles.size(); i++) {
46 for(
int j = 0; j < 3; j++)
vset.insert(
f->triangles[i]->getVertex(j));
51 Msg::Info(
"Writing %d triangles and %d nodes", numf, nums);
79 fprintf(fpf,
"%d\n\n", numf);
80 fprintf(fps,
"%d %g\n\n", nums, 1.0);
83 if(!saveAll &&
f->physicals.empty())
continue;
84 std::vector<MVertex *> vvec;
85 std::map<MVertex *, CelumInfo> vmap;
86 for(std::size_t i = 0; i <
f->triangles.size(); i++) {
87 fprintf(fpf,
"%d \"face %d\"", idf++,
f->tag());
88 for(
int j = 0; j < 3; j++) {
89 MVertex *v =
f->triangles[i]->getVertex(j);
95 Msg::Warning(
"Could not reparamtrize node %d on surface %d",
104 fprintf(fpf,
" %ld", v->
getIndex());
106 fprintf(fpf,
"\n\n");
108 for(std::size_t i = 0; i < vvec.size(); i++) {
110 auto it = vmap.find(v);
111 fprintf(fps,
"%ld %g %g %g %g %g %g %g %g %g %g %g %g %g %g\n\n",
112 it->first->getIndex(), it->first->x(), it->first->y(),
113 it->first->z(), it->second.normal.x(), it->second.normal.y(),
114 it->second.normal.z(), it->second.curvMin, it->second.curvMax,
115 it->second.dirMin.x(), it->second.dirMin.y(),
116 it->second.dirMin.z(), it->second.dirMax.x(),
117 it->second.dirMax.y(), it->second.dirMax.z());