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
3
votes
1 answer

boost::polygon and boost/geometry/geometries/polygon difference?

I have two questions: 1.) i^ve just found the boost 1.53 Polygon implementation (on http://www.boost.org/doc/libs/1_53_0/libs/polygon) and would like to test it, because the features are amazing for CAD programmers like me. (But i dont get the…
user1911091
  • 1,219
  • 2
  • 14
  • 32
2
votes
1 answer

Remove vector lines which are too close to each other?

I'm currently using boost::polygon::detail::resize() function to enlarge or shrink the outline of a polygon by a specific size. This is working well and gives proper results. Now in some cases, depending on the input shape, the resulting polygon…
Elmi
  • 5,899
  • 15
  • 72
  • 143
2
votes
1 answer

Combining two polygons into one polygon in Boost.Geometry: Exterior points only, no holes

I have two polygons. I want to combine them into one polygon such that it includes the exterior points only without any holes. How can I do that? Code with little explanation would be very helpful. Thank you. See the picture for better…
2
votes
1 answer

Expand polygons with boost::geometry?

I know it is possible to add/subtract different polygons to/from each other via boost::geometry, examples can be found at different places in web. Now what I want to do is something different: I have a 2D polygon which I want to expand/shrink by a…
Elmi
  • 5,899
  • 15
  • 72
  • 143
2
votes
1 answer

boost::polygon_90_data can not handle polygons with 0 area value?

My polygon has integer coordinates and may be like a line, I find boost::polygon_90_data can handle some of them, but this one can not be: namespace gtl = boost::polygon; typedef gtl::polygon_90_data Polygon; typedef…
kyleqian
  • 311
  • 1
  • 3
  • 14
2
votes
0 answers

Getting all the points within boost polygon

I want to get all the points(with integer valued indices) within the boundary of a polygon. There is an API function to query if the point is inside a polygon but I want to get the list of all the points. Is there any API functionality in boost…
mdemirst
  • 510
  • 1
  • 5
  • 8
2
votes
0 answers

Boost::Polygon : Get list of polygons from polygon_set

I'm building program which outputs complex mesh of an object. To reduce number of adjacent polygons facing the same direction I decided to use Boost::Polygon. Now I have a trouble - first, program doesn't want to output proper data of trapezoids,…
Ch3shire
  • 1,095
  • 2
  • 14
  • 39
2
votes
1 answer

Boost Polygon: Issue with euclidean_distance

I have the following code which is supposed to compute the Euclidean distance between two rectangles. I compiled using GCC 4.7.3 and Boost v1.58.0 #include #include #include #include…
user4979733
  • 3,181
  • 4
  • 26
  • 41
2
votes
0 answers

How to merge multiple polygons with Boost.polygon?

I would like to merge a polygon with a set of polygons with Boost.polygon. For example merging the polygon C to the set (A, B) from the above picture would give the following result: How can I do that? I thought about adding each polygons to a…
arthur.sw
  • 11,052
  • 9
  • 47
  • 104
2
votes
1 answer

Polygon intersection with boost

I'm trying to intersect two polygons by using the Boost Polygon library. I'm started from the example of a custom_polygon proposed from the boost website: http://www.boost.org/doc/libs/1_59_0/libs/polygon/doc/gtl_custom_polygon.htm In the…
2
votes
1 answer

view_as use in Boost Polygon library

Can anyone guide me how view_as can be used. Or maybe an example in boost polygon library? In documentation, it's mentioned that we can type cast from one to another. http://www.boost.org/doc/libs/1_58_0/libs/polygon/doc/gtl_polygon_90_concept.htm
user765443
  • 1,856
  • 7
  • 31
  • 56
2
votes
1 answer

Using Boost.Polygon to slice manhattan polygons

I am having trouble slicing a Manhattan (rectilinear) polygon into rectangles using the get_rectangles(output_container_type& output, const T& polygon_set) method in Boost.Polygon. It does not seem to work on self-intersecting polygons, such as the…
user21760
  • 93
  • 5
1
vote
1 answer

Boost polygon only supports hard coded point data

I am trying to split polygons into bunch of rectangles. For that I am using boost polygon library. When i try to take input from user (in vector for e.g. here) the program gives unintended result but same values when hard-coded (commented in the…
kil47
  • 53
  • 1
  • 9
1
vote
2 answers

Boost polygon union result is differing between windows and linux

I am trying to get a union of all the individual polygons via boost geometry. But oddly the results seem to vary between windows and centOS. The result is coming out right one (the one i expect) in windows BUT in linux its odd. In linux it shows…
Test
  • 564
  • 3
  • 12
1
vote
1 answer

Why doesn't i get any intersections of these polygons?

I learn how to use boost::polygon library with custom polygons. I took an example with usage of custom polygons and tried to get intersections of these. I doesn't get any intersection and can't understand why. Also, you can see this…