nice, i my self thought it was fancythschrader wrote: ↑Sun Jul 09, 2017 7:34 pmI like the earring, very nice!![]()
verynice1.PNGverynice2.PNG
nice, i my self thought it was fancythschrader wrote: ↑Sun Jul 09, 2017 7:34 pmI like the earring, very nice!![]()
verynice1.PNGverynice2.PNG
+1
Code: Select all
"""
Test Simple Beam Rebar
10 July 2017
"""
import FreeCAD
import Arch , Draft
import Stirrup
from FreeCAD import Vector
def makeSimpleBeam():
L = 4000-100-100
b = 200
h = 400
doc = FreeCAD.ActiveDocument
concShape = doc.addObject("Part::Box","Concrete")
concShape.Width = b
concShape.Height = h
concShape.Length = L
concShape.Placement.Base = Vector(100,-b/2,-h)
beam = Arch.makeStructure(concShape)
beam.ViewObject.Transparency = 80
covering = 20
dia = 12
dx = covering+dia/2
y = -b/2
points=[Vector(-100-dx,y,-dx-2*dia-6*dia),
Vector(-100-dx,y,-dx),
Vector(+100 + L +200-dx,y,-dx),
Vector(+100 + L +200-dx,y,-dx-2*dia-6*dia),]
line = Draft.makeWire(points,closed=False,face=False,support=None)
line.ViewObject.Visibility = False
rebar1 = Arch.makeRebar(diameter = 12)
rebar1.Base = line
rebar1.Label = 'TopMain'
rebar1.Host = beam
rebar1.Amount = 2
rebar1.Rounding = 2.000
rebar1.MoveWithHost = True
rebar1.Direction = (0.000,1 , 0.000)
#rebar1.Spacing = b-2*dx
rebar1.OffsetStart =dx ; rebar1.OffsetEnd =dx
rebar1.Role = u"Rebar"
points=[Vector(-100-dx,y,-h +dx+2*dia+6*dia),
Vector(-100-dx,y,-h+dx),
Vector(+100 + L +200-dx,y,-h+dx),
Vector(+100 + L +200-dx,y,-h+dx+2*dia+6*dia),]
line2 = Draft.makeWire(points,closed=False,face=False,support=None)
line2.ViewObject.Visibility = False
rebar2 = Arch.makeRebar(diameter = 12)
rebar2.Base = line2
rebar2.Label = 'BottomMain'
rebar2.Host = beam
rebar2.Amount = 2
rebar2.Rounding = 2.000
rebar2.MoveWithHost = True
rebar2.Direction = (0.000,1 , 0.000)
#rebar2.Spacing = b-2*dx
rebar2.OffsetStart =dx ; rebar1.OffsetEnd =dx
rebar2.Role = u"Rebar"
#Stirrup.makeStirrup()
if __name__=="__main__":
makeSimpleBeam()
FreeCAD.ActiveDocument.recompute()
Msg('Done!!\n\n')
thanks for the info, I posted your info in (german forum)cnirbhay wrote: ↑Mon Jul 10, 2017 11:34 amI'm glad to see new fascinating improvements in FreeCAD for structural detailings.
(https://cnirbhay.wordpress.com/2017/07/ ... n-freecad/)
You're welcome, Thomas.thanks for the info, I posted your info in (german forum)
Thanks, Yorik.Great article Nirbhay!
I try to coding for a circular column.thschrader wrote: ↑Mon Jul 10, 2017 8:28 am@chakkree:
At first: I have no programming-skills, my comments are only from a user point of view.
chakree, Im looking exactly for a possibility to draw rebars partially outside the beam,
like shown in your picture. Is that implemented in the actual FC17 dev-snapshot?
Please have a look at
https://forum.freecadweb.org/viewtopic.php?f=13&t=23349
short translation of my german text:
I want to draw rebars in an circular concrete column. If I draw a circle at the top
of the cylinder (in rebar-mode), I get an error. So I used a polygon and "rounded" it.
To produve the vertical radial-bars, I constructed a prisma as a help for attaching
the vertical rebars.
Greetings thomas
(native german speaker, sorry for my english...)
Code: Select all
"""
Test Circular Column Rebbar
11 July 2017
"""
import FreeCAD
import Arch , Draft
from FreeCAD import Vector
from math import pi , sin , cos
def makeCircularColumn():
dia_col = 300.0*2
h_col = 5000
doc = FreeCAD.ActiveDocument
concShape = doc.addObject("Part::Cylinder","Concrete")
concShape.Radius = dia_col/2
concShape.Height = h_col
column = Arch.makeStructure(concShape)
column.ViewObject.Transparency = 80
L = h_col+500
iAngle = 0.0
covering = 50
dia = 20 # main rebar
dia_stir = 16
dx = covering+dia_stir+dia/2
R = dia_col/2. -dx #dia_col-dx
num = 8
for i in range(0,num):
iAngle = i*(2*pi)/num
x = R* cos(iAngle)
y = R* sin(iAngle)
#Msg("%d x = %.1f , y=%.1f\n"%(i+1 , x,y))
points=[Vector(x,y,0.0),
Vector(x,y,L)]
line = Draft.makeWire(points,closed=False,face=True,support=None)
line.ViewObject.Visibility = False
rebar1 = Arch.makeRebar(diameter = dia)
rebar1.Base = line
rebar1.Label = 'RebarMain%d'%(iAngle+1)
rebar1.Host = column
rebar1.Amount = 1
rebar1.OffsetStart =0 ; rebar1.OffsetEnd =0
rebar1.Role = u"Rebar"
spacing = 150
segment = 8*2
#numCircular = h_col / spacing
dx = covering+dia_stir/2
dz = float(spacing) / segment
z = 20
R = dia_col/2. -dx
points = []
#for n in range(0,numCircular):
count = 1
while (z<h_col):
for i in range(0,segment):
#Msg('count = %d , i=%d \n'%(count,i))
iAngle = i*(2*pi)/segment
x = R* cos(iAngle)
y = R* sin(iAngle)
points.append( Vector(x,y,z))
z += dz
count += 1
line2 = Draft.makeWire(points,closed=False,face=True,support=None)
line2.ViewObject.Visibility = False
rebar2 = Arch.makeRebar(diameter = dia_stir)
rebar2.Base = line2
rebar2.Label = 'spiralStirrup'
rebar2.Host = column
rebar2.Amount = 1
rebar2.OffsetStart =0 ; rebar1.OffsetEnd =0
rebar2.Role = u"Rebar"
if __name__=="__main__":
makeCircularColumn()
FreeCAD.ActiveDocument.recompute()
Msg('Done!!\n\n')