From 3928b5c852fbad4b0bf1a39b900b8b37fcb5440a Mon Sep 17 00:00:00 2001 From: kreso-t Date: Sat, 1 Sep 2018 20:22:01 +0200 Subject: [PATCH] Path: Adaptive - bugfix --- src/Mod/Path/libarea/Adaptive.cpp | 10 +++++----- src/Mod/Path/libarea/Adaptive.hpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index e1de31d59b..cad2159c76 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -898,7 +898,7 @@ namespace AdaptivePath { if(opType==OperationType::otClearingOutside) { clipof.Clear(); clipof.AddPaths(stockInputPaths,JoinType::jtRound,EndType::etClosedPolygon); - double overshootDistance =2*toolRadiusScaled + toolRadiusScaled*stepOverFactor; + double overshootDistance =2*toolRadiusScaled + toolRadiusScaled*stepOverFactor + OVERSHOOT_ADDON_DIST; if(forceInsideOut) overshootDistance=0; Paths stockOvershoot; clipof.Execute(stockOvershoot,overshootDistance); @@ -1086,13 +1086,13 @@ namespace AdaptivePath { // if point is outside the stock if(PointInPolygon(checkPoint,stockInputPaths.front())==0) { clipof.Clear(); - clipof.AddPaths(toolBoundPaths,JoinType::jtRound,EndType::etClosedPolygon); + clipof.AddPath(pth,JoinType::jtRound,EndType::etClosedPolygon); Paths sol2; - clipof.Execute(sol2,toolRadiusScaled*stepOverFactor*2); + clipof.Execute(sol2,toolRadiusScaled*stepOverFactor*2 + OVERSHOOT_ADDON_DIST); clipof.Clear(); clipof.AddPaths(sol2,JoinType::jtRound,EndType::etClosedLine); - clipof.Execute(cleared,toolRadiusScaled); - // trim cleared paths to stock boundary (only outside part remain) + clipof.Execute(cleared,toolRadiusScaled + OVERSHOOT_ADDON_DIST ); + clip.Clear(); clip.AddPaths(cleared,PolyType::ptSubject, true); clip.AddPaths(stockInputPaths,PolyType::ptClip, true); diff --git a/src/Mod/Path/libarea/Adaptive.hpp b/src/Mod/Path/libarea/Adaptive.hpp index d06b8d6d7d..ff9351107b 100644 --- a/src/Mod/Path/libarea/Adaptive.hpp +++ b/src/Mod/Path/libarea/Adaptive.hpp @@ -124,6 +124,8 @@ namespace AdaptivePath { const long PASSES_LIMIT = __LONG_MAX__; // limit used while debugging const long POINTS_PER_PASS_LIMIT = __LONG_MAX__; // limit used while debugging const time_t PROGRESS_TICKS = CLOCKS_PER_SEC/20; // progress report interval + + const long OVERSHOOT_ADDON_DIST=10; }; } #endif \ No newline at end of file