Arch: Allow precast beams to have dents too
This commit is contained in:
parent
24c279f92b
commit
26be0067cd
|
@ -57,6 +57,7 @@ class _PrecastBeam(_Precast):
|
|||
obj.addProperty("App::PropertyDistance","Chamfer","Arch","The size of the chamfer of this element")
|
||||
obj.addProperty("App::PropertyDistance","DentLength","Arch","The dent length of this element")
|
||||
obj.addProperty("App::PropertyDistance","DentHeight","Arch","The dent height of this element")
|
||||
obj.addProperty("App::PropertyStringList","Dents","Arch","The dents of this element")
|
||||
obj.Role = ["Beam"]
|
||||
|
||||
def execute(self,obj):
|
||||
|
@ -68,6 +69,7 @@ class _PrecastBeam(_Precast):
|
|||
chamfer = obj.Chamfer.Value
|
||||
dentlength = obj.DentLength.Value
|
||||
dentheight = obj.DentHeight.Value
|
||||
dents = obj.Dents
|
||||
|
||||
if (length == 0) or (width == 0) or (height == 0):
|
||||
return
|
||||
|
@ -108,7 +110,41 @@ class _PrecastBeam(_Precast):
|
|||
d2.translate(Vector(length-dentlength,0,0))
|
||||
shape = shape.cut(d1)
|
||||
shape = shape.cut(d2)
|
||||
|
||||
for dent in dents:
|
||||
dent = dent.split(";")
|
||||
if len(dent) == 7:
|
||||
dentlength = float(dent[0])
|
||||
dentwidth = float(dent[1])
|
||||
dentheight = float(dent[2])
|
||||
dentslant = float(dent[3])
|
||||
dentchamfer = chamfer
|
||||
dentlevel = float(dent[4])
|
||||
dentrotation = float(dent[5])
|
||||
dentoffset = float(dent[6])
|
||||
if (dentlength == 0) or (dentwidth == 0) or (dentheight == 0):
|
||||
continue
|
||||
if dentslant >= dentheight:
|
||||
continue
|
||||
p = []
|
||||
p.append(Vector(0-dentchamfer,0,0))
|
||||
p.append(Vector(dentlength,0,dentslant))
|
||||
p.append(Vector(dentlength,0,dentheight))
|
||||
p.append(Vector(0-dentchamfer,0,dentheight))
|
||||
p.append(p[0])
|
||||
p = Part.makePolygon(p)
|
||||
f = Part.Face(p)
|
||||
dentshape = f.extrude(Vector(0,dentwidth,0))
|
||||
dentshape.rotate(Vector(0,0,0),Vector(0,0,1),dentrotation)
|
||||
if dentrotation == 0:
|
||||
dentshape.translate(Vector(length,dentoffset,0))
|
||||
elif dentrotation == 90:
|
||||
dentshape.translate(Vector(length-dentoffset,width,0))
|
||||
elif dentrotation == 180:
|
||||
dentshape.translate(Vector(0,width-dentoffset,0))
|
||||
elif dentrotation == 270:
|
||||
dentshape.translate(Vector(dentoffset,0,0))
|
||||
dentshape.translate(Vector(0,0,dentlevel))
|
||||
shape = shape.fuse(dentshape)
|
||||
shape = self.processSubShapes(obj,shape,pl)
|
||||
self.applyShape(obj,shape,pl)
|
||||
|
||||
|
@ -479,7 +515,7 @@ class _ViewProviderPrecast(ArchComponent.ViewProviderComponent):
|
|||
taskd = ArchComponent.ComponentTaskPanel()
|
||||
taskd.obj = self.Object
|
||||
taskd.update()
|
||||
if self.Object.Role == "Column":
|
||||
if hasattr(self.Object,"Dents"):
|
||||
self.dentd = _DentsTaskPanel()
|
||||
self.dentd.form.show()
|
||||
self.dentd.fillDents(self.Object.Dents)
|
||||
|
@ -1008,6 +1044,7 @@ def makePrecast(precasttype,length=0,width=0,height=0,slabtype="",chamfer=0,dent
|
|||
obj.Width = width
|
||||
obj.Height = height
|
||||
obj.Chamfer = chamfer
|
||||
obj.Dents = dents
|
||||
obj.DentLength = dentlength
|
||||
obj.DentHeight = dentheight
|
||||
elif precasttype == "Pillar":
|
||||
|
|
|
@ -346,7 +346,7 @@ class _CommandStructure:
|
|||
if elt in self.precast.PrecastTypes:
|
||||
self.precast.setPreset(elt)
|
||||
self.Profile = "Precast_" + elt
|
||||
if elt == "Pillar":
|
||||
if elt in ["Pillar","Beam"]:
|
||||
self.dents.form.show()
|
||||
else:
|
||||
self.dents.form.hide()
|
||||
|
|
Loading…
Reference in New Issue
Block a user