Skip to content

Commit

Permalink
Path: Several small bugs related to Arch Panel support in Path.
Browse files Browse the repository at this point in the history
Sheet tag placement not including the sheet offset
contour not using sheet attributes
Engraving not using sheet attributes
Profile not using transform.
  • Loading branch information
sliptonic committed Mar 21, 2017
1 parent 4d9169f commit 34324c6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
5 changes: 4 additions & 1 deletion src/Mod/Arch/ArchPanel.py
Expand Up @@ -949,7 +949,10 @@ def getTags(self,obj,transform=False):
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

Expand Down
19 changes: 10 additions & 9 deletions src/Mod/Path/PathScripts/PathContour.py
Expand Up @@ -227,15 +227,16 @@ def execute(self, obj):
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))

Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Path/PathScripts/PathDrilling.py
Expand Up @@ -205,6 +205,7 @@ def findHoles(self, obj, shape):
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)
Expand All @@ -215,6 +216,7 @@ def findHoles(self, obj, shape):
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)
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Path/PathScripts/PathEngrave.py
Expand Up @@ -131,7 +131,8 @@ def execute(self, obj):
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:
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Path/PathScripts/PathProfile.py
Expand Up @@ -284,7 +284,7 @@ def execute(self, obj):
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
Expand All @@ -295,7 +295,7 @@ def execute(self, obj):
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)
Expand Down

0 comments on commit 34324c6

Please sign in to comment.