GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

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: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by amrit3701 »

Shiv_Charan wrote: Sun Jul 11, 2021 4:07 pm Implementation of UI to make slab Reinforcement is complete, including suggestions related to removing separate tabs for parallel/cross distribution rebars as discussed in meeting.
here is the merge request : https://github.com/amrit3701/FreeCAD-Re ... t/pull/158

Implementation of rebar grouping and edit slab reinforcement in progress and will be complete soon. :)

here are some sample UI input and output:
I will also create separate documentation for it once the edit part is done.
Nice progress Shiv, keep going! :)
Amritpal Singh
Github, Like my work, sponsor me!
Shiv_Charan
Posts: 59
Joined: Wed Mar 03, 2021 12:10 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Shiv_Charan »

amrit3701 wrote: Tue Jul 13, 2021 5:24 pm
Nice progress Shiv, keep going! :)
Thank you @amrit3701 :)

Regards
Shiv_Charan
Posts: 59
Joined: Wed Mar 03, 2021 12:10 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Shiv_Charan »

Hi @amrit3701
Shiv_Charan wrote: Sun Jul 11, 2021 4:07 pm
Implementation of rebar grouping and edit slab reinforcement in progress and will be complete soon. :)
Implementation of rebar grouping and edit slab reinforcement through properties panel is done.
here is merge request : https://github.com/amrit3701/FreeCAD-Re ... t/pull/159

Now user can change properties from property panel and changes will reflect in Slab Reinforcement simultaneously.

For example : -

1. Initial Slab Reinforcement:

InitialSlabReinforcement.png
InitialSlabReinforcement.png (449.57 KiB) Viewed 4245 times
2. changing cross rebar type from bent shape to L-shape from properties panel:-

SelectingL-Shape rebar from properties panel.png
SelectingL-Shape rebar from properties panel.png (451.98 KiB) Viewed 4245 times
3. Output after changing rebar type in slab reinforcement ( Now Slab have L-Shpae rebars in cross) :-

Output Slab Reinforcement having L shpae rebar .png
Output Slab Reinforcement having L shpae rebar .png (412.46 KiB) Viewed 4245 times

Thanks and Regards
Shiv_Charan
Posts: 59
Joined: Wed Mar 03, 2021 12:10 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Shiv_Charan »

Hi @amrit3701

Implementation to edit Slab Reinforcement through QT window and Python api is also done:
here is the merge request : https://github.com/amrit3701/FreeCAD-Re ... t/pull/161

Now user has three method to edit slab reinforcement:
  1. By python api
  2. By QT window ( similar to GUI for creating slab reinforcement)
  3. By properties panel (as discussed in previous post)
Now I am working on documentation.

Steps to edit slab reinforcement through QT window:-
1. create slab reinforcement by python api or GUI
2. double click on SlabReinforcement group ( It will open edit GUI for slab reinforcement)
3. edit values in GUI click on finish.
Now changes will reflect in Reinforcement.

For example:-

1. initial slab reinforcement: having straight rebars in parallel and bent shpae in cross with distribution rebars.

Image

2. double click on SlabReinforcement object in tree view.

Image

3. A edit GUI will pop up change value in GUI as per your need:-

Image

Image

4. click on finish.
output after above chages:

Image

Working of edit python API :-

For example :-
1. created slab reinforcement using following script on given file : -
slab.FCStd
(6.2 KiB) Downloaded 77 times
Slab Reinforcement creation script for slab having bent shape on both side with distribution rebars:-

Code: Select all


from SlabReinforcement import SlabReinforcement
import importlib
importlib.reload(SlabReinforcement)
slabReinforcementGroup = SlabReinforcement.makeSlabReinforcement(
    parallel_rebar_type="BentShapeRebar",
    parallel_front_cover=20,
    parallel_rear_cover=20,
    parallel_left_cover=10,
    parallel_right_cover=10,
    parallel_top_cover=30,
    parallel_bottom_cover=20,
    parallel_diameter=8,
    parallel_amount_spacing_check=True,
    parallel_amount_spacing_value=10,
    parallel_rounding=2,
    parallel_bent_bar_length=150,
    parallel_bent_bar_angle=135,

    cross_rebar_type="BentShapeRebar",
    cross_front_cover=20,
    cross_rear_cover=20,
    cross_left_cover=10,
    cross_right_cover=10,
    cross_top_cover=29,
    cross_bottom_cover=20,
    cross_diameter=8,
    cross_amount_spacing_check=True,
    cross_amount_spacing_value=10,
    cross_rounding=2,
    cross_bent_bar_length=150,
    cross_bent_bar_angle=135,
    mesh_cover_along="Bottom",
    structure=App.getDocument("slab").getObject("Beam"),
    facename='Face4',

    parallel_distribution_rebars_check= True,
    parallel_distribution_rebars_diameter=8,
    parallel_distribution_rebars_amount_spacing_check= True,
    parallel_distribution_rebars_amount_spacing_value= 6,
    cross_distribution_rebars_check = True,
    cross_distribution_rebars_diameter=8,
    cross_distribution_rebars_amount_spacing_check=False,
    cross_distribution_rebars_amount_spacing_value = 40,
)

