13 std::vector<std::pair<int,int>> edges;
16 for (
auto edge : face->edges)
20 edges.push_back(std::pair<int,int>(edge[0],edge[1]));
25 std::ofstream outfile;
26 outfile.open(fileName);
28 if (!outfile.is_open())
31 <<
"In call to chi_mesh::SurfaceMesh::ExtractOpenEdgesToObj. Failed"
32 <<
" to open file: " << std::string(fileName);
36 outfile <<
"# ChiTech open edges file\n";
37 outfile <<
"# Single surface mesh\n";
39 for (
auto vert_pair : edges)
44 <<
"v " << v0.
x <<
" " << v0.
y <<
" " << v0.
z <<
"\n"
45 <<
"v " << v1.
x <<
" " << v1.
y <<
" " << v1.
z <<
"\n";
48 for (
size_t e = 0; e < edges.size(); ++e)
50 const auto v_count = 2 * e + 1;
51 outfile <<
"l " << v_count <<
" " << v_count + 1 <<
"\n";
static void Exit(int error_code)
std::vector< chi_mesh::PolyFace * > poly_faces_
Polygonal faces.
std::vector< chi_mesh::Vertex > vertices_
void ExtractOpenEdgesToObj(const char *fileName)