Fixed selection of vertexes and faces - and added support for faces as base objects.
This commit is contained in:
@@ -106,7 +106,9 @@ class ObjectEngrave(PathOp.ObjectOp):
|
||||
elif obj.Base:
|
||||
wires = []
|
||||
for base, subs in obj.Base:
|
||||
edges = [base.Shape.getElement(sub) for sub in subs]
|
||||
edges = []
|
||||
for sub in subs:
|
||||
edges.extend(base.Shape.getElement(sub).Edges)
|
||||
wires.extend(TechDraw.edgeWalker(edges))
|
||||
output += self.buildpathocc(obj, wires, zValues)
|
||||
self.wires = wires
|
||||
@@ -124,8 +126,8 @@ class ObjectEngrave(PathOp.ObjectOp):
|
||||
self.commandlist.append(Path.Command('G0', {'Z': obj.ClearanceHeight.Value, 'F': self.vertRapid}))
|
||||
|
||||
except Exception as e:
|
||||
#PathLog.error("Exception: %s" % e)
|
||||
#traceback.print_exc()
|
||||
PathLog.error("Exception: %s" % e)
|
||||
traceback.print_exc()
|
||||
PathLog.error(translate("Path", "The Job Base Object has no engraveable element. Engraving operation will produce no output."))
|
||||
|
||||
def buildpathocc(self, obj, wires, zValues):
|
||||
|
||||
@@ -61,8 +61,12 @@ class TaskPanelBaseGeometryPage(PathOpGui.TaskPanelBaseGeometryPage):
|
||||
if sel.Object.isDerivedFrom('Part::Part2DObject'):
|
||||
if sel.HasSubObjects:
|
||||
for sub in sel.SubElementNames:
|
||||
self.obj.Proxy.addBase(self.obj, sel.Object, sub)
|
||||
if 'Vertex' in sub:
|
||||
PathLog.info(translate("Path", "Ignoring vertex"))
|
||||
else:
|
||||
self.obj.Proxy.addBase(self.obj, sel.Object, sub)
|
||||
else:
|
||||
self.obj.Base = [p for p,el in self.obj.Base if p != sel.Object]
|
||||
shapes.append(sel.Object)
|
||||
self.obj.BaseShapes = shapes
|
||||
added = True
|
||||
|
||||
@@ -675,9 +675,9 @@ class TaskPanelDepthsPage(TaskPanelPage):
|
||||
def selectionZLevel(self, sel):
|
||||
if len(sel) == 1 and len(sel[0].SubObjects) == 1:
|
||||
sub = sel[0].SubObjects[0]
|
||||
if 'Vertex' == sub.ShapeType:
|
||||
return sub.Z
|
||||
if PathGeom.isHorizontal(sub):
|
||||
if 'Vertex' == sub.ShapeType:
|
||||
return sub.Z
|
||||
if 'Edge' == sub.ShapeType:
|
||||
return sub.Vertexes[0].Z
|
||||
if 'Face' == sub.ShapeType:
|
||||
|
||||
Reference in New Issue
Block a user