From 34324c654781c198b0b98ea65ec1bb3b857bff65 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Tue, 21 Mar 2017 14:59:22 -0500 Subject: [PATCH] Path: Several small bugs related to Arch Panel support in Path. Sheet tag placement not including the sheet offset contour not using sheet attributes Engraving not using sheet attributes Profile not using transform. --- src/Mod/Arch/ArchPanel.py | 5 ++++- src/Mod/Path/PathScripts/PathContour.py | 19 ++++++++++--------- src/Mod/Path/PathScripts/PathDrilling.py | 2 ++ src/Mod/Path/PathScripts/PathEngrave.py | 3 ++- src/Mod/Path/PathScripts/PathProfile.py | 4 ++-- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/Mod/Arch/ArchPanel.py b/src/Mod/Arch/ArchPanel.py index 18d96be44b..72a063702e 100644 --- a/src/Mod/Arch/ArchPanel.py +++ b/src/Mod/Arch/ArchPanel.py @@ -949,7 +949,10 @@ class PanelSheet(Draft._DraftObject): w.Placement = obj.Placement.multiply(w.Placement) outp.append(w) if self.sheettag is not None: - outp.append(self.sheettag) + w = self.sheettag.copy() + if transform: + w.Placement = obj.Placement.multiply(w.Placement) + outp.append(w) return outp diff --git a/src/Mod/Path/PathScripts/PathContour.py b/src/Mod/Path/PathScripts/PathContour.py index 8ea6483c0d..e6000e25f9 100644 --- a/src/Mod/Path/PathScripts/PathContour.py +++ b/src/Mod/Path/PathScripts/PathContour.py @@ -227,15 +227,16 @@ class ObjectContour: baseobject.Proxy.execute(baseobject) for subobj in baseobject.Group: # process the group of panels if isinstance(subobj.Proxy, ArchPanel.PanelCut): - subobj.Proxy.execute(subobj) - contourwire = TechDraw.findOuterWire(subobj.Shape.Edges) - if contourwire is not None: - edgelist = contourwire.Edges - edgelist = Part.__sortEdges__(edgelist) - try: - output += self._buildPathLibarea(obj, edgelist) - except: - FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.") + shapes = baseobject.Proxy.getOutlines(baseobject, transform=True) + for shape in shapes: + for wire in shape.Wires: + edgelist = wire.Edges + edgelist = Part.__sortEdges__(edgelist) + PathLog.debug("Processing panel perimeter. edges found: {}".format(len(edgelist))) # subobj.Proxy.execute(subobj) + try: + output += self._buildPathLibarea(obj, edgelist) + except: + FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.") else: contourwire = TechDraw.findShapeOutline(baseobject.Shape, 1, Vector(0, 0, 1)) diff --git a/src/Mod/Path/PathScripts/PathDrilling.py b/src/Mod/Path/PathScripts/PathDrilling.py index 5499c467ff..4a80927a29 100644 --- a/src/Mod/Path/PathScripts/PathDrilling.py +++ b/src/Mod/Path/PathScripts/PathDrilling.py @@ -205,6 +205,7 @@ class ObjectDrilling: tooldiameter = obj.ToolController.Proxy.getTool(obj.ToolController).Diameter PathLog.debug('search for holes larger than tooldiameter: {}: '.format(tooldiameter)) if dgu.isPlanar(shape): + PathLog.debug("shape is planar") for i in range(len(shape.Edges)): candidateEdgeName = "Edge" + str(i +1) e = shape.getElement(candidateEdgeName) @@ -215,6 +216,7 @@ class ObjectDrilling: diameter = e.BoundBox.XLength holelist.append((candidateEdgeName, e, x, y, diameter)) else: + PathLog.debug("shape is not planar") for i in range(len(shape.Faces)): candidateFaceName = "Face" + str(i + 1) f = shape.getElement(candidateFaceName) diff --git a/src/Mod/Path/PathScripts/PathEngrave.py b/src/Mod/Path/PathScripts/PathEngrave.py index 6ab7b183f8..45605e2605 100644 --- a/src/Mod/Path/PathScripts/PathEngrave.py +++ b/src/Mod/Path/PathScripts/PathEngrave.py @@ -131,7 +131,8 @@ class ObjectPathEngrave: output += self.buildpathocc(obj, wires) elif isinstance(baseobject.Proxy, ArchPanel.PanelSheet): # process the sheet - shapes = baseobject.Proxy.getTags(baseobject) + + shapes = baseobject.Proxy.getTags(baseobject, transform=True) for shape in shapes: output += "G0 Z" + PathUtils.fmt(obj.ClearanceHeight.Value) + "F " + PathUtils.fmt(self.vertRapid) + "\n" for w in shape.Wires: diff --git a/src/Mod/Path/PathScripts/PathProfile.py b/src/Mod/Path/PathScripts/PathProfile.py index 440117ff65..864ea8c3f8 100644 --- a/src/Mod/Path/PathScripts/PathProfile.py +++ b/src/Mod/Path/PathScripts/PathProfile.py @@ -284,7 +284,7 @@ print "y - " + str(point.y) if hasattr(baseobject, "Proxy"): if isinstance(baseobject.Proxy, ArchPanel.PanelSheet): # process the sheet if obj.processPerimeter: - shapes = baseobject.Proxy.getOutlines(baseobject, transform=False) + shapes = baseobject.Proxy.getOutlines(baseobject, transform=True) for shape in shapes: for wire in shape.Wires: edgelist = wire.Edges @@ -295,7 +295,7 @@ print "y - " + str(point.y) except: FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.") - shapes = baseobject.Proxy.getHoles(baseobject, transform=False) + shapes = baseobject.Proxy.getHoles(baseobject, transform=True) for shape in shapes: for wire in shape.Wires: drillable = PathUtils.isDrillable(baseobject.Proxy, wire)