|
Boost Users : |
Subject: Re: [Boost-users] [Polygon] Test among 3 libraries
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2010-09-17 13:08:56
2010/9/17 TONGARI <tongari95_at_[hidden]>
>>I'm not sure what's wrong here.
>Well, the reaI problem is that I just mistakenly expect Boost.Polygon to output the holes as distinct polygons, isn't it?
Yes. Boost.Polygon has two output modes for polygons. One where the holes are fractured or "key-holed" out to the outer boundary and one where holes are reported as polygons in a list associated with their outer boundaries through the polygon_with_holes_concept. Many polygon clippers report holes as polygons with opposite winding and not associated with their outer shells. Keyholing and associating holes to outer boundary are features of the algorithm, but if you expected the naïve behavior it could be confusing. It is easy to take the polygon with holes output of Boost.Polygon and build a list of polygons and holes with opposite winding to emulate the output of a simpler polygon clipper (to satisfy the interface of a legacy application, for instance).
Regards,
Luke
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net