diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index 02eec4e355..e4ea9c46cb 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -22,6 +22,7 @@ import PathScripts.PathOp as PathOp +import PathScripts.PathUtils as PathUtils import Path import FreeCAD import FreeCADGui @@ -103,15 +104,27 @@ def GenerateGCode(op,obj,adaptiveResults, helixDiameter): if stepUp<0: stepUp=0 + + finish_step = obj.FinishDepth.Value if hasattr(obj, "FinishDepth") else 0.0 + if finish_step>stepDown: finish_step = stepDown + + depth_params = PathUtils.depth_params( + clearance_height=obj.ClearanceHeight.Value, + safe_height=obj.SafeHeight.Value, + start_depth=obj.StartDepth.Value, + step_down=stepDown, + z_finish_step=finish_step, + final_depth=obj.FinalDepth.Value, + user_depths=None) + + + lx=adaptiveResults[0]["HelixCenterPoint"][0] ly=adaptiveResults[0]["HelixCenterPoint"][1] lz=passStartDepth step=0 - while passStartDepth>obj.FinalDepth.Value and step<1000: + for passEndDepth in depth_params.data: step=step+1 - passEndDepth=passStartDepth-stepDown - if passEndDepth