Fixed ProfileEdges for multi base models.

This commit is contained in:
Markus Lampert
2018-09-09 00:08:25 -07:00
committed by wmayer
parent 48d058dc78
commit 900a05bca6

View File

@@ -80,23 +80,23 @@ class ObjectProfile(PathProfileBase.ObjectProfile):
shapes = []
if obj.Base:
wires = []
basewires = []
for b in obj.Base:
edgelist = []
for sub in b[1]:
edgelist.append(getattr(b[0].Shape, sub))
wires.extend(findWires(edgelist))
basewires.append((b[0], findWires(edgelist)))
for wire in wires:
f = Part.makeFace(wire, 'Part::FaceMakerSimple')
for base,wires in basewires:
for wire in wires:
f = Part.makeFace(wire, 'Part::FaceMakerSimple')
# shift the compound to the bottom of the base object for
# proper sectioning
zShift = b[0].Shape.BoundBox.ZMin - f.BoundBox.ZMin
newPlace = FreeCAD.Placement(FreeCAD.Vector(0, 0, zShift), f.Placement.Rotation)
f.Placement = newPlace
for base in self.model:
# shift the compound to the bottom of the base object for
# proper sectioning
zShift = b[0].Shape.BoundBox.ZMin - f.BoundBox.ZMin
newPlace = FreeCAD.Placement(FreeCAD.Vector(0, 0, zShift), f.Placement.Rotation)
f.Placement = newPlace
env = PathUtils.getEnvelope(base.Shape, subshape=f, depthparams=self.depthparams)
shapes.append((env, False))
return shapes