From e2e0735677bcbc99cdaa6453306ba4c88167c362 Mon Sep 17 00:00:00 2001 From: Itai Nahshon Date: Fri, 15 Sep 2017 04:02:16 +0300 Subject: [PATCH] Some fixes related to milling heights and depths. Fix for large "Step Down". Correctly handling a part that was moved down the Z axis. Handle "Finish Depth". --- src/Mod/Path/App/Area.cpp | 10 +--------- src/Mod/Path/PathScripts/PathAreaOp.py | 5 +++-- src/Mod/Path/PathScripts/PathUtils.py | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index 2fde575bb8..1f50b770d5 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -2998,18 +2998,10 @@ void Area::toPath(Toolpath &path, const std::list &shapes, threshold = Precision::Confusion(); threshold *= threshold; - resume_height = fabs(resume_height); - if(resume_height < Precision::Confusion()) - resume_height = stepdown_hint; - - retraction = fabs(retraction); - if(retraction < Precision::Confusion()) - retraction = (pstart.*getter)()+resume_height; - // in case the user didn't specify feed start, sortWire() will choose one // based on the bound. We'll further adjust that according to resume height if(!_pstart || pstart.SquareDistance(*_pstart)>Precision::SquareConfusion()) - (pstart.*setter)((pstart.*getter)()+resume_height); + (pstart.*setter)(resume_height); gp_Pnt plast,p; // initial vertial rapid pull up to retraction (or start Z height if higher) diff --git a/src/Mod/Path/PathScripts/PathAreaOp.py b/src/Mod/Path/PathScripts/PathAreaOp.py index 47d56b611d..3614fe5e06 100644 --- a/src/Mod/Path/PathScripts/PathAreaOp.py +++ b/src/Mod/Path/PathScripts/PathAreaOp.py @@ -197,7 +197,7 @@ class ObjectOp(PathOp.ObjectOp): pathParams['feedrate'] = self.horizFeed pathParams['feedrate_v'] = self.vertFeed pathParams['verbose'] = True - pathParams['resume_height'] = obj.StepDown.Value + pathParams['resume_height'] = obj.SafeHeight.Value pathParams['retraction'] = obj.ClearanceHeight.Value pathParams['return_end'] = True # Note that emitting preambles between moves breaks some dressups and prevents path optimization on some controllers @@ -237,12 +237,13 @@ class ObjectOp(PathOp.ObjectOp): PathLog.track() self.endVector = None + finish_step = obj.FinishDepth.Value if hasattr(obj, "FinishDepth") else 0.0 self.depthparams = PathUtils.depth_params( clearance_height=obj.ClearanceHeight.Value, safe_height=obj.SafeHeight.Value, start_depth=obj.StartDepth.Value, step_down=obj.StepDown.Value, - z_finish_step=0.0, + z_finish_step=finish_step, final_depth=obj.FinalDepth.Value, user_depths=None) diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 206c00a3af..88f9fd02f4 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -816,7 +816,7 @@ class depth_params: raise ValueError('z_finish_step must be less than step_down') self.__clearance_height = clearance_height - self.__safe_height = math.fabs(safe_height) + self.__safe_height = safe_height self.__start_depth = start_depth self.__step_down = math.fabs(step_down) self.__z_finish_step = math.fabs(z_finish_step)