Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] union calculating

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] union calculating


Chronological Thread 
  • From: Francesc Vila <>
  • To:
  • Subject: Re: [cgal-discuss] union calculating
  • Date: Fri, 21 Jan 2011 17:38:58 +0100

El 21/01/2011 17:03, sara123 escribió:
How can I have the result of union calculating of some simple polygons in
CGAL::Polygon_2<Kernel> data type?
My goal is calculating the area of the polygon that is the union result of
some simple polygons.
Now I have this result in these data types:

1-CGAL::Polygon_with_holes_2<Kernel>
or
2-CGAL::Polygon_set_2<Kernel>

Well, maybe there is a better way, but a polygon with holes has a CGAL::Polygon_2 (which is the outer boundary) and several CGAL::Polygon_2 which are the holes.

CGAL::Polygon_2 has an area member function, which returns the signed area, so you could calculate the area of the outer boundary and substract the area of each hole.

Regards,

Francesc Vila



Archive powered by MHonArc 2.6.16.

Top of Page