4 #include <OpenMesh/Core/IO/MeshIO.hh> 6 #include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh> 7 #include <OpenMesh/Core/Geometry/VectorT.hh> 9 #ifndef DOXY_IGNORE_THIS 36 int main(
int argc,
char **argv)
42 std::cerr <<
"Usage: " << argv[0] <<
" <input>\n";
50 std::cerr <<
"Ouch! ERROR! Data type is wrong!\n";
58 std::cerr <<
"Ouch! ERROR! Data type is wrong!\n";
63 mesh.request_vertex_normals();
66 mesh.request_face_normals();
72 std::cerr <<
"Error loading mesh from file " << argv[1] << std::endl;
78 mesh.has_face_normals() && mesh.has_vertex_normals() )
85 for (MyMesh::VertexIter v_it = mesh.vertices_begin();
86 v_it != mesh.vertices_end(); ++v_it)
88 std::cout <<
"Vertex #" << v_it <<
": " << mesh.point( v_it );
89 mesh.set_point( v_it, mesh.point(v_it)+mesh.normal(v_it) );
90 std::cout <<
" moved to " << mesh.point( v_it ) << std::endl;
void update_normals()
Compute normals for all primitives.
Has (r) / store (w) vertex normals.
T::value_type value_type
Type of the scalar value.
bool read_mesh(Mesh &_mesh, const std::string &_filename)
Read a mesh from file _filename.
Set options for reader/writer modules.