Questions tagged [boost-polygon]

The Boost.Polygon library provides algorithms focused on manipulating planar polygon geometry data.

The BOOST Polygon library uses C++-Concepts inspired template programming to provide generic library functions overloaded on concept type. There are currently thirteen concepts in the Polygon library type system. A concept object in the Polygon library is just an empty struct similar to a tag that would be used for tag dispatching.

The Boost.Polygon library provides algorithms focused on manipulating planar polygon geometry data. Specific algorithms provided are the polygon set operations (intersection, union, difference, disjoint-union) and related algorithms such as polygon connectivity graph extraction, offsetting and map-overlay. An example of the disjoint-union (XOR) of figure a and figure b is shown below in figure c. These so-called Boolean algorithms are of significant interest in GIS (Geospatial Information Systems), VLSI CAD as well all other fields of CAD, and many more application areas, and providing them is the primary focus of this library. The Boost.Polygon library is not intended to cover all of computational geometry in its scope, and provides a set of capabilities for working with coordinates, points, intervals and rectangles that are needed to support implementing and interacting with polygon data structures and algorithms.

More Reference Documentation can be found here

55 questions
1
vote
2 answers

boost polygon intersection API is working in opposite way of what it should be

I am not sure why the boost polygon intersection in below code example is just giving the opposite output i.e its giving areas which are OPPOSITE of intersection. I don't know if something is wrong with my polygon data AS it all looks good to me…
Test
  • 564
  • 3
  • 12
1
vote
0 answers

How to estimate the projected area of a boost::polygon C++

I need to estimate the projected area of a boost::polygon of several circles that are created in a loop. The idea is for a given x and y centroid, a polygon is created drawing a circle of a given radius using n number of vertices. This circle is…
1
vote
1 answer

Polygon transformation in Boost.Geometry in C++: Translation, Rotation, Reflection around a line

I have three types of queries for a polygon to implement using boost geometry: translating a polygon to a given point rotating a polygon about a reference point(not necessarily about origin) reflecting a polygon around a line As I am new to Boost…
1
vote
1 answer

Rearrange single lines to form closed polygon?

assumed I have a rectangle: A------B | | | | D------C Normally this rectangle is formed by an array of coordinates A-B-C-D-A which describe a closed polygon. Now I do not have such an array but a bunch of separate lines B-A, D-A, B-C-D.…
Elmi
  • 5,899
  • 15
  • 72
  • 143
1
vote
1 answer

boost::polygon boolean subtract results in additional lines

I have a rectangle with a circle that is located inside the rectangle. Now I do a boolean subtract operation where the circle is subtracted from the larger rectangle using boost::polygon and the following (pseudo)…
Elmi
  • 5,899
  • 15
  • 72
  • 143
1
vote
1 answer

Add polygons with boost::polygon does not compile?

May be this is a stupid question and only a simple issue, but I fail compiling a relative simple code. What I try to do is to add/concatenate two polygons using boost::polygon (some pseudocode showing the relevant parts): #include…
Elmi
  • 5,899
  • 15
  • 72
  • 143
1
vote
1 answer

How to convert a polygon_set_data in boost::polygon to polygon_data?

First, I mean boost::polygon library, not boost::geometry library. My code is: namespace gtl = boost::polygon; using namespace boost::polygon::operators; typedef gtl::polygon_90_data Polygon; typedef gtl::polygon_traits::point_type…
kyleqian
  • 311
  • 1
  • 3
  • 14
1
vote
0 answers

using Boost Polygon with high precision integers

I recently found out that boost polygon is integer-only: What is the utility of Boost Polygon? I'm working around this by multiply my floating point values by a large exponent and then renormalizing the output from the library, but by default the…
Jack000
  • 157
  • 1
  • 10
1
vote
0 answers

Boost::Polygon - Polygon 90 Set Concept de allocate memory

I am using Boost::Polygon - Polygon 90 Set Concept to store a huge amount of rectangels. Unfortunately I cannot de allocate the memory after I am done. Here is a minimal example. I'd like to de allocate the memory of the polygon set at a certain…
eistee
  • 11
  • 2
1
vote
1 answer

Generate set of rectangles to form grid in irregular polygon using boost

I need to create a set of rectangles of a predetermined size that form a grid inside of an irregular (probably not convex) polygon. (I realize there will be bits on the edges that won't fit in a rectangle. Those can just be dropped.) Everything is…
jani
  • 107
  • 1
  • 5
  • 13
1
vote
2 answers

Segmenting a space into polygon regions with voroni approximation given a set of points

I am trying to partition a space into a set of polygons, where each polygon is approximately a voroni cell for one of a set of input points. I was trying to use Boost::Voroni for this purpose, but the output of use of this library is complicated,…
MVTC
  • 845
  • 11
  • 28
1
vote
1 answer

Using Boost:Polygon:get_rectangles

I am having problems in using the boost get_rectangles function I have seen an example of using this on stackoverflow however I can not get it to work. Here is the code I'm using and I'm using visual studio 2013 with boost library 1.57 int main() { …
DaxDeveloper
  • 138
  • 1
  • 13
1
vote
1 answer

Non-recursive algorithm to walk the edges of a Voronoi diagram with boost::polygon

What's a good algorithm to traverse the edges of a Voronoi diagram using boost without recursion? I know it'd have to check for infinite edges in a cell then check its neighbours and repeat from there, but I'd prefer a method that doesn't require…
voodooattack
  • 1,127
  • 9
  • 16
1
vote
1 answer

Boost polygon library Boolean function computation time

Have anyone used the Boolean function of Boost polygon library? Boost polygon library It says that the algorithm is O(nlogn) in time complexity, n = #points I input 200000 random generated polygons (with 5~8 potins) but the OR and XOR function cost…
user1815783
  • 45
  • 2
  • 7
0
votes
0 answers

Is the high resolution for a 32 bit integer in boost::polygon out of date in Windows?

I recently tested boost::polygon to perform complex Boolean unions of polygonal data with overlapping segments and many intersections to one point. I had to change the default high_precision_type::type to multiprecision::int128_t because it…
Catriel
  • 461
  • 3
  • 11