Commit 8d949179 authored by Mike Kremer's avatar Mike Kremer
Browse files

Corrected tutorial 1 code

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@80 66977474-1d4b-4f09-8fe9-267525286df2
parent 4db24c8b
...@@ -56,48 +56,48 @@ std::vector<PolyhedralMeshV3d::VertexHandle> vertices; ...@@ -56,48 +56,48 @@ std::vector<PolyhedralMeshV3d::VertexHandle> vertices;
// Add faces // Add faces
vertices.push_back(v0); vertices.push_back(v1);vertices.push_back(v3); vertices.push_back(v0); vertices.push_back(v1);vertices.push_back(v3);
PolyhedralMeshV3d::FaceHandle f0 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f0 = myMesh.add_face(vertices);
vertices.clear(); vertices.clear();
vertices.push_back(v2); vertices.push_back(v0);vertices.push_back(v3); vertices.push_back(v2); vertices.push_back(v0);vertices.push_back(v3);
PolyhedralMeshV3d::FaceHandle f1 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f1 = myMesh.add_face(vertices);
vertices.clear(); vertices.clear();
vertices.push_back(v0); vertices.push_back(v2);vertices.push_back(v1); vertices.push_back(v0); vertices.push_back(v2);vertices.push_back(v1);
PolyhedralMeshV3d::FaceHandle f2 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f2 = myMesh.add_face(vertices);
vertices.clear(); vertices.clear();
vertices.push_back(v1); vertices.push_back(v4);vertices.push_back(v3); vertices.push_back(v1); vertices.push_back(v4);vertices.push_back(v3);
PolyhedralMeshV3d::FaceHandle f3 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f3 = myMesh.add_face(vertices);
vertices.clear(); vertices.clear();
vertices.push_back(v2); vertices.push_back(v3);vertices.push_back(v4); vertices.push_back(v2); vertices.push_back(v3);vertices.push_back(v4);
PolyhedralMeshV3d::FaceHandle f4 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f4 = myMesh.add_face(vertices);
vertices.clear(); vertices.clear();
vertices.push_back(v2); vertices.push_back(v4);vertices.push_back(v1); vertices.push_back(v2); vertices.push_back(v4);vertices.push_back(v1);
PolyhedralMeshV3d::FaceHandle f5 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f5 = myMesh.add_face(vertices);
vertices.clear(); vertices.clear();
vertices.push_back(v1); vertices.push_back(v2);vertices.push_back(v3); vertices.push_back(v1); vertices.push_back(v2);vertices.push_back(v3);
PolyhedralMeshV3d::FaceHandle f6 = _mesh.add_face(vertices); PolyhedralMeshV3d::FaceHandle f6 = myMesh.add_face(vertices);
std::vector<PolyhedralMeshV3d::HalfFaceHandle> halffaces; std::vector<PolyhedralMeshV3d::HalfFaceHandle> halffaces;
// Add first tetrahedron // Add first tetrahedron
halffaces.push_back(_mesh.halfface_handle(f0, 1)); halffaces.push_back(myMesh.halfface_handle(f0, 1));
halffaces.push_back(_mesh.halfface_handle(f1, 1)); halffaces.push_back(myMesh.halfface_handle(f1, 1));
halffaces.push_back(_mesh.halfface_handle(f2, 1)); halffaces.push_back(myMesh.halfface_handle(f2, 1));
halffaces.push_back(_mesh.halfface_handle(f6, 1)); halffaces.push_back(myMesh.halfface_handle(f6, 1));
_mesh.add_cell(halffaces); myMesh.add_cell(halffaces);
// Add second tetrahedron // Add second tetrahedron
halffaces.clear(); halffaces.clear();
halffaces.push_back(_mesh.halfface_handle(f3, 1)); halffaces.push_back(myMesh.halfface_handle(f3, 1));
halffaces.push_back(_mesh.halfface_handle(f4, 1)); halffaces.push_back(myMesh.halfface_handle(f4, 1));
halffaces.push_back(_mesh.halfface_handle(f5, 1)); halffaces.push_back(myMesh.halfface_handle(f5, 1));
halffaces.push_back(_mesh.halfface_handle(f6, 0)); halffaces.push_back(myMesh.halfface_handle(f6, 0));
_mesh.add_cell(halffaces); myMesh.add_cell(halffaces);
\endcode \endcode
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment