fountainment/convex-decomposition

Change the fim::eps value

Bjergsen-dev opened this issue · 1 comments

PolygonList Polygon::cutPolygon(int ccPoint)
{
PolygonList res;
int best = getBestPointIndex(ccPoint);
if (best != -1) {
return cutPolygon(ccPoint, best);
} else {
auto left = -getVector(ccPoint);
auto right = getVector(ccPoint - 1);
//Do not normalize when finding the angle bisector of the reverse extension line of the vector
//auto middleVec = (left.normalize() + right.normalize()) / 2.0;
auto middleVec = (left+ right) / 2.0;
auto pl = collideRay(getPoint(ccPoint), middleVec);
if (!pl.empty()) {
int loc = insertPoint(pl[0]);
if (loc <= ccPoint) {
ccPoint = indexNormalize(ccPoint + 1);
}
return cutPolygon(ccPoint, loc);
} else {
//TODO: debug output
}
}
return res;
}

i was wrong!
The problem is that the accuracy is too high so i change the eps value like this extern const double fim::eps = 1e-5;