Yeah! I have separated side cover into four parts i.e. left, right, top and bottom cover. Now user can play more with stirrups. See the below image:
Yeah! I have separated side cover into four parts i.e. left, right, top and bottom cover. Now user can play more with stirrups. See the below image:
Wow, very cool! easy to set for stirrups
I have added orientation property and also separated side cover into left and right side cover in U-Shape rebar. In the below image all rebars have different orientation property and with the addition of left and right cover now user can more control over the placement of rebar.
Code: Select all
"""
21 Jul 2017
"""
import FreeCAD
import Draft
import Arch
import StraightRebar, UShapeRebar
from FreeCAD import Vector
from math import cos, radians
def bendUpDWire(A=730,B=160,C=2650,D=160,E=730):
h1 = B*cos(radians(45))
h2 = D*cos(radians(45))
points=[Vector(0,0,h1),
Vector(A,0,h1),
Vector(A+h1,0,0),
Vector(A+h1+C,0,0),
Vector(A+h1+C+h2,0,h2),
Vector(A+h1+C+h2+E,0,h2),]
line = Draft.makeWire(points,closed=False,face=False,support=None)
return line
def makeOneWaySlab01():
beam1 = Arch.makeStructure(length=5000.0,width=300.0,height=500.0,name='beam1')
beam1.Placement.Base=Vector(+300/2, 0 , -500/2)
beam1.Placement.Rotation.Angle = radians(-90)
beam1.ViewObject.Transparency = 80
beam2 = Arch.makeStructure(length=5000.0,width=300.0,height=500.0,name='beam2')
beam2.Placement.Rotation.Angle = radians(-90)
beam2.Placement.Base=Vector(-300/2+4400, 0 , -500/2)
beam2.ViewObject.Transparency = 80
slab = Arch.makeStructure(length=4400.0,width=5000.0,height=180.0,name='slab')
slab.Placement.Base = Vector(4400, 5000/2 , +180/2)
slab.ViewObject.Transparency = 80
slab.ViewObject.ShapeColor = (0.667,1.000,0.000)
spacing = 200
num = (5000/spacing)
if 5000%spacing>0:
num +=1
line1 = bendUpDWire()
Draft.move(line1, Vector(31.86,0,(180-h1)/2))
line1.ViewObject.Visibility = False
rebar1 = Arch.makeRebar(diameter = 10)
rebar1.Base = line1
rebar1.Label = 'CustomRebar_bar_No_1'
rebar1.Host = slab
rebar1.CustomSpacing = '%d@%d'%(num,spacing)
rebar1.OffsetStart = (5000-(num-1)*spacing )/2.
rebar1.OffsetEnd = 0
rebar1.Direction = (0.0, 1.0, 0.0)
rebar1.Rounding = 3.000
rebar1.ViewObject.ShapeColor = (0.000,0.000,1.000)
rebar2 = StraightRebar.makeStraightRebar(f_cover=100+(5000-(num-1)*spacing )/2., \
b_cover=(180-h1)/2 , s_cover=35, \
diameter=10 , amount_spacing_check=False, amount_spacing_value=200, \
structure = slab, facename = 'Face1')
rebar3 = StraightRebar.makeStraightRebar(f_cover=100, \
b_cover=(180-h1)/2+10 , s_cover=35, \
diameter=8 , amount_spacing_check=False, amount_spacing_value=200, \
structure = slab, facename = 'Face5')
rebar3.CustomSpacing = "22@200"
rebar4 = UShapeRebar.makeUShapeRebar(f_cover=100, b_cover=20,t_cover=20, \
r_cover=5000-300+20, l_cover=20, diameter=8, \
rounding=2, amount_spacing_check=False, amount_spacing_value=240, \
orientation = "Left", structure = slab, facename = 'Face5')
rebar4.CustomSpacing = "18@240"
rebar5 = UShapeRebar.makeUShapeRebar(f_cover=100, b_cover=20,t_cover=20, \
r_cover=20, l_cover=5000-300+20, diameter=8, \
rounding=2, amount_spacing_check=False, amount_spacing_value=240, \
orientation = "Right", structure = slab, facename = 'Face5')
rebar5.CustomSpacing = "18@240"
rebar6 = StraightRebar.makeStraightRebar(f_cover=40, \
b_cover=30 , s_cover=20, \
diameter=8 , amount_spacing_check=True, amount_spacing_value=2, \
structure = slab, facename = 'Face2')
rebar6.ViewObject.ShapeColor = (0.667,0.000,0.000)
rebar7 = StraightRebar.makeStraightRebar(f_cover=40, \
b_cover=30 , s_cover=20, \
diameter=8 , amount_spacing_check=True, amount_spacing_value=2, \
structure = slab, facename = 'Face4')
rebar7.ViewObject.ShapeColor = (0.667,0.000,0.000)
if __name__=='__main__':
makeOneWaySlab01()
Msg('Done!!\n\n')
FreeCAD.ActiveDocument.recompute()
This image is a very good starting point to begin to think of a way to represent rebars on a Drawing/TechDraw sheet...