Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Aggregate base edges into wires for engraving.
  • Loading branch information
mlampert authored and yorikvanhavre committed Jun 12, 2018
1 parent 8faf50e commit 3c3239a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Mod/Path/PathScripts/PathEngrave.py
Expand Up @@ -150,18 +150,23 @@ def opExecute(self, obj):
PathLog.track()
wires = []
for base, subs in obj.Base:
#edges = []
edges = []
#for sub in subs:
# edges.extend(base.Shape.getElement(sub).Edges)
#shapeWires = adjustWirePlacement(obj, base, TechDraw.edgeWalker(edges))
#wires.extend(shapeWires)
for feature in subs:
sub = base.Shape.getElement(feature)
if sub.Wires:
shapeWires = sub.Wires
if type(sub) == Part.Edge:
edges.append(sub)
elif sub.Wires:
wires.extend(sub.Wires)
else:
shapeWires = [Part.Wire(sub.Edges)]
wires.extend(adjustWirePlacement(obj, base, shapeWires))
wires.append(Part.Wire(sub.Edges))

for edgelist in Part.sortEdges(edges):
wires.append(Part.Wire(edgelist))
wires = adjustWirePlacement(obj, base, wires)
self.buildpathocc(obj, wires, zValues)
self.wires = wires
elif not obj.BaseShapes:
Expand All @@ -184,7 +189,7 @@ def opExecute(self, obj):

def buildpathocc(self, obj, wires, zValues):
'''buildpathocc(obj, wires, zValues) ... internal helper function to generate engraving commands.'''
PathLog.track()
PathLog.track(obj.Label, len(wires), zValues)

for wire in wires:
offset = wire
Expand Down

0 comments on commit 3c3239a

Please sign in to comment.