Path : Adaotive - fix for finishing pass supression outside stock

This commit is contained in:
kreso-t
2018-09-08 00:38:06 +02:00
committed by wmayer
parent 70837364bd
commit 02da157bef

View File

@@ -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;