output :
created slab reinforcement for edit api test.png
created slab reinforcement for edit api test.png (124.75 KiB) Viewed 4196 times
Now you can edit above slab reinforcement by using editSlabReinforcement python api of SlabReinforcement.
pass slabReinforcementGroup return by above script to editSlabReinforcement api as following script

Script to edit above slab reinforcement
( here we are modifying rebar amount for cross and parallel but you can modify any parameter )

Code: Select all


slabReinforcementGroup = SlabReinforcement.editSlabReinforcement(
    slabReinforcementGroup,
    parallel_rebar_type="BentShapeRebar",
    parallel_front_cover=20,
    parallel_rear_cover=20,
    parallel_left_cover=10,
    parallel_right_cover=10,
    parallel_top_cover=30,
    parallel_bottom_cover=20,
    parallel_diameter=8,
    parallel_amount_spacing_check=True,
    parallel_amount_spacing_value=5,
    parallel_rounding=2,
    parallel_bent_bar_length=150,
    parallel_bent_bar_angle=135,

    cross_rebar_type="BentShapeRebar",
    cross_front_cover=20,
    cross_rear_cover=20,
    cross_left_cover=10,
    cross_right_cover=10,
    cross_top_cover=29,
    cross_bottom_cover=20,
    cross_diameter=8,
    cross_amount_spacing_check=True,
    cross_amount_spacing_value=5,
    cross_rounding=2,
    cross_bent_bar_length=150,
    cross_bent_bar_angle=135,
    mesh_cover_along="Bottom",
    structure=App.getDocument("slab").getObject("Beam"),
    facename='Face4',

    parallel_distribution_rebars_check= True,
    parallel_distribution_rebars_diameter=8,
    parallel_distribution_rebars_amount_spacing_check= True,
    parallel_distribution_rebars_amount_spacing_value= 6,
    cross_distribution_rebars_check = True,
    cross_distribution_rebars_diameter=8,
    cross_distribution_rebars_amount_spacing_check=False,
    cross_distribution_rebars_amount_spacing_value = 40,
)
output after edit:
modified slab reinforcement with edit api.png
modified slab reinforcement with edit api.png (103.09 KiB) Viewed 4196 times
Thanks and Regards
User avatar
Meetlat
Posts: 72
Joined: Tue Oct 13, 2020 7:00 am

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Meetlat »

Hi Shiv_Charan, I want to check out your work and possible help you with the UI. Where can I find your latest version? Or do I have to wait till everything is merged?

nvm, got it. I downloaded your latest branch, https://github.com/ShivCharanSharma/Fre ... dit-UI/API

Now I got this error when using you gui to generate reinforcement for a slab:

Code: Select all

