From 5eeff9d17f07cb7ae98152686f3c1c7e71d8e274 Mon Sep 17 00:00:00 2001 From: kreso-t Date: Mon, 10 Dec 2018 20:48:54 +0100 Subject: [PATCH] Path: Adaptive - bugfix fix for path cleaning, related to uncleared regions --- src/Mod/Path/libarea/Adaptive.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index 1043373246..dbd1cde03a 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -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 &intersections)