Skip to content

Commit

Permalink
Arch: Misc bugfixes in panel
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Sep 7, 2016
1 parent 4cb20dc commit 7d69810
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions src/Mod/Arch/ArchPanel.py
Expand Up @@ -293,40 +293,39 @@ def execute(self,obj):
if not obj.Base:
return
elif obj.Base.isDerivedFrom("Part::Feature"):
if not obj.Base.Solids:
if not obj.Base.Shape.Solids:
return

# creating base shape
pl = obj.Placement
base = None
normal = None
if obj.Base:
p = FreeCAD.Placement(obj.Base.Placement)
normal = p.Rotation.multVec(Vector(0,0,1))
normal = normal.multiply(thickness)
base = obj.Base.Shape.copy()
if base.Solids:
pass
elif base.Faces:
self.BaseProfile = base
self.ExtrusionVector = normal
base = base.extrude(normal)
elif base.Wires:
closed = True
for w in base.Wires:
if not w.isClosed():
closed = False
if closed:
base = ArchCommands.makeFace(base.Wires)
if not base.Solids:
p = FreeCAD.Placement(obj.Base.Placement)
normal = p.Rotation.multVec(Vector(0,0,1))
normal = normal.multiply(thickness)
if base.Faces:
self.BaseProfile = base
self.ExtrusionVector = normal
base = base.extrude(normal)
elif obj.Base.isDerivedFrom("Mesh::Feature"):
if obj.Base.Mesh.isSolid():
if obj.Base.Mesh.countComponents() == 1:
sh = ArchCommands.getShapeFromMesh(obj.Base.Mesh)
if sh.isClosed() and sh.isValid() and sh.Solids:
base = sh
elif base.Wires:
closed = True
for w in base.Wires:
if not w.isClosed():
closed = False
if closed:
base = ArchCommands.makeFace(base.Wires)
self.BaseProfile = base
self.ExtrusionVector = normal
base = base.extrude(normal)
elif obj.Base.isDerivedFrom("Mesh::Feature"):
if obj.Base.Mesh.isSolid():
if obj.Base.Mesh.countComponents() == 1:
sh = ArchCommands.getShapeFromMesh(obj.Base.Mesh)
if sh.isClosed() and sh.isValid() and sh.Solids:
base = sh
else:
normal = Vector(0,0,1).multiply(thickness)
self.ExtrusionVector = normal
Expand Down

0 comments on commit 7d69810

Please sign in to comment.