Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Detection of non_manifold_vertex in mesh
  • Date: Tue, 5 Jun 2018 16:04:48 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:pMDe6hIMrPylktNKfNmcpTZWNBhigK39O0sv0rFitYgeLvnxwZ3uMQTl6Ol3ixeRBMOHs68C07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwVFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhjoZOT438G/ZicJ+g6xUrx2juxNy2JTbbJ2POfdkYq/Qc9EXSGxcVchRTSxBBYa8YpMTAuoHIOlYtZfyqEEVrRCjBQejHvjgyiVJhnTr2qA1yeIhHhzc3AM+Bd0Oq27YrNvvO6gJS+C1zbLFzTrdYPNR3Dfy9pTIcgohoPGCR71/bdbRyU41FwLFlFmftYvlPzaM2+kLrmOV4e1gVee1hG4mrQF8uj6vyd03hYbSgoIa1ErI+jl+wIYwI9CzVU11Yca8HZdNtCyXNJF6Tt4jTmxooio3xaAKtYSmcCUO1Zgr3xrSZ+Cdf4WL4x/vTvudLDNmiH5/Zb6yhwi+/E69wePmTMa0ykxFri9dn9nMqH8N0xvT59CaRvdj5Euh3DGP2g7J5uFBO080lK7bJ4cmwr4tipofq0PDHjH2mEnsiq+ZaFkk9vCp6+ThfLrmuoeRO5J3hwz9KKgih82yDOQiPgUBQmSX4/mw2bn+8UHhRbVFlPw2kq3XsJDAIsQbo7a0DBVT0ok+8RawES2p0M8CkXkJNl1KYwiHj4nyNlHBPv/4CvK/jEqwkDdxx/HGMKfuDYnRLnjEirfgfaxx5FJbyAo21dxf/Y5bCqkdIPLvXU/8rMDXDhAjPAyw2uroFdR91pgCVmKSGa+ZK7jfsUSI5+IqO+mDfpUZuDf7K/g/5v7hl2U1mVEHffrh4ZxCY3+xGrFqIl6SfGH3qtYHC2YD+AQkH8Lwj1jXeDhffXu7ROoS7zshCcryBIHPXI2km/qP1S2hH7VZa2dDB0yWAHnhfJmDQeZKYyWXdJwy2gcYXKSsHtdynSqlsxX3nuI+f7jkvxYAvJem7+BboujalBU87ztxVZ3P3GyKSmxohHIGTjQq27pu50d6zwXbiPQqs7ljDdVWoshxfEIiL5eGlr51Btf3Vx7bb9mAQ0qhWMTgCjY0HIpono0+Jn1lEtDntSjtmiqnB7hPyu7SXtox9fma2nHwI4N61mqA07chyV8rXpkXOA==

TriangleMesh is not a class but a template parameter.

You must include the header of Surface_mesh or Polyhedron_3


On 6/5/2018 3:54 PM, sergio wrote:
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/


-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri



Archive powered by MHonArc 2.6.18.

Top of Page