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!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

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

Post by triplus »

Haven't checked this thread for a while. I see things are progressing really nicely!
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: Fri Jul 21, 2017 5:53 am This Beam is waiting for new properties of straight and L rebar. :)
I have done all the things as you said. I have separated side cover of L-Shape into left and right side cover and also introduced many new properties in straight rebar. The fields present in the straight rebar dialog box is changing according to orientation and cover along property. Only icons of straight rebar are left which are changing according to the orientation property. Now, it's your turn to test it. ;) Tell me if any changes will require.

Regards,
Amritpal Singh
Github, Like my work, sponsor me!
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 »

regis wrote: Fri Jul 21, 2017 2:47 am 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?
Hi @regis,

I think FreeCAD core developer gives a better answer that how you can contribute to FreeCAD. :) Before GSoC, I had never written code with so much interest but by getting good reviews from you and FreeCAD users, it has urged me to give more than my best. Also, my mentors have changed my approach when I get stuck at some points, he introduces me to a new approach which will give fruitful results. Understanding a workflow of Arch workbench is also guide me to produce a good quality of code. I, thanks to FreeCAD and GSoC for giving me this opportunity. I will also share my experience more through a blog post. :)

Regards
Amritpal Singh
Github, Like my work, sponsor me!
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 »

cox wrote: Thu Jul 20, 2017 6:49 pm 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
Thanks to you. :)
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 »

Test create rebar in a continuous beam.
Rebar No.2 and 4 and the right side can not be bent for lapping, may use custom rebar create DWire from a macro.

TestContBeam-3.png
TestContBeam-3.png (513.89 KiB) Viewed 1864 times
TestContBeam-4.png
TestContBeam-4.png (486.97 KiB) Viewed 1864 times
TestContBeam3.FCStd
(144.07 KiB) Downloaded 52 times
Image
credit to http://www.buildinghow.com/en-us/Produc ... esentation

