Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Polyhedron clipping and advices for a newbie

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Polyhedron clipping and advices for a newbie


Chronological Thread 
  • From: David Coeurjolly <>
  • To:
  • Subject: Re: [cgal-discuss] Polyhedron clipping and advices for a newbie
  • Date: Thu, 24 May 2007 18:26:25 +0200
  • Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAYFBMVEUAAAALCws0NDQ8PDxA QEBFRUVJSUlOTk5TU1NYWFheXl5kZGRpaWlubm5zc3N4eHh9fX2BgYGFhYWKioqOjo6Xl5ednZ2i oqKlpaWtra2zs7PExMTR0dHm5ubu7u7///+28DApAAAB7ElEQVRIx+2U2Y7bMAxFlcWWtS8kraXT zv//ZalBgMJpMvJ7e4MECMLDzbwRn1/69XlW4t0PHYhqOw3sTi7KGOuwnwF6VHJZpNy01g7nQI9a bne53rdtU5uOUyAas3FydV83uW7a4gQozqnb/S61XOUoo90EAG04SEuptk2OrtzH90DUxkFthE4P KaX7DACqtbVWMcXkjJ4CBlspvTNRCQCCbrMKgTh/Y6QWKmBnFVDn2h9iBIyebIkMj0BYWm2dX+TM BAieIHufOXnkEWrwEyABQXAuFkp2NYliqJOhYS/EarwiJKCMZTI0jfYLjRWVwp802RInr6XsXIHJ Vvnr7PggEyFxX8goG6/Mzpt7N8H5FFyMlOFoupcGStGG6HhT3niAj7lFEwQbADFZl3I+4WnIgcD5 4CFiohPAjxCQkEcmwKeO3gDJ5T0l2jE9F3gHeJdZ7J9zACF7guWNy+0E0PlBBKOsND7OgZ8Qx7AQ U8wI/JyhfweQv13HdjiOMI94IvX2j6yDul6ECDuVUYNGON/UerX9FbCHVbAuYhkHyuanRylxuS7p L2C3t4t4yO583fuOfOKsUVRcFzwC8Cec5SqL7cO9oeSil/HWB+AqDlJ7bYMp4Taa/ELEARDPWmyM Th3yfA+80H/g3wJ+A9ltu6Gmo7iGAAAAAElFTkSuQmCC

Hi Laurent,

I've almost fixed my problem but without the P.erase_center_vertex()
function: I tried to use it but if you iterate on
P.erase_center_vertex() without controlling the order of the processed
halfedges, it leads to inconsistencies (non manifold surface).

I'll write a more precise reply to the cgal mailing list but here is the
solution I'm working on:
- track the intersection edges (edge sharing Interior/exterior
vertices) and create the new halfedges (split_facet)
- use the erase_facet function to split the polyhedron into two parts
(while keeping an handle to the "exterior" part)
- fill the hole of the "interior" part
- bruteforce deletion of the exterior part with a
"erase_connected_component" function.

by the way, many thanks Laurent for your answer...

to be continued.

regards,
dav


Laurent Provot wrote:
> 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
>>
>>
>

--
----------------
David Coeurjolly - Chargé de recherche CNRS
Laboratoire LIRIS-UMR 5205
Bâtiment Nautibus, Université Claude Bernard Lyon 1
43 boulevard du 11 novembre 1918, 69622 Villeurbanne cedex, France
Tel : (+33) [0]4.72.44.82.40 Fax : (+33) [0]4.72.43.15.36

Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.16.

Top of Page