Non manifold edge and Non manifold vertex

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Non manifold edge and Non manifold vertex

sergio
This post was updated on .
Hello,

Im trying to implement an algorithm that let me detect, identify and count
which edges and vertex are non manifold. Searching by internet a found the
following discusion.

http://cgal-discuss.949826.n4.nabble.com/Undetected-non-manifold-vertex-in-poly3-td4658551.html

The last solution is here:

typedef Polyhedron_3 EP_base;

bool is_manifold(EP_base &mesh)
{
        // count border edges (vertex halfedge circulator doesn't work on
non-manifold).
        vector<int> nBorder(mesh.size_of_vertices(), 0);
    for ( EP_base::Halfedge_const_iterator he = mesh.halfedges_begin() ; he
!= mesh.halfedges_end() ; he++ ) {
                if ( !he->is_border() )
                        continue;
                int v1 = he->vertex()->index();
                int v2 = he->opposite()->vertex()->index();
                nBorder[v1]++;
                nBorder[v2]++;
                if ( nBorder[v1] > 2 || nBorder[v2] > 2 )
                        return false;
        }

        return true;
}

The discussion is only to identify Non manifold vertex and after test it i get an error which the functions index() are not defined.

                int v1 = he->vertex()->index();
                int v2 = he->opposite()->vertex()->index();
                               
and for the added .off file the function is_border() is always false (I
don't know why)    

             if ( !he->is_border() )

these are the files:

box-nonmanifold-internal.off
<http://cgal-discuss.949826.n4.nabble.com/file/t375958/box-nonmanifold-internal.off
boxes-nonmanifold-single-edge.off
<http://cgal-discuss.949826.n4.nabble.com/file/t375958/boxes-nonmanifold-single-edge.off
                         
On the other hand I would like a suggestion of how iterate throw vertex to
find this manifold and count it. The same thing for the non manifold edges.

Im checking this manual:

https://doc.cgal.org/latest/HalfedgeDS/index.html#title9

but i would like a least some tips to implement it or why not an example :)

Best regards,

Sergio



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

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss