44 #include <OpenMesh/Core/IO/MeshIO.hh> 45 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> 76 std::vector<MyMesh::VertexHandle> face_vhandles;
78 face_vhandles.clear();
79 face_vhandles.push_back(vhandle[0]);
80 face_vhandles.push_back(vhandle[1]);
81 face_vhandles.push_back(vhandle[2]);
82 face_vhandles.push_back(vhandle[3]);
83 mesh.add_face(face_vhandles);
85 face_vhandles.clear();
86 face_vhandles.push_back(vhandle[7]);
87 face_vhandles.push_back(vhandle[6]);
88 face_vhandles.push_back(vhandle[5]);
89 face_vhandles.push_back(vhandle[4]);
90 mesh.add_face(face_vhandles);
92 face_vhandles.clear();
93 face_vhandles.push_back(vhandle[1]);
94 face_vhandles.push_back(vhandle[0]);
95 face_vhandles.push_back(vhandle[4]);
96 face_vhandles.push_back(vhandle[5]);
97 mesh.add_face(face_vhandles);
99 face_vhandles.clear();
100 face_vhandles.push_back(vhandle[2]);
101 face_vhandles.push_back(vhandle[1]);
102 face_vhandles.push_back(vhandle[5]);
103 face_vhandles.push_back(vhandle[6]);
104 mesh.add_face(face_vhandles);
106 face_vhandles.clear();
107 face_vhandles.push_back(vhandle[3]);
108 face_vhandles.push_back(vhandle[2]);
109 face_vhandles.push_back(vhandle[6]);
110 face_vhandles.push_back(vhandle[7]);
111 mesh.add_face(face_vhandles);
113 face_vhandles.clear();
114 face_vhandles.push_back(vhandle[0]);
115 face_vhandles.push_back(vhandle[3]);
116 face_vhandles.push_back(vhandle[7]);
117 face_vhandles.push_back(vhandle[4]);
118 mesh.add_face(face_vhandles);
126 std::cerr <<
"Cannot write mesh to file 'output.off'" << std::endl;
130 catch( std::exception& x )
132 std::cerr << x.what() << std::endl;
Kernel::Point Point
Coordinate type.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
bool write_mesh(const Mesh &_mesh, const std::string &_filename, Options _opt=Options::Default, std::streamsize _precision=6)
Write a mesh to the file _filename.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.