Arch: fixed normal direction bug in structures

This commit is contained in:
Yorik van Havre
2017-08-08 18:30:26 -03:00
parent 673da2ba9a
commit 46ff910e74

View File

@@ -540,15 +540,20 @@ class _Structure(ArchComponent.Component):
baseface = Part.Face(Part.makePolygon([v1,v2,v3,v4,v1]))
base,placement = self.rebase(baseface)
if base and placement:
if obj.Normal == Vector(0,0,0):
if not normal:
normal = Vector(0,0,1)
else:
if obj.Normal.Length:
normal = Vector(obj.Normal)
normal = placement.inverse().Rotation.multVec(normal)
if not normal:
normal = Vector(0,0,1)
if not normal.Length:
normal = Vector(0,0,1)
extrusion = normal
if (length > height) and (obj.Role != "Slab"):
extrusion = normal.multiply(length)
if length:
extrusion = normal.multiply(length)
else:
extrusion = normal.multiply(height)
if height:
extrusion = normal.multiply(height)
return (base,extrusion,placement)
return None