Skip to content
Snippets Groups Projects
Commit eb796904 authored by junzhang's avatar junzhang
Browse files

A change is made regarding to the issue #43

The problem is that the intersection() function related to the precision of the coordinate for each vertex
parent 4238ef5b
No related branches found
No related tags found
No related merge requests found
...@@ -240,10 +240,10 @@ vector<polygon_2d> Method_D::GetPolygons(vector<double>& XInFrame, vector<double ...@@ -240,10 +240,10 @@ vector<polygon_2d> Method_D::GetPolygons(vector<double>& XInFrame, vector<double
} }
polygons = vd.cutPolygonsWithGeometry(polygons, _geoPoly, XInFrame, YInFrame); polygons = vd.cutPolygonsWithGeometry(polygons, _geoPoly, XInFrame, YInFrame);
/* for(auto && p:polygons) for(auto && p:polygons)
{ {
ReducePrecision(p); ReducePrecision(p);
}*/ }
return polygons; return polygons;
} }
/** /**
...@@ -564,8 +564,8 @@ void Method_D::ReducePrecision(polygon_2d& polygon) ...@@ -564,8 +564,8 @@ void Method_D::ReducePrecision(polygon_2d& polygon)
{ {
for(auto&& point:polygon.outer()) for(auto&& point:polygon.outer())
{ {
point.x(round(point.x() * 100.0) / 100.0); point.x(round(point.x() * 100000000000.0) / 100000000000.0);
point.y(round(point.y() * 100.0) / 100.0); point.y(round(point.y() * 100000000000.0) / 100000000000.0);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment