Dev logs of Rebar Addon for FreeCAD - GSoC project

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by regis »

thschrader wrote: Sun Jul 09, 2017 7:34 pm
regis wrote: Sun Jul 09, 2017 6:48 pm Today is your lucky day,
I like the earring, very nice! :D
verynice1.PNGverynice2.PNG
nice, i my self thought it was fancy
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by regis »

althouth I'm still not sure
phpBB [video]


OS: Linux Mint 18.2 Sonya
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11509 (Git)
Build type: None
Branch: master
Hash: fdedf8fb4d36043145e8498244177aae16c806a5
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by chakkree »

yorik wrote: Thu Jul 06, 2017 12:08 am What changes:

- The Structure object doesn't have an "Armatures" property anymore
- The Rebar object now has a "Host" property
+1
I like this changes.
One structure can have several rebars.

and this code for the test. A user can change number top and bottom rebar in the properties's dialog.

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')
TestSimpleBeamRebar.png
TestSimpleBeamRebar.png (347.68 KiB) Viewed 2555 times
------------------------
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11508 (Git)
Build type: Release
Branch: master
Hash: 087a1c1056d56e7bef0ce3bc6e367441fa0e3a9f
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
thschrader
Veteran
Posts: 3123
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by thschrader »

@chakree:
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...)
User avatar
cnirbhay
Posts: 115
Joined: Wed Aug 17, 2016 4:24 pm

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by cnirbhay »

Hello, everyone.

I'm glad to see new fascinating improvements in FreeCAD for structural detailings.

Following are my comments in the article regarding this new addon.
(https://cnirbhay.wordpress.com/2017/07/ ... n-freecad/)

Cheers.
thschrader
Veteran
Posts: 3123
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by thschrader »

cnirbhay wrote: Mon Jul 10, 2017 11:34 am I'm glad to see new fascinating improvements in FreeCAD for structural detailings.
(https://cnirbhay.wordpress.com/2017/07/ ... n-freecad/)
thanks for the info, I posted your info in (german forum)
https://forum.freecadweb.org/viewtopic.php?f=13&t=23349
greetings thomas
User avatar
yorik
Founder
Posts: 13630
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by yorik »

It is possible to draw rebars that pop out of the beam without problems. Not sure if that works with Amritpal's tools, but it's always possible to draw a custom sketch the way you want.

Great article Nirbhay!
User avatar
cnirbhay
Posts: 115
Joined: Wed Aug 17, 2016 4:24 pm

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by cnirbhay »

thanks for the info, I posted your info in (german forum)
You're welcome, Thomas. :-)
User avatar
chakkree
Posts: 327
Joined: Tue Jun 30, 2015 12:58 am
Location: Bangkok Thailand

Re: Dev logs of Rebar Addon for FreeCAD - GSoC project

Post by chakkree »

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...)
I try to coding for a circular column.
But spiral stirrup is not a smooth curve.

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')
TestCircularColumn.png
TestCircularColumn.png (742.51 KiB) Viewed 2429 times
----------------------
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11508 (Git)
Build type: Release
Branch: master
Hash: 087a1c1056d56e7bef0ce3bc6e367441fa0e3a9f
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Post Reply