Boost logo

Geometry :

Subject: [ggl] Re: Problems with the difference between two polygons
From: Simonson, Lucanus J (lucanus.j.simonson)
Date: 2011-08-07 15:16:01


Angus Johnson wrote:
> You can see that if the vertices returned by Ggl are then rounded
> they'll produce duplicate vertices. Once they're removed, the result
> is exactly that which is returned by Clipper. So it seems that
> Clipper is returning the correct and simplest solution.

I have been considering changing the rounding policy in Polygon to round closest instead of truncate downward. It turns out to be just as easy. I'm not sure that one choice of rounding can be called more correct than another. Though I would admit rounding closest is probably better than truncating. Ggl is most accurate because it uses only machine rounding. There is a simplify algorithm in Polygon for removing very small features from polygons, which is parameterized to allow the user to specify their own value for "small", if the user wants simpler polygons without colinear or nearly colinear vertices and short edges.

Regards,
Luke


Geometry list run by mateusz at loskot.net