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 internal representation seems to be 32 bit and doesn't work when my input goes over the max int at 2 billion or so.
is there a way to make the library work with 64 bit integers?
eg: http://www.boost.org/doc/libs/1_62_0/libs/polygon/doc/tutorial/minkowski.cpp
with my naive modifications:
typedef boost::polygon::point_data<long long int> point;
typedef boost::polygon::polygon_set_data<long long int> polygon_set;
typedef boost::polygon::polygon_with_holes_data<long long int> polygon;
...
int main(int argc, char **argv) {
polygon_set a, b, c;
a += boost::polygon::rectangle_data<long long int>(0, 0, 10000000000, 10000000000);
std::vector<polygon> polys;
b += boost::polygon::rectangle_data<long long int>(0, 0, 10000000000, 10000000000);
polys.clear();
convolve_two_polygon_sets(c, a, b);
c.get(polys);
for(int i = 0; i < polys.size(); ++i ){
std::cout << polys[i] << std::endl;
}
return 0;
}
this outputs a polygon, but only for rectangles smaller than max int. The input data are long longs but I assume internally it's still 32 bit. I understand I have to define a new Point struct and use that but not sure how specifically.