Subject: CGAL users discussion list
List archive
- From: Laurent Provot <>
- To:
- Subject: Re: [cgal-discuss] Polyhedron clipping and advices for a newbie
- Date: Thu, 24 May 2007 17:28:03 +0200
Hello David,
If I have well understood your piece of code you want to remove all the
incident facets of a vertex (represented by an halfedge v) and if this
creates an isolated vertex it gets automatically removed as well.
But isn't it simpler to use the P.erase_center_vertex(...) on your
exterior vertices ? I guess it gives the same result, doesn't it ?
Laurent
Le Wed, 23 May 2007 15:30:24 +0200,
David Coeurjolly
<>
a écrit :
> Dear all,
>
> I've to admit that I'm a brand new CGAL user for a couple of weeks and
> my questions may be stupid. My problem is quite simple: cut a
> polyhedron with an oriented plane.
>
> It is quite easy to tag the vertices ('exterior/interior') and to
> create the new halfedges/vertices for intersection points
> (edge/plane). But I have troubles to "remove" the exterior vertices.
>
> More precisely, I've pushed in a list<Halfedge_handle>, an halfedge
> handle per exterior vertex (called list_exterior_handles) obtained
> during the exterior vertex scan step. My idea was to use
> P.erase_facet() as follows:
>
> Halfedge_around_vertex_circulator circ;
> for( list<Halfedge_handle>::iterator v =
> list_exterior_handles.begin(); v != list_exterior_handles.end() ;
> ++v){
> circ = (*v)->vertex_begin();
> unsigned int deg = (*v)->vertex()->degree();
> for (unsigned int i=0; i< deg; i++)
> if (not circ->is_border()) P.erase_facet(circ);
> circ++;
> }
>
> But this does not work..... I obtain segfaults due to the
> dereferencing of a NULL pointer in the (*v)->vertex()->degree()
> computation.
>
> Do you have any idea of what's going on ? By the way, my choice of the
> erase_facet operation may not be not good.. Any other suggestion ?
>
> Thanks in advance, regards,
> david
>
>
- Polyhedron clipping and advices for a newbie, David Coeurjolly, 05/23/2007
- Re: [cgal-discuss] Polyhedron clipping and advices for a newbie, Laurent Provot, 05/24/2007
- Re: [cgal-discuss] Polyhedron clipping and advices for a newbie, David Coeurjolly, 05/24/2007
- Re: [cgal-discuss] Polyhedron clipping and advices for a newbie, Laurent Provot, 05/24/2007
Archive powered by MHonArc 2.6.16.