Automate Reinforcement GSoC proposal

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Suraj Dadral
Posts: 99
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Automate Reinforcement GSoC proposal

Postby Suraj Dadral » Tue Aug 20, 2019 6:49 pm

yorik wrote:
Tue Aug 20, 2019 2:10 pm
Hi Suraj,
Hi Yorik
yorik wrote:
Tue Aug 20, 2019 2:10 pm

As you know we need to finish this week. I am looking at your code now, your work is basically in the "automate" branch on your github repo, is that correct? I think it would be good if you could write a wrap-up explaining how to use your work, how to install, etc. I know you are busy writing docs, so probably you are doing this already.
I have completed documentation pages for new features of Rebar Addon and here are related links:
https://www.freecadweb.org/wiki/Arch_Re ... nforcement
https://www.freecadweb.org/wiki/Arch_Re ... sSixRebars
https://www.freecadweb.org/wiki/Arch_Re ... nforcement

Now, I will write assumptions which we assume that user should know while creating reinforcinment with addon as suggested by @amrit3701 here:
https://forum.freecadweb.org/viewtopic. ... 70#p323817
yorik wrote:
Tue Aug 20, 2019 2:10 pm
Great work so far anyway! Congrats!
Thanks,
User avatar
Suraj Dadral
Posts: 99
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Automate Reinforcement GSoC proposal

Postby Suraj Dadral » Tue Aug 20, 2019 6:58 pm

amrit3701 wrote:
Tue Aug 20, 2019 4:35 pm

@Suraj,

I am trying to create reinforcement in beam by using your beam reinforcement dialog (`suraj/gsoc19-two-legged-stirrup` branch). It only creates stirrups rebars, no longitudinal rebars. Also, it throws below error in the `Report view`:

Code: Select all

Traceback (most recent call last):
  File "/Users/ambu/Library/Preferences/FreeCAD/Mod/Reinforcement/BeamReinforcement/MainBeamReinforcement.py", line 1171, in clicked
    self.accept(button)
  File "/Users/ambu/Library/Preferences/FreeCAD/Mod/Reinforcement/BeamReinforcement/MainBeamReinforcement.py", line 1233, in accept
    self.FaceName,
  File "/Users/ambu/Library/Preferences/FreeCAD/Mod/Reinforcement/BeamReinforcement/TwoLeggedBeam.py", line 240, in makeReinforcement
    structure,
  File "/Users/ambu/Library/Preferences/FreeCAD/Mod/Reinforcement/BeamReinforcement/TwoLeggedBeam.py", line 306, in makeTopReinforcement
    facename, structure
  File "/Users/ambu/Library/Preferences/FreeCAD/Mod/Reinforcement/Rebarfunc.py", line 701, in getFacenamesforBeamReinforcement
    return (facename_for_tb_rebars, facename_for_s_rebars)
UnboundLocalError: local variable 'facename_for_s_rebars' referenced before assignment
Hi @amrit3701, the beam reinforcement dialog seems to work fine as in documentation example:
https://www.freecadweb.org/wiki/Arch_Re ... nt#Example

I will try to investigate the error you faced and will report here.
amrit3701 wrote:
Tue Aug 20, 2019 4:35 pm
Also, there is no image of beam reinforcement present in the dialog box. Please take a look on this issue.
I have added the image in beam reinforcement dialog box as per commit: https://github.com/SurajDadral/FreeCAD- ... c152be483e

Please check if it is fine.

Thanks,
User avatar
Suraj Dadral
Posts: 99
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Automate Reinforcement GSoC proposal

Postby Suraj Dadral » Wed Aug 21, 2019 5:57 pm

Suraj Dadral wrote:
Tue Aug 20, 2019 6:58 pm

Hi @amrit3701, the beam reinforcement dialog seems to work fine as in documentation example:
https://www.freecadweb.org/wiki/Arch_Re ... nt#Example

I will try to investigate the error you faced and will report here.
Hello everyone,
Today, I discussed about the error with @amrit3701 in a video conference.
When we created reinforcement in a beam having length along x-axis, then the reinforcement created successfully.
But, when we tried to create reinforcement in a beam having length along y-axis, then it gives the same error as reported by @amrit3701.

Then @amrit3701 suggested a way to create shear rebars in beam having length along y-axis.
Now, I am implementing suggestion of @amrit3701. I will complete it by tomorrow.

Thanks,
User avatar
yorik
Site Admin
Posts: 11547
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Automate Reinforcement GSoC proposal

Postby yorik » Wed Aug 21, 2019 10:12 pm

Suraj Dadral wrote:
Tue Aug 20, 2019 6:49 pm
I have completed documentation pages for new features of Rebar Addon and here are related links:
https://www.freecadweb.org/wiki/Arch_Re ... nforcement
https://www.freecadweb.org/wiki/Arch_Re ... sSixRebars
https://www.freecadweb.org/wiki/Arch_Re ... nforcement
Excellent!!
User avatar
Suraj Dadral
Posts: 99
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Automate Reinforcement GSoC proposal

Postby Suraj Dadral » Thu Aug 22, 2019 3:39 pm

Suraj Dadral wrote:
Wed Aug 21, 2019 5:57 pm

But, when we tried to create reinforcement in a beam having length along y-axis, then it gives the same error as reported by @amrit3701.

