diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index 17596e0f96..22a0141416 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -126,11 +126,11 @@ namespace AdaptivePath { void AverageDirection(const vector &unityVectors, DoublePoint& output) { - int size=unityVectors.size(); + std::size_t size=unityVectors.size(); output.X =0; output.Y=0; // sum vectors - for(int i=0;i= long(clpSegmentIndex1-1)) minIndex -= closestPath.size(); - for(long i=clpSegmentIndex1-1;i>=minIndex;i--) { + if(minIndex >= long(clpSegmentIndex1-1)) minIndex -= long(closestPath.size()); + for(long i=long(clpSegmentIndex1)-1;i>=minIndex;i--) { long index=i; - if(index<0) index+= closestPath.size(); + if(index<0) index+= long(closestPath.size()); if(sqrt(DistanceSqrd(rev_result.back(),closestPath.at(index)))>NTOL) rev_result << closestPath.at(index); } if(sqrt(DistanceSqrd(rev_result.back(),clp2)) >NTOL) rev_result << clp2; @@ -465,7 +465,7 @@ namespace AdaptivePath { if(dist=long(closestPath.size())) index-=closestPath.size(); + long index=closestPointIndex+long(i); + if(index>=long(closestPath.size())) index-=long(closestPath.size()); result.push_back(closestPath.at(index)); } // remove the closest path @@ -1751,7 +1751,7 @@ namespace AdaptivePath { if(!forceInsideOut && FindEntryPointOutside(progressPaths, toolBoundPaths, boundPaths, cleared, entryPoint, toolPos,toolDir)) { - if( Orientation(engageBounds[0])<0) ReversePath(engageBounds[0]); + if( Orientation(engageBounds[0]) == false) ReversePath(engageBounds[0]); //engageBounds.erase(engageBounds.begin()); // add initial offset of cleared area to engage paths Paths outsideEngage; @@ -1976,7 +1976,7 @@ namespace AdaptivePath { double distFromStart = sqrt(DistanceSqrd(toolPos,startPoint)); bool distanceTrend = distFromStart > prevDistFromStart ? true : false; - if(distFromStart!=prevDistTrend || toClearPath.size()>10) { + if(distanceTrend!=prevDistTrend || toClearPath.size()>10) { Perf_ExpandCleared.Start(); // expand cleared clipof.Clear(); @@ -2056,7 +2056,7 @@ namespace AdaptivePath { if(cumulativeCutArea>tolerance*MIN_CUT_AREA_FACTOR*stepScaled*stepOverFactor*referenceCutArea) { Path cleaned; CleanPath(passToolPath,cleaned,CLEAN_PATH_TOLERANCE); - total_output_points+=cleaned.size(); + total_output_points+=long(cleaned.size()); AppendToolPath(progressPaths, output,cleaned,clearedBeforePass,toolBoundPaths); CheckReportProgress(progressPaths); bad_engage_count=0; diff --git a/src/Mod/Path/libarea/Adaptive.hpp b/src/Mod/Path/libarea/Adaptive.hpp index cf9f8f2303..e454140c4d 100644 --- a/src/Mod/Path/libarea/Adaptive.hpp +++ b/src/Mod/Path/libarea/Adaptive.hpp @@ -108,7 +108,7 @@ namespace AdaptivePath { long bbox_size=0; double referenceCutArea=0; double optimalCutAreaPD=0; - double minCutAreaPD=0; + //double minCutAreaPD=0; bool stopProcessing=false; long unclearLinkingMoveCount = 0;