From 1f9bf2e2a516c217a40af8a6615c8b5718d79805 Mon Sep 17 00:00:00 2001 From: kreso-t Date: Tue, 28 Aug 2018 22:41:17 +0200 Subject: [PATCH] Path: Adaptive - fix for linking moves optimization --- src/Mod/Path/libarea/Adaptive.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index 427ef98f88..a614709b46 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -249,7 +249,7 @@ namespace AdaptivePath { bool IsPointWithinCutRegion(const Paths & toolBoundPaths,const IntPoint & point) { for(size_t i=0; i0 && pip!=0) return false; // is inside hole } return true; @@ -1051,7 +1051,12 @@ namespace AdaptivePath { Clipper clip; mt=MotionType::mtCutting; // asume we can cut trough IntPoint inters; // to hold intersection point - if(IntersectionPoint(toolBoundPaths,lastPoint, nextPoint,inters)) { + if( + !IsPointWithinCutRegion(toolBoundPaths,lastPoint) + || + !IsPointWithinCutRegion(toolBoundPaths,nextPoint) + || + IntersectionPoint(toolBoundPaths,lastPoint, nextPoint,inters)) { // if intersect with boundary - its not clear to cut mt=MotionType::mtLinkNotClear; // cout<<"linking - touches boundary" << endl;