From 5fa725c188dc16da150892d7a28ff1164da453d5 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 18 Jun 2018 21:27:52 -0700 Subject: [PATCH] Always use climb milling for closed wires. --- .../Gui/Resources/panels/PageOpChamferEdit.ui | 2 +- src/Mod/Path/PathScripts/PathChamfer.py | 23 +++++++++++++++---- src/Mod/Path/PathScripts/PathChamferGui.py | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpChamferEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpChamferEdit.ui index 3cba811cfd..2b273871ef 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpChamferEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpChamferEdit.ui @@ -102,7 +102,7 @@ - + diff --git a/src/Mod/Path/PathScripts/PathChamfer.py b/src/Mod/Path/PathScripts/PathChamfer.py index 8e3ce2e7fd..84e6e698b8 100644 --- a/src/Mod/Path/PathScripts/PathChamfer.py +++ b/src/Mod/Path/PathScripts/PathChamfer.py @@ -83,11 +83,13 @@ class ObjectChamfer(PathEngraveBase.ObjectOp): basewires.append(Part.Wire(edgelist)) for w in self.adjustWirePlacement(obj, base, basewires): - wires.append(self.offsetWire(w, base, offset)) + wires.append(self.offsetWire(obj, w, base, offset)) self.wires = wires self.buildpathocc(obj, wires, [depth], True) - def offsetWire(self, wire, base, offset): + def offsetWire(self, obj, wire, base, offset): + PathLog.track(obj.Label) + def removeInsideEdges(edges): def isInside(edge): for v in edge.Vertexes: @@ -97,11 +99,24 @@ class ObjectChamfer(PathEngraveBase.ObjectOp): result = [] return [e for e in edges if not isInside(e)] + def orientWireForClimbMilling(w): + face = Part.Face(w) + cw = 'Forward' == obj.ToolController.SpindleDir + wcw = 0 < face.Surface.Axis.z + if cw != wcw: + PathLog.track('flip wire') + # This works because Path creation will flip the edges accordingly + return Part.Wire([e for e in reversed(w.Edges)]) + PathLog.track('no flip', cw, wcw) + return w + w = wire.makeOffset2D(offset) if wire.isClosed(): if not base.Shape.isInside(w.Edges[0].Vertexes[0].Point, offset/2, True): - return w - return wire.makeOffset2D(-offset) + return orientWireForClimbMilling(w) + w = wire.makeOffset2D(-offset) + return orientWireForClimbMilling(w) + edges = removeInsideEdges(w.Edges) if edges: return Part.Wire(edges) diff --git a/src/Mod/Path/PathScripts/PathChamferGui.py b/src/Mod/Path/PathScripts/PathChamferGui.py index 68a4eacabc..52e87c82ae 100644 --- a/src/Mod/Path/PathScripts/PathChamferGui.py +++ b/src/Mod/Path/PathScripts/PathChamferGui.py @@ -80,6 +80,7 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): self.setupToolController(obj, self.form.toolController) self.form.joinRound.setChecked('Round' == obj.Join) self.form.joinMiter.setChecked('Miter' == obj.Join) + self.form.joinFrame.hide() def updateWidth(self): PathGui.updateInputField(self.obj, 'Width', self.form.value_W)