From 02da157bef42f6dd22720a85dd4c3e388ff3defa Mon Sep 17 00:00:00 2001 From: kreso-t Date: Sat, 8 Sep 2018 00:38:06 +0200 Subject: [PATCH] Path : Adaotive - fix for finishing pass supression outside stock --- src/Mod/Path/libarea/Adaptive.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index 11575d2b93..dc4f89080d 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -2078,13 +2078,24 @@ namespace AdaptivePath { bool allCutsAllowed=true; while(PopPathWithClosestPoint(finishingPaths,lastPoint,finShiftedPath)) { + if(finShiftedPath.empty()) continue; // skip finishing passes outside the stock boundary - make no sense to cut where is no material bool allPointsOutside=true; + IntPoint p1 = finShiftedPath.front(); for(const auto & pt : finShiftedPath) { + + // midpoint + if(IsPointWithinCutRegion(stockInputPaths,IntPoint((p1.X+pt.X)/2,(p1.Y+pt.Y)/2))) { + allPointsOutside=false; + break; + } + //current point if(IsPointWithinCutRegion(stockInputPaths,pt)) { allPointsOutside=false; break; } + + p1=pt; } if(allPointsOutside) continue;