Then @amrit3701 suggested a way to create shear rebars in beam having length along y-axis.
Now, I am implementing suggestion of @amrit3701. I will complete it by tomorrow.
Hello everyone,
The error has been removed as per commit: https://github.com/SurajDadral/FreeCAD- ... 44760b12d5

Now, user can create beam reinforcement
- for beam having length along x-axis, by selecting right face of beam.
- for beam having length along y-axis, by selecting front face of beam.

I will modify the documentation accordingly.

Example:

Code: Select all

import FreeCAD, Arch
from BeamReinforcement import TwoLeggedBeam

Structure = Arch.makeStructure(length=200.0,width=3000.0,height=400.0)
Structure.ViewObject.Transparency = 80
FreeCAD.ActiveDocument.recompute()

RebarGroup = TwoLeggedBeam.makeReinforcement(
    l_cover_of_stirrup=20,
    r_cover_of_stirrup=20,
    t_cover_of_stirrup=20,
    b_cover_of_stirrup=20,
    offset_of_stirrup=100,
    bent_angle=135,
    extension_factor=4,
    dia_of_stirrup=8,
    number_spacing_check=False,
    number_spacing_value=200,
    top_reinforcement_number_diameter_offset=("1#20@-60+2#16@-60+1#20@-60", "3#16@-100"),
    top_reinforcement_rebar_type="LShapeRebar",
    top_reinforcement_layer_spacing=30,
    bottom_reinforcement_number_diameter_offset=("1#20@-60+2#16@-60+1#20@-60", "3#16@-100"),
    bottom_reinforcement_rebar_type="LShapeRebar",
    bottom_reinforcement_layer_spacing=30,
    left_rebars_number_diameter_offset="1#16@-100+1#16@-100+1#16@-100",
    left_rebars_type="LShapeRebar",
    left_rebars_spacing=30,
    right_rebars_number_diameter_offset="1#16@-100+1#16@-100+1#16@-100",
    right_rebars_type="LShapeRebar",
    right_rebars_spacing=30,
    top_reinforcement_l_rebar_rounding=2,
    top_reinforcement_hook_extension=100,
    top_reinforcement_hook_orientation="Rear Outside",
    bottom_reinforcement_l_rebar_rounding=2,
    bottom_reinforcement_hook_extension=100,
    bottom_reinforcement_hook_orientation="Rear Outside",
    left_l_rebar_rounding=2,
    left_rebars_hook_extension=80,
    left_rebars_hook_orientation=("Rear Inside", "Front Inside", "Rear Inside"),
    right_l_rebar_rounding=2,
    right_rebars_hook_extension=80,
    right_rebars_hook_orientation=("Front Inside", "Rear Inside", "Front Inside"),
    structure=Structure,
    facename="Face1",
)
Please review and give your suggestions.
Thanks,
User avatar
amrit3701
Posts: 234
Joined: Mon Jun 13, 2016 5:37 pm

Re: Automate Reinforcement GSoC proposal

Postby amrit3701 » Sun Aug 25, 2019 10:04 am

Hi Suraj,

I have tested beam reinforcement and all previous issues are solved. :) Now, going to merge you MR.

Excellent work so far. :D
User avatar
Suraj Dadral
Posts: 99
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: Automate Reinforcement GSoC proposal

Postby Suraj Dadral » Fri Aug 30, 2019 5:01 pm

amrit3701 wrote:
Sun Aug 25, 2019 10:04 am
Hi Suraj,

I have tested beam reinforcement and all previous issues are solved. :) Now, going to merge you MR.

Excellent work so far. :D
Thanks @Amrit

I have also modified the README.md file and here is PR: https://github.com/amrit3701/FreeCAD-Re ... nt/pull/33

Here is wrap of the work done during GSoC:
ProjectMilestones.png
ProjectMilestones.png (41.59 KiB) Viewed 247 times

Thanks @All for your support. I will keep contributing in development of Rebar Addon.

Now, I am working on editing of Beam Reinforcement. After that I will implement master configuration for Rebar Addon.

Thanks,
User avatar
ebrahim raeyat
Posts: 159
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Automate Reinforcement GSoC proposal

Postby ebrahim raeyat » Sat Aug 31, 2019 2:27 pm

Suraj Dadral wrote:
Fri Aug 30, 2019 5:01 pm
amrit3701 wrote:
Sun Aug 25, 2019 10:04 am
Hi Suraj,

I have tested beam reinforcement and all previous issues are solved. :) Now, going to merge you MR.

Excellent work so far. :D
Thanks @Amrit

I have also modified the README.md file and here is PR: https://github.com/amrit3701/FreeCAD-Re ... nt/pull/33

Here is wrap of the work done during GSoC:

ProjectMilestones.png


Thanks @All for your support. I will keep contributing in development of Rebar Addon.

Now, I am working on editing of Beam Reinforcement. After that I will implement master configuration for Rebar Addon.

Thanks,
Thanks @Suraj. do you have any plan for multi beam reinforcement? I mean continues beams.

and another question:
I want to produce 2d drafting for concrete structures, like in my pyconcrete github. do you think i can use your work for this goal or i must work from scratch? till now i can give some parameters from user and produce 2D beam drawing, but i want to first bring this drafting in freecad and let user to modify some parameters and then export it to dxf or dwg format.

related topic: automation if design

Thanks a lot.