Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] How to make Polygon_with_holes_2 from Polygon_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] How to make Polygon_with_holes_2 from Polygon_2


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] How to make Polygon_with_holes_2 from Polygon_2
  • Date: Tue, 27 Jan 2009 09:25:37 +0100



Hyungon Kim wrote:
Hi Andreas,

Thanks Andres. I suppose that CGAL has a direct method to do this.
I tried Arrangement of CGAL to convert complex polygon in Polygon_2 to simple polygon in Polygon_with_holes.
However, Arrangement is unlike converting all kind of complex polygons to simple polygon well.
Should I write a method like yours to do this task?

Hi Hyungon Kim,

We haven't incorporated the piece of code in CGAL. The arrangement
expects simple polygons, that is edges must not intersect.

What is in CGAL is the conversion in the other direction,
that is you can obtain a (not simple polygon) from a polygon
with hole. It just inserts vertical edges where necessary.
http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Boolean_set_operations_2_ref/Function_connect_holes.html

best regards,

andreas


Thanks,
Hyungon Kim

Andreas Fabri wrote:

Hello,

For simple cases where points p,q appear later in the sequence
in reverse order q,p the attached file can split it.

It will not work, if in your example the point 10,10 wasn't there twice.

Best regards,

andreas



wrote:
Dear All,

Hi. I am a new learner in CGAL. I have tried to make a sample program to do
boolean operation on 2D polygons. My problem is how to make
Polygon_with_holes_2 from input Polygon_2 with holes (complex polygon) before
boolean operation. For example, points of input Polygon_2 are
(0,0) (10,0) (10,10) (10,20) (20,20) (20,10) (10,10) (10,0) (30,0) (30,30)
(0,30)
Is there a CGAL package to make Polygon_with_holes from this complex polygon?

Best Regards,
Hyungon Kim






Archive powered by MHonArc 2.6.16.

Top of Page