Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Construction Nef_polyhedron_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] Construction Nef_polyhedron_3


Chronological Thread 
  • From: Denis Denis <>
  • To: "" <>
  • Subject: [cgal-discuss] Construction Nef_polyhedron_3
  • Date: Thu, 27 Jun 2013 00:36:22 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=zsv3t83qwlMCWNptceC8KkLYImAG7u9efrGl8NX9GlDSC/8857rhSsUSYq1/yB5UX/X8Ah588hh3+KikfDpGqICjX/856ybbvIPAGFQIAeaiSrjCefSClAy4RybjhN4wbPbpquUYlet6qHz8mGqq8S/JOk+LiCtaIwAe/V/e8WU=;

Hi All,
I am trying to use the cgal library but I have a problem in the construction
of the Nef_polyhedron_3 from a polyhedron_3 .
I construct a polyhedron 3 from a sequence of triangle facet and the
polyhedron is 2-manifold, closed , simple , all the faces are constructed in
counterclockwise order.
The code fail in the assertion

      CGAL_assertion(pe_prev->is_border() ||                  !
internal::Plane_constructor<Plane>::get_plane(pe_prev->facet(),pe_prev-
>facet()->plane()).is_degenerate());

in the file "polyhedron_3_to_nef_3.h"

I don't understand where is the problem . What this assertion exactly means?

This is the code I use to build the nef_3

template<class HDS>
class Build_GTrimesh : public CGAL::Modifier_base<HDS>
{
public:
    typedef typename HDS::Vertex    Vertex;
    typedef typename Vertex::Point    Point;

    Build_GTrimesh (TGTriMesh *_m):M(_m)
    {}

    void operator()(HDS &hds)
        {
        int i,n,ip;
        CGAL::Polyhedron_incremental_builder_3<HDS> B(hds,true);

        B.begin_surface(M->GetNumPoints(),M->GetNumFaces(),M-
>GetNumEdges()*2);
        n=M->GetNumPoints();
        for (i=0;i<n;i++)
            B.add_vertex(Point((double)M->GetPoint(i)[0],
(double)M->GetPoint(i)[1],(double)M->GetPoint(i)[2]));


        n=M->GetNumFaces();
        for (i=0;i<n;i++)
            {
            B.begin_facet();
            for (ip=0;ip<3;ip++)
                B.add_vertex_to_facet(M-
>GetFacePointIndex(i,ip));
            B.end_facet();
            }

        B.end_surface();
        }

    TGTriMesh *M;
};

bool GTriMeshToPolyhedron3(TGTriMesh *m,Polyhedron &P)
{
    bool b1,b2,b3;

    if (!m)
        return false;
    b1=m->Is2Manifold();
    b2=m->IsClosed();
    b3=m->isDegenerateFace();
    Build_GTrimesh<typename Polyhedron::HalfedgeDS>    PBuilder(m);
    P.delegate(PBuilder);
    b1=P.is_valid();
    b2=P.is_closed();
    Nef_polyhedron N3(P);
    b1=N3.is_simple();
    b2=N3.is_valid();
    return b1&&b2;
}

I get the error executing "GTriMeshToPolyhedron3" in the constructor of the
Nef_polyhedron and all previous check are positive .

Thank you for the help.
Denis.






  • [cgal-discuss] Construction Nef_polyhedron_3, Denis Denis, 06/27/2013

Archive powered by MHonArc 2.6.18.

Top of Page