Boost logo

Geometry :

Subject: [ggl] How can I get the equivalent of GPC tristrips?
From: Wayne Wall (tww)
Date: 2011-09-25 07:51:43

I did some additional research and experimentation and I don't think Luke's
suggestion to use the Boost.Polygon get_trapezoids() function is going to
work in my situation. The main problem is Boost.Polygon is integer only and
my application MUST support floating point (doubles) coordinates. I tried
scaling and translating my coordinates into (and then back out of) an
integer space, but there are unacceptable differences in the results from
get_trapezoids and the original polygon. The need for floating point is why
my original code (which is circa 1998) used GPC and that's why I'm trying to
migrate to Boost.Geometry. I'm making good progress with everything but
polygon decomposition into convex regions. (I think this is also referred
to as tessellation.)


This is a question for Berand: Is Boost.Geometry likely to support this
decomposition capability in the next year or so? If so, I can continue to
use GPC until then. Otherwise, I'll have to consider "rolling my own"
(which I would prefer to not have to do).


Thanks in advance,



From: ggl-bounces_at_[hidden] [mailto:ggl-bounces_at_[hidden]] On
Behalf Of Simonson, Lucanus J
Sent: Friday, September 23, 2011 2:12 PM
To: Generic Geometry Library Discussion
Subject: RE: [ggl] How can I get the equivalent of GPC tristrips?




I just checked with Barend, and this feature does not exist in
Boost.Geometry. However, the feature does exist in the Boost.Polygon


If you create a Boost.Polygon polygon_set_data<int> from your polygons and
call the get_trapezoids() function you should get exactly the tristrips you
are looking for. Please see the Boost.Polygon documentation to get you





From: ggl-bounces_at_[hidden] [mailto:ggl-bounces_at_[hidden]] On
Behalf Of Wayne Wall
Sent: Friday, September 23, 2011 5:23 AM
To: ggl_at_[hidden]
Subject: [ggl] How can I get the equivalent of GPC tristrips?


I'm migrating some code that uses the Univ of Manchester GPC library to use
boost::geometry instead. So far, it's been going well. The old code makes
extensive use of the GPC "tristrip" decomposition capability, which is very
useful when exporting complex polygons to graphics file formats (such as
AutoCAD DXF) which can only handle simple convex rings. It's not clear to
me how I can decompose an arbitrarily complex polygon into a spatially
equivalent collection of convex rings using boost::geometry operations. Any
advice would be greatly appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...

Geometry list run by mateusz at