Subject: CGAL users discussion list
List archive
- From: Keith Ealanta <>
- To:
- Subject: How to remove holes from a polygon_set_2
- Date: Mon, 05 Feb 2007 00:37:55 +1100
Efraim Fogel wrote:
Keith Ealanta wrote:
I have a pair of polygons A & B, and I need to perform boolean operations on them to produce the polygon C where C is one of A & B, A | B, A|B xor A&B etc. If I understand correctly this means I need to use Nef_Polygons of even Nef_Polyhedrons and then pull it back out into a complex polygon afterwards.
If all you need are regularized operations, check out the Boolean_set_operations_2 package.
Doh! How did I miss that!
Thank you. That helped enormously.
I now have one last problem (well I hope it's the last)
If I have a polygon_set_2 containing holes in some of it's polygons,
how do I delete those holes?
The iterators that break the polygon set out into several polygon_with_holes_2 (pwh) objects are creating temporary objects as far as I can see.
When I use a remove function to remove the hole from the pwh the effect doesn't cascade back to the main polygon_set_2 object. I think this is the consequence of having to get the pwh objects using a back-iterator.
More irritatingly, if I capture pwh.outer_boundry() and .join that to the polygon_set_2 object I get an exception. Likewise if I capture the individual holes, reverse their order (.reverse orientation()) and join them in I also get an exception.
I'm guessing the solution is going to be to get my hands dirty in the arrangement object, but I'd really rather not do that.
Can anyone suggest what I'm likely doing wrong or how I can remove holes quickly and easily?
Many thanks,
Keith Ealanta
Can anyone explain the process by which I make that conversion (I keep getting compile errors like "unable to convert Point_2 to Extended_point.")
Ideally I'd just create Nef_polygons to start with, store my data in them, and be able to perform the boolean operations dirctly on them, but that also seems impossible as I need to be able to create them using the push_back(point_2) operator or it's equivalent, and I've likewise failed to get that to work.
Sorry for what is doubtless a set of noob questions. This is my first real try to do anything with CGAL.
Any help that can be offered will be greatly appreciated.
Thanks,
Keith Ealanta
- How to remove holes from a polygon_set_2, Keith Ealanta, 02/04/2007
- Re: [cgal-discuss] How to remove holes from a polygon_set_2, Efraim Fogel, 02/05/2007
Archive powered by MHonArc 2.6.16.