-
Hi, m.vertices.create_vertices(8);
m.vertices.point(0) = GEO::vec3{0.0, 0.0, 0.0};
m.vertices.point(1) = GEO::vec3{0.0, 0.0, 1.0};
m.vertices.point(2) = GEO::vec3{1.0, 0.0, 1.0};
m.vertices.point(3) = GEO::vec3{1.0, 0.0, 0.0};
m.vertices.point(4) = GEO::vec3{0.0, 1.0, 0.0};
m.vertices.point(5) = GEO::vec3{0.0, 1.0, 1.0};
m.vertices.point(6) = GEO::vec3{1.0, 1.0, 1.0};
m.vertices.point(7) = GEO::vec3{1.0, 1.0, 0.0};
m.facets.create_quad(0, 1, 2, 3); // facet 0 - (3, 2, 1, 0) if flipped
m.facets.create_quad(0, 4, 5, 1); // facet 1 - (1, 5, 3, 0) if flipped
m.facets.create_quad(0, 3, 7, 4); // facet 2 - (4, 7, 3, 0) if flipped
m.facets.create_quad(1, 2, 6, 5);
m.facets.create_quad(2, 3, 7, 6);
m.facets.create_quad(4, 5, 6, 7);
m.facets.connect();
GEO::mesh_reorient(m); The first three quad facets have the "wrong" orientation. Even if I manually flip two of these, the remaining single incorrectly oriented facet does not get flipped by |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, This is because GEO::mesh_repair(m, GEO::MESH_REPAIR_TOPOLOGY, 0.0); It does in spirit the same thing as what you did, but calls What are the arguments to
|
Beta Was this translation helpful? Give feedback.
Hello,
This is because
m.facets.connect()
only connects facets along edges with opposite orientations, hence it does not see the connections between the well-oriented and the wrongly-oriented facets (it sees a "border" there that it cannot traverse).To do what you wanted to do, you can use instead:
It does in spirit the same thing as what you did, but calls
repair_connect_facets()
(private function inmesh_repair.cpp
) that connects facets along matching edges regardless their orientation, then it callsmesh_reorient()
that can do its job.What are the arguments to
mesh_repair()
?The first one is a reference to the mesh to be repaired