Open BeginCGAL opened 9 months ago
Make construct
, whatever that is, construct the mesh with a consistent orientation.
Is that you mean its my fault? Surface_mesh always with a consistent orientation?
Surface_mesh should have a consistent orientation, yes.
Perhaps Construct is building a surface mesh of unconnected faces?
I don't know, because I have no idea what Construct does.
I suggest you look there.
i'm sorry forget the Construct struct , here is the code ,could you tell me problems that make the Surface_mesh don't have a consistent orientation.and what should i do to modify the Construct .
struct Construct
{
Mesh& mesh;
template < typename PointIterator>
Construct(Mesh& mesh, PointIterator b, PointIterator e)
: mesh(mesh)
{
for (; b != e; ++b)
{
boost::graph_traits<Mesh>::vertex_descriptor v;
v = add_vertex(mesh);
mesh.point(v) = *b;
}
}
Construct& operator=(const Facet f)
{
//typedef boost::graph_traits<Mesh>::M_vertex_descriptor M_vertex_descriptor;
typedef boost::graph_traits<Mesh>::vertices_size_type size_type;
mesh.add_face(M_vertex_descriptor(static_cast<size_type>(f[0])),
M_vertex_descriptor(static_cast<size_type>(f[1])),
M_vertex_descriptor(static_cast<size_type>(f[2])));
return *this;
}
Construct&
operator*() { return *this; }
Construct&
operator++() { return *this; }
Construct
operator++(int) { return *this; }
};
I suggest checking the return value of mesh.add_face()
As shown in the figure,when i make a Surface_mesh and i try to get each face Vertex_index(in .obj file) ,i find the direction of face is not uniform but random.please tell me what should i do to make all faces one orientation,thank you.
Source Code
Environment