---------------------
Rebar Addon: Commits on Jul 21, 2017(80 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 rebars in continuous beam.

TestContBeam-5.png
TestContBeam-5.png (504.54 KiB) Viewed 1847 times
TestContBeam4.FCStd
(153.41 KiB) Downloaded 65 times

Code: Select all

"""
   TestContBeam2.py
   22 Jul 2017
"""

import FreeCAD
import Draft
import Arch
import StraightRebar, UShapeRebar , LShapeRebar, Stirrup

from FreeCAD import Vector
from math import cos, radians

def LShapeLap(A= 300 , B = 2000 , C=1000 ,dia = 14, lapLen = 14*6):
    points=[Vector(0,0,A),
            Vector(0,0,0),
            Vector(B-lapLen,0,0),
            Vector(B,0,dia),
            Vector(B+C,0,dia),]
    line = Draft.makeWire(points,closed=False,face=False,support=None)
    return line
    
def makeContBeam2():
    column1 = Arch.makeStructure(length=400.0,width=400.0,height=2000.0,name='columnA')
    column1.Placement.Base=Vector(0, 0 , -1000)
    column1.ViewObject.Transparency = 80
    column2 = Arch.makeStructure(length=400.0,width=400.0,height=2000.0,name='columnB')
    column2.Placement.Base=Vector(200+4000+200, 0 , -1000)
    column2.ViewObject.Transparency = 80
    column3 = Arch.makeStructure(length=400.0,width=400.0,height=2000.0,name='columnC')
    column3.Placement.Base=Vector(200+4000+400+4000+200, 0 , -1000)
    column3.ViewObject.Transparency = 80
    
    beam1 = Arch.makeStructure(length=4000.0,width=200.0,height=450.0,name='beamA')
    beam1.Placement.Base=Vector(200+4000, 0 , -450/2.)
    beam1.ViewObject.Transparency = 80
    beam2 = Arch.makeStructure(length=4000.0,width=200.0,height=450.0,name='beamB')
    beam2.Placement.Base=Vector(200+4000+400+4000, 0 , -450/2.)
    beam2.ViewObject.Transparency = 80
    FreeCAD.ActiveDocument.recompute()
    
    covering = 20
    dia = 14
    dia_stir = 8
    dx = covering+dia_stir+dia/2.
    dx2 = covering+dia_stir/2
    rebar2L = LShapeRebar.makeLShapeRebar(f_cover=dx , \
            b_cover=450-dx-20*dia, t_cover=dx, l_cover=-350, r_cover=-400-4000/4., \
            diameter=dia, rounding=5, amount_spacing_check=True, amount_spacing_value=2, \
            orientation = "Top Left", structure = beam1, facename = 'Face1')
    rebar4L = LShapeRebar.makeLShapeRebar(f_cover=dx , \
            t_cover=450-dx-20*dia, b_cover=dx, l_cover=-330, r_cover=-400-4000/4., \
            diameter=dia, rounding=5, amount_spacing_check=True, amount_spacing_value=4, \
            orientation = "Bottom Left", structure = beam1, facename = 'Face1')
    
    rebar1L = LShapeRebar.makeLShapeRebar(f_cover=70 , \
            b_cover=450-dx-20*dia, t_cover=dx, l_cover=-350, r_cover=+4000-1500, \
            diameter=18, rounding=5, amount_spacing_check=True, amount_spacing_value=2, \
            orientation = "Top Left", structure = beam1, facename = 'Face1')
    
    rebar1Mid= StraightRebar.makeStraightRebar(f_cover=70, coverAlong=["Top Side",dx] , \
             rt_cover=-400-4000/4., lb_cover=4000-4000/4.,
             diameter=18, amount_spacing_check=True, amount_spacing_value=2, \
             orientation = "Horizontal", structure = beam1, facename =  'Face1')

    stir1 = Stirrup.makeStirrup(l_cover=dx2, r_cover=dx2, t_cover=dx2, b_cover=dx2, \
            f_cover=50 , bentAngle=135, bentFactor=6, \
            diameter=dia_stir, rounding=2, \
            amount_spacing_check=False, amount_spacing_value=150, \
            structure = beam1, facename = 'Face6')
    stir1.CustomSpacing = '10@100+1@115+11@170+1@115+9@100'
    
    line1 = LShapeLap(A= 300 , B = 350+4000-1000 , C=1000+400+1000 ,dia = 14, lapLen = 14*6)
    line1.Support = [beam2,'Face1']
    Draft.move(line1, Vector(200+4000+400+4000+350  ,-100,-dx))
    Draft.rotate(line1,180 ,  Vector(200+4000+400+4000+350  ,0,-dx) , Vector(0,1,0) )
    #Draft.rotate(line1,180 ,  Vector(0  ,0,0) , Vector(0,1,0) )
    line1.ViewObject.Visibility = False
    rebar1 = Arch.makeRebar(diameter = 14)
    rebar1.Base = line1
    rebar1.Label = 'CustomRebar_bar_No_1'
    rebar1.Host = beam2
    rebar1.Amount = 2
    rebar1.OffsetStart = dx
    rebar1.OffsetEnd = dx
    rebar1.Direction = (0.0, 1.0, 0.0)
    rebar1.Rounding = 5.000
    rebar1.ViewObject.ShapeColor = (0.000,0.000,1.000)
    
    line2 = LShapeLap(A= 300 , B = 350+4000-1000-20 , C=1000+400+1000 ,dia = 14, lapLen = 14*6)
    line2.Support = [beam2,'Face1']
    Draft.move(line2, Vector(200+4000+400+4000+350-20  ,-100,-450+dx))
    Draft.rotate(line2, 180 ,  Vector(200+4000+400+4000+350-20  ,-100,-450+dx) , Vector(0,0,1) )
    line2.ViewObject.Visibility = False
    rebar2 = Arch.makeRebar(diameter = 14)
    rebar2.Base = line2
    rebar2.Label = 'CustomRebar_bar_No_2'
    rebar2.Host = beam2
    rebar2.Amount = 2
    rebar2.OffsetStart = dx
    rebar2.OffsetEnd = dx
    rebar2.Direction = (0.0, 1.0, 0.0)
    rebar2.Rounding = 5.000
    rebar2.ViewObject.ShapeColor = (0.000,0.000,1.000)
    
    rebar1R = LShapeRebar.makeLShapeRebar(f_cover=70 , \
            b_cover=450-dx-20*dia, t_cover=dx, r_cover=-350, l_cover=+4000-1500, \
            diameter=18, rounding=5, amount_spacing_check=True, amount_spacing_value=2, \
            orientation = "Top Right", structure = beam2, facename = 'Face1')

    stir2 = Stirrup.makeStirrup(l_cover=dx2, r_cover=dx2, t_cover=dx2, b_cover=dx2, \
            f_cover=50 , bentAngle=135, bentFactor=6, \
            diameter=dia_stir, rounding=2, \
            amount_spacing_check=False, amount_spacing_value=150, \
            structure = beam2, facename = 'Face6')
    stir2.CustomSpacing = '10@100+1@115+11@170+1@115+9@100'

if __name__=='__main__':
    #LShapeLap()
    makeContBeam2()
    Msg('Done!!\n\n')
    FreeCAD.ActiveDocument.recompute()
---------------------
Rebar Addon: Commits on Jul 21, 2017(80 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 »

yorik wrote: Fri Jul 21, 2017 2:03 pm The Rebar addon is becoming the feature of the year!
I agree with you. The Rebar Addon can be used for all shapes of rebar. In future, If we already have all basic shape of rebar, it will be easy to used for non-programmer. The base wire can be used for export IFC file too.
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

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

Post by saso »

chakkree wrote: Sat Jul 22, 2017 8:56 am The base wire can be used for export IFC file too.
+1
thschrader
Veteran
Posts: 3157
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

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

Post by thschrader »

chakkree wrote: Sat Jul 22, 2017 8:56 am
yorik wrote: Fri Jul 21, 2017 2:03 pm The Rebar addon is becoming the feature of the year!
I agree with you. The Rebar Addon can be used for all shapes of rebar. In future, If we already have all basic shape of rebar, it will be easy to used for non-programmer. The base wire can be used for export IFC file too.
Yes sir !
playwithrebartool.JPG
playwithrebartool.JPG (81.38 KiB) Viewed 1788 times
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 »

thschrader wrote: Sun Jul 23, 2017 8:58 am Yes sir !
playwithrebartool.JPG
Can you share the .fcstd file too?

Regards,
Amritpal Singh
Github, Like my work, sponsor me!
Post Reply