From 1492aa01b506fd4b9282c5c80f6e8ea488f6e24c Mon Sep 17 00:00:00 2001 From: sliptonic Date: Wed, 23 Sep 2020 14:34:57 -0500 Subject: [PATCH] remove need for cuttingedgeheight Calculating from diameter and cuttingedgeangle --- src/Mod/Path/PathScripts/PathVcarve.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathVcarve.py b/src/Mod/Path/PathScripts/PathVcarve.py index fb4b04969c..6501cdc802 100644 --- a/src/Mod/Path/PathScripts/PathVcarve.py +++ b/src/Mod/Path/PathScripts/PathVcarve.py @@ -114,8 +114,11 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): def calculate_depth(MIC): # given a maximum inscribed circle (MIC) and tool angle, # return depth of cut. - maxdepth = obj.ToolController.Tool.CuttingEdgeHeight + + r = obj.ToolController.Tool.Diameter / 2 toolangle = obj.ToolController.Tool.CuttingEdgeAngle + maxdepth = r / math.tan(math.radians(toolangle/2)) + d = round(MIC / math.tan(math.radians(toolangle / 2)), 4) return d if d <= maxdepth else maxdepth @@ -240,11 +243,10 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): '''opExecute(obj) ... process engraving operation''' PathLog.track() - if not (hasattr(obj.ToolController.Tool, "CuttingEdgeAngle") and - hasattr(obj.ToolController.Tool, "CuttingEdgeHeight")): + if not hasattr(obj.ToolController.Tool, "CuttingEdgeAngle"): FreeCAD.Console.PrintError( translate("Path_Vcarve", "VCarve requires an engraving \ - cutter with CuttingEdgeAngle and CuttingEdgeHeight") + "\n") + cutter with CuttingEdgeAngle") + "\n") if obj.ToolController.Tool.CuttingEdgeAngle >= 180.0: FreeCAD.Console.PrintError(