Bugfix in Arch Wall
This commit is contained in:
parent
d4b5a079d9
commit
4e2a6eb1fb
|
@ -249,14 +249,11 @@ class _Wall(ArchComponent.Component):
|
||||||
"The width of this wall. Not used if this wall is based on a face")
|
"The width of this wall. Not used if this wall is based on a face")
|
||||||
obj.addProperty("App::PropertyLength","Height","Base",
|
obj.addProperty("App::PropertyLength","Height","Base",
|
||||||
"The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid")
|
"The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid")
|
||||||
obj.addProperty("App::PropertyLength","Length","Base",
|
|
||||||
"The length of this wall. Not used if this wall is based on a shape")
|
|
||||||
obj.addProperty("App::PropertyEnumeration","Align","Base",
|
obj.addProperty("App::PropertyEnumeration","Align","Base",
|
||||||
"The alignment of this wall on its base object, if applicable")
|
"The alignment of this wall on its base object, if applicable")
|
||||||
obj.Align = ['Left','Right','Center']
|
obj.Align = ['Left','Right','Center']
|
||||||
self.Type = "Wall"
|
self.Type = "Wall"
|
||||||
obj.Width = 0.1
|
obj.Width = 0.1
|
||||||
obj.Length = 1
|
|
||||||
obj.Height = 0
|
obj.Height = 0
|
||||||
|
|
||||||
def execute(self,obj):
|
def execute(self,obj):
|
||||||
|
@ -288,6 +285,9 @@ class _Wall(ArchComponent.Component):
|
||||||
def createGeometry(self,obj):
|
def createGeometry(self,obj):
|
||||||
"builds the wall shape"
|
"builds the wall shape"
|
||||||
|
|
||||||
|
if not obj.Base:
|
||||||
|
return
|
||||||
|
|
||||||
import Part
|
import Part
|
||||||
from draftlibs import fcgeo
|
from draftlibs import fcgeo
|
||||||
|
|
||||||
|
@ -346,36 +346,25 @@ class _Wall(ArchComponent.Component):
|
||||||
|
|
||||||
# computing shape
|
# computing shape
|
||||||
base = None
|
base = None
|
||||||
if obj.Base:
|
if obj.Base.isDerivedFrom("Part::Feature"):
|
||||||
if obj.Base.isDerivedFrom("Part::Feature"):
|
if not obj.Base.Shape.isNull():
|
||||||
if not obj.Base.Shape.isNull():
|
base = obj.Base.Shape.copy()
|
||||||
base = obj.Base.Shape.copy()
|
if base.Solids:
|
||||||
if base.Solids:
|
pass
|
||||||
pass
|
elif base.Faces:
|
||||||
elif base.Faces:
|
if height:
|
||||||
if height:
|
norm = normal.multiply(height)
|
||||||
norm = normal.multiply(height)
|
base = base.extrude(norm)
|
||||||
base = base.extrude(norm)
|
elif base.Wires:
|
||||||
elif base.Wires:
|
temp = None
|
||||||
temp = None
|
for wire in obj.Base.Shape.Wires:
|
||||||
for wire in obj.Base.Shape.Wires:
|
sh = getbase(wire)
|
||||||
sh = getbase(wire)
|
if temp:
|
||||||
if temp:
|
temp = temp.fuse(sh)
|
||||||
temp = temp.fuse(sh)
|
else:
|
||||||
else:
|
temp = sh
|
||||||
temp = sh
|
base = temp
|
||||||
base = temp
|
base = base.removeSplitter()
|
||||||
base = base.removeSplitter()
|
|
||||||
if not base:
|
|
||||||
if obj.Length == 0:
|
|
||||||
return
|
|
||||||
length = obj.Length
|
|
||||||
if not length:
|
|
||||||
length = 1
|
|
||||||
v1 = Vector(0,0,0)
|
|
||||||
v2 = Vector(length,0,0)
|
|
||||||
w = Part.Wire(Part.Line(v1,v2).toShape())
|
|
||||||
base = getbase(w)
|
|
||||||
|
|
||||||
for app in obj.Additions:
|
for app in obj.Additions:
|
||||||
base = base.oldFuse(app.Shape)
|
base = base.oldFuse(app.Shape)
|
||||||
|
@ -395,7 +384,8 @@ class _Wall(ArchComponent.Component):
|
||||||
base = base.cut(hole.Shape)
|
base = base.cut(hole.Shape)
|
||||||
hole.ViewObject.hide() # to be removed
|
hole.ViewObject.hide() # to be removed
|
||||||
|
|
||||||
obj.Shape = base
|
if base:
|
||||||
|
obj.Shape = base
|
||||||
if not fcgeo.isNull(pl):
|
if not fcgeo.isNull(pl):
|
||||||
obj.Placement = pl
|
obj.Placement = pl
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user