Path: Adaptive - bugfix

fix for path cleaning, related to uncleared regions
This commit is contained in:
kreso-t
2018-12-10 20:48:54 +01:00
committed by Yorik van Havre
parent 081173e344
commit 5eeff9d17f

View File

@@ -35,7 +35,7 @@ namespace AdaptivePath
{
using namespace ClipperLib;
using namespace std;
#define SAME_POINT_TOL_SQRD_SCALED 16.0
#define SAME_POINT_TOL_SQRD_SCALED 4.0
#define UNUSED(expr) (void)(expr)
//*****************************************
@@ -416,6 +416,13 @@ void CleanPath(const Path &inp, Path &outpt, double tolerance)
outpt.push_back(tmp.at(index));
}
if(DistanceSqrd(outpt.front(),inp.front()) > SAME_POINT_TOL_SQRD_SCALED)
outpt.insert(outpt.begin(), inp.front());
if(DistanceSqrd(outpt.back(),inp.back()) > SAME_POINT_TOL_SQRD_SCALED)
outpt.push_back( inp.back());
}
bool Circle2CircleIntersect(const IntPoint &c1, const IntPoint &c2, double radius, pair<DoublePoint, DoublePoint> &intersections)