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
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

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

Post by amrit3701 »

chakkree wrote: Thu Jul 20, 2017 3:28 am I think stirrup should be separate side cover in four parts.(Example in attached picture)
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:

stirrup2.png
stirrup2.png (198.5 KiB) Viewed 2567 times
Amritpal Singh
Github, Like my work, sponsor me!
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 »

amrit3701 wrote: Thu Jul 20, 2017 8:07 am
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
Test create column's stirrups with 6 legs.

TestColumn02-2.png
TestColumn02-2.png (539.48 KiB) Viewed 2553 times
TestColumn02-2.FCStd
(55.54 KiB) Downloaded 67 times
-------------------
Rebar Addon: Commits on Jul 20, 2017(76 commits)
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11616 (Git)
Build type: Release
Branch: master
Hash: aba4338808178b508f3170237f205e0066a5b437
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

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

Post by amrit3701 »

chakkree wrote: Thu Jul 20, 2017 9:23 am 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.


ushaperebar.png
ushaperebar.png (220.58 KiB) Viewed 2508 times
Amritpal Singh
Github, Like my work, sponsor me!
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

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

Post by cox »

I am falling in love with this thread, Amritpal. Although I do not see myself using this feature I am truly amazed by the rate of update and the features you produce.

Thanks and keep up the fantastic work :D
Need help? Feel free to ask, but please read the guidelines first
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 »

i'm also falling in love, I'm looking into what it takes to learn python coding. I wished someone showed me how to write code for freecad like Amrit does. @Amrit, what does it take to learn python coding? how long before I can create freecad enhancements? would you mind sharing your experience?
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 »

This Beam is waiting for new properties of straight and L rebar. :)


Image
Image credit to http://www.buildinghow.com
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 »

Test create rebars in the one-way slab.

TestOneWaySlab1.png
TestOneWaySlab1.png (731.01 KiB) Viewed 2418 times
OneWay_Slab01.FCStd
(93 KiB) Downloaded 75 times

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()
---------------------
Rebar Addon: Commits on Jul 21, 2017(78 commits)
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11622 (Git)
Build type: Release
Branch: master
Hash: 5ffe17153d84e5b361ba4c41e56c62977619f589
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
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 »

Test create rebar in simple beam (without scripting)

TestSimpleBeamRebar4.png
TestSimpleBeamRebar4.png (447.09 KiB) Viewed 2406 times
SimpleBeam2.FCStd
(70.11 KiB) Downloaded 55 times
---------------------
Rebar Addon: Commits on Jul 21, 2017(79 commits)
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11622 (Git)
Build type: Release
Branch: master
Hash: 5ffe17153d84e5b361ba4c41e56c62977619f589
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

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

Post by yorik »

The Rebar addon is becoming the feature of the year!
chakkree wrote: Fri Jul 21, 2017 5:53 am This Beam is waiting for new properties of straight and L rebar. :)
This image is a very good starting point to begin to think of a way to represent rebars on a Drawing/TechDraw sheet...

The rebar shape is easy to obtain. I also just added git commit ebb8fc536 that stores the base wires used to extrude the bars in the Rebar object. So these wires can be used to generate a wire representation of the bars (I'll try adding a new display mode too)

The texts should be easy to generate too... One thing we could think of, is how to determine automatically the direction in which rebars should be projected in 2D. Then I think everything would be there to build a kind of wizard, a bit like the ortho projections tool...
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

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

Post by saso »

So yes, this development is moving quite fast... Are there any plans for reinforcing mesh? :roll:

About the wire / 3d representation of the rebar, I think it would be important that for the wire we have the correct center line of the rebar. And about the display mode, do we really need a new LowRes mode, maybe the wire could be the normal mode and the 3d presentation could be the HiRes?

In general however I agree with Yorik comments that this different display modes will be useful also for all sort of other objects, but I think rebar is sort of a bit special case, because with the new rebar tools it does not take anymore a lot of effort and time to create 100.000 rebars :) so it is almost an "must to have now" feature for rebar, while for the other objects it will probably be more critical to have once we have assembly and xrefs.
Post Reply