18:42:55  Traceback (most recent call last):
  File "C:\Users\marce\AppData\Roaming\FreeCAD\Mod\Reinforcement\SlabReinforcement\SlabReinforcementObject.py", line 775, in onChanged
    self.makeOrEditSlabReinforcement(obj)
  File "C:\Users\marce\AppData\Roaming\FreeCAD\Mod\Reinforcement\SlabReinforcement\SlabReinforcementObject.py", line 943, in makeOrEditSlabReinforcement
    cross_facename = getFacenamesforBeamReinforcement(facename, structure)[
  File "C:\Users\marce\AppData\Roaming\FreeCAD\Mod\Reinforcement\Rebarfunc.py", line 722, in getFacenamesforBeamReinforcement
    return facename_for_tb_rebars, facename_for_s_rebars
<class 'UnboundLocalError'>: local variable 'facename_for_tb_rebars' referenced before assignment
Shiv_Charan
Posts: 59
Joined: Wed Mar 03, 2021 12:10 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Shiv_Charan »

Meetlat wrote: Fri Jul 16, 2021 12:30 pm
Now I got this error when using you gui to generate reinforcement for a slab:

Code: Select all

18:42:55  Traceback (most recent call last):
  File "C:\Users\marce\AppData\Roaming\FreeCAD\Mod\Reinforcement\SlabReinforcement\SlabReinforcementObject.py", line 775, in onChanged
    self.makeOrEditSlabReinforcement(obj)
  File "C:\Users\marce\AppData\Roaming\FreeCAD\Mod\Reinforcement\SlabReinforcement\SlabReinforcementObject.py", line 943, in makeOrEditSlabReinforcement
    cross_facename = getFacenamesforBeamReinforcement(facename, structure)[
  File "C:\Users\marce\AppData\Roaming\FreeCAD\Mod\Reinforcement\Rebarfunc.py", line 722, in getFacenamesforBeamReinforcement
    return facename_for_tb_rebars, facename_for_s_rebars
<class 'UnboundLocalError'>: local variable 'facename_for_tb_rebars' referenced before assignment
Hi @Meetlat,

Thanks for testing slab reinforcement. :)

I am looking into it and trying to find cause of it.
Any pointer to regenerate the error or providing sample freeCAD file that your are using, will be highly appreciated and will help me a lot to debug the issue. :)

Thanks and Regards
User avatar
Meetlat
Posts: 72
Joined: Tue Oct 13, 2020 7:00 am

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Meetlat »

I do nothing special. I think it's due to using a corrupted branch. Where can I find a working branch of your modified Reinforcement workbench?
Shiv_Charan
Posts: 59
Joined: Wed Mar 03, 2021 12:10 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Shiv_Charan »

Meetlat wrote: Sun Jul 18, 2021 3:27 pm I do nothing special. I think it's due to using a corrupted branch. Where can I find a working branch of your modified Reinforcement workbench?
Hi @Meetlat,

This is latest branch. :)
Are you using non rectangular slab ?
Slab reinforcement work with rectangular slab like structure.

Can you try slab reinforcement with following file or similar?
slab.FCStd
(6.2 KiB) Downloaded 86 times

Thanks for your efforts.

Regards
User avatar
amrit3701
Posts: 343
Joined: Mon Jun 13, 2016 5:37 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by amrit3701 »

Shiv_Charan wrote: Mon Jul 19, 2021 6:24 pm

Hey Shiv,

How is your progress going with the footings structure element?

Can you please post your updates here? I haven't seen any activity on Github? I would suggest to regularly push your code and make smaller PR's.
Amritpal Singh
Github, Like my work, sponsor me!
Shiv_Charan
Posts: 59
Joined: Wed Mar 03, 2021 12:10 pm

Re: GSoC Proposal: Automate Reinforcement Process of Slab and Footing in FreeCAD

Post by Shiv_Charan »

amrit3701 wrote: Mon Jul 26, 2021 5:43 pm
Hey Shiv,

How is your progress going with the footings structure element?

Can you please post your updates here? I haven't seen any activity on Github? I would suggest to regularly push your code and make smaller PR's.
Hi @amrit3701,

I have created a merge request related to some improvements in slab reinforcement and also added icon for Slab Reinforcement.
here is merge request : https://github.com/amrit3701/FreeCAD-Re ... t/pull/162

The Icon that I have added is here :
SlabReinforcement.svg
(1.27 KiB) Downloaded 88 times

I am working on footing reinforcement and will push the code soon.

I have also added documentation for slab reinforcement.
link to documentation is here : https://wiki.freecadweb.org/Arch_Rebar_ ... nforcement

And documnetation of some of examples are here :
=== Examples for Slab Reinforcement===

Slab Spanning in Two Directions
https://wiki.freecadweb.org/Example_Sla ... Directions

Slab Spanning in One Direction:-
https://wiki.freecadweb.org/Example_Sla ... _Direction

Slab Having Straight Rebars Reinforcement Mesh:-
https://wiki.freecadweb.org/Example_Sla ... ght_Rebars


Slab Having U-Shape Rebars Reinforcement Mesh:-
https://wiki.freecadweb.org/Example_Sla ... ement_Mesh

Slab Having L-Shape Rebars Reinforcement Mesh:-
https://wiki.freecadweb.org/Example_Sla ... ement_Mesh

Thanks and Regards
Post Reply