Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Detection of non_manifold_vertex in mesh

Subject: CGAL users discussion list

List archive

[cgal-discuss] Detection of non_manifold_vertex in mesh


Chronological Thread 
  • From: sergio <>
  • To:
  • Subject: [cgal-discuss] Detection of non_manifold_vertex in mesh
  • Date: Tue, 5 Jun 2018 06:54:35 -0700 (MST)
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
  • Ironport-phdr: 9a23:cM/ADR3DAAaDxZ50smDT+DRfVm0co7zxezQtwd8Zse0WLfad9pjvdHbS+e9qxAeQG9mDtrQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYwhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmhicJOSA6/m/KhcN/kK1VrQm9pxF934LYfJ2ZOOZgcq7bYNgURXBBXsFUVyFZGYOzcZEPD+UAPeZfsoLwoEUOogGiCgmtAuPvxTFIhnjs3a09yOkhHgTG0xYhH9IKqnjbsNL1NKILXO2z0aLGwzLDb/ZM1jf87ojFahYhruuXUr1rdcre11MjGB/CjlWVr4HuIjCb1vwVvmSG7udsS/ijh3Anpgx/uDSj28khh4fTio8X1FzJ8zhyzpwvKt2iUkF7ZMapEJtOuCGeMIt7WsUiTm5ytCY80LIJooW0fCwUx5g92xHfbPmHf5CJ4hLlSumRPS91iG9kdb6hnRq+70itx+PmWsWp3ltHoDBJn9vSunwV0hzc8MmHSv9z/ke73jaP0hje6v9eLk8olKrbLZEhwrA3lpoJtkTOBSD2mEDsg6+XckUo4PSn6+PiYrn+vJ+TK5d0ih3iMqQpgsGwHes4PRIKX2SC5Ou81abj8lHkQLVRlf07ibLZsZDfJcQDvKG1GQ5V0oA56xa+FTiqytoYnWNUZG5CLRmIhoysN1DVK+3jFt++hU6tmXFl3aPoJLrkV47ANHfCl/+1Y7926khTxg0pyvhQ4ptVDvcKJ/elCRy5j8DREhJsa1/8+O3gEtgojtpPC1LKObeQNebpiXHN4+suJ+eWY4pM4WTyLvEk47jlinprwgZBL5ns5oMebTWDJtojO1+QOCO+jdIIEGNMtQ07HrSz1Q+yFAVLbnP3ZJoSozE2DIX/UNXFGsaribaL2Cr9FZpTNDlL

After check C:\dev\CGAL-4.12\include\CGAL\Polygon_mesh_processing\repair.h I
found some lines that let it detect non manifold_vertex and non
manifold_edges. I added these lines into individual functions to be used. I
would like to resolve missing definitions adding the correct headers to the
following adapted functions. For example TriangleMesh is not found it. How
can fix these functions definition?

//
----------------------------------------------------------------------------
// manifold-vertex
// ----------------------------------------------------------------------
#include <boost/foreach.hpp>
#include <CGAL/boost/graph/iterator.h>

#include <CGAL/Polygon_mesh_processing/repair.h>
#include <CGAL/Polygon_mesh_processing/internal/repair_extra.h>
#include <CGAL/Polygon_mesh_processing/corefinement.h>

// manifold-vertex
typedef boost::graph_traits<TriangleMesh> GT;
typedef typename GT::halfedge_descriptor halfedge_descriptor;


void test_non_manifold_vertex()
{
bool non_manifold_vertex_removed = false; //here non-manifold is for
the 1D
polyline
std::vector<halfedge_descriptor> boundary_hedges;
BOOST_FOREACH(face_descriptor fh, cc_faces)
{
halfedge_descriptor h = halfedge(fh, tm);
for (int i = 0; i < 3; ++i)
{
if (is_border(opposite(h, tm), tm) ||
cc_faces.count(face(opposite(h, tm), tm)) ==
0)
{
boundary_hedges.push_back(h);
}
h = next(h, tm);
}
}
}



void test_non_manifold_edges()
{
// make sure that the hole filling is valid, we check that no
// edge already in the mesh is present in patch.
bool non_manifold_edge_found = false;
BOOST_FOREACH(const Face_indices& triangle, patch)
{
cpp11::array<int, 6> edges =
make_array(triangle.first, triangle.second,
triangle.second, triangle.third,
triangle.third, triangle.first);
for (int k=0; k<3; ++k)
{
int vi=edges[2*k], vj=edges[2*k+1];
// ignore boundary edges
if (vi+1==vj || (vj==0 &&
static_cast<std::size_t>(vi)==border_vertices.size()-1) )
continue;
halfedge_descriptor h = halfedge(border_vertices[vi],
border_vertices[vj], tm).first;
if (h!=boost::graph_traits<TriangleMesh>::null_halfedge() &&
cc_interior_edges.count(edge(h, tm))==0)
{
non_manifold_edge_found=true;
break;
}
}
if (non_manifold_edge_found) break;
}
}



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page