GSoC Proposal: Extended functionality of Rebar Addon

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
ebrahim raeyat
Posts: 625
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by ebrahim raeyat »

Suraj Dadral wrote: Fri Aug 14, 2020 11:11 am
The output produced looks great.
I am unable to test it because of dependency on python2.7 and PyQt4 (I have not installed yet).
I will try to have a deep look into it soon.
Thanks @ebrahim raeyat for sharing this. :)
I asked author to port it to python3 a long time ago, but it seems it is not done.
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

Hi @Suraj, very good work!
Suraj Dadral wrote: Fri Aug 14, 2020 10:38 am ... But, as in ArchRebar, having basewire with sharp edges is ideal for BOM and RebarShapeCutList to work without any issue ...
I think that's fine for now ... but this fact should be mentioned in the documentation of BOM and RebarShapeCutList.
Two other suggestions:
- Is the word "pitch" for helical rebar design hard-coded? If so maybe it would be better to try describing geometry in a more generic way to avoid localization issues ... see last shape in the following image
rebar_shapes.jpg
rebar_shapes.jpg (47.13 KiB) Viewed 1694 times
- It would make sense to suppress pending zeros in decimal places, even if rebar_length_dimension_precision > 0. Sorry if I can't test the actual behavior, but since code changed I haven't yet figured out how to adjust the script myself.
Thanks
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by Suraj Dadral »

balrobs wrote: Fri Aug 14, 2020 3:12 pm I think that's fine for now ... but this fact should be mentioned in the documentation of BOM and RebarShapeCutList.
+1
I will do that.

balrobs wrote: Fri Aug 14, 2020 3:12 pm Two other suggestions:
- Is the word "pitch" for helical rebar design hard-coded? If so maybe it would be better to try describing geometry in a more generic way to avoid localization issues ... see last shape in the following image
rebar_shapes.jpg
Yes, it is hard-coded. But, making dimension label as function parameter for helical rebar is an easy task, and will be done soon.
I also like the helical rebar shape example you shared and we may also have that (but not right now ;) ).
So, created an issue for this here: https://github.com/amrit3701/FreeCAD-Re ... /issues/82

balrobs wrote: Fri Aug 14, 2020 3:12 pm - It would make sense to suppress pending zeros in decimal places, even if rebar_length_dimension_precision > 0. Sorry if I can't test the actual behavior, but since code changed I haven't yet figured out how to adjust the script myself.
The good news is it is implement same way as you suggested above (same as we did in case of BOM svg). :)
Hey, sorry for inconvenience, here is script to test:

Code: Select all

import importlib
from xml.etree import ElementTree

from RebarShapeCutList import RebarShapeCutListfunc

importlib.reload(RebarShapeCutListfunc)

rebar_shape_cut_list = RebarShapeCutListfunc.getRebarShapeCutList(
    rebar_dimension_units="cm", include_units_in_dimension_label=True
)

output_file = "/home/blank/GSoC20/test_rebar_shape.svg"
with open(output_file, "w") as f:
    f.write(ElementTree.tostring(rebar_shape_cut_list, encoding="unicode"))

Thanks,
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

Hi @Suraj,
I tested your latest code with my retaining wall example. simply great :D
The rearranged output looks awesome!
shape_cut_list_retaining_wall.PNG
shape_cut_list_retaining_wall.PNG (50.17 KiB) Viewed 1655 times
With the pending inclined dimensions and maybe the possibility to assign a maximum row number with rebar wrapping in new columns IMO would make it perfect. Otherwise the display of several reinforcements would quickly lead to very long rebar shape cut lists which are difficult to handle on drawings :mrgreen:

Thank you for your effort!

BTW would it be possible to generate a shape cut list only for a subset of rebars present in a model? I think of a drawing where only some structural members of the model are present, say for example only foundations. The related shape cut list should consider only related rebars.
User avatar
ebrahim raeyat
Posts: 625
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by ebrahim raeyat »

balrobs wrote: Fri Aug 14, 2020 9:37 pm
BTW would it be possible to generate a shape cut list only for a subset of rebars present in a model? I think of a drawing where only some structural members of the model are present, say for example only foundations. The related shape cut list should consider only related rebars.
I think it would be done with structure ifctype. For example beam, column, wall and foundation. Also, it can be filtered by stories, for examples columns of story 3. I think it is not difficult.
User avatar
ebrahim raeyat
Posts: 625
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by ebrahim raeyat »

balrobs wrote: Fri Aug 14, 2020 9:37 pm Hi @Suraj,
I tested your latest code with my retaining wall example. simply great :D
The rearranged output looks awesome!
shape_cut_list_retaining_wall.PNG
With the pending inclined dimensions and maybe the possibility to assign a maximum row number with rebar wrapping in new columns IMO would make it perfect. Otherwise the display of several reinforcements would quickly lead to very long rebar shape cut lists which are difficult to handle on drawings :mrgreen:
In my country, it is not common to draw columns rebar vertically. All rebars, horizontal or vertical drawn horizontal, column's listofer:
listofer.png
listofer.png (31.17 KiB) Viewed 1631 times
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

ebrahim raeyat wrote: Sat Aug 15, 2020 5:36 am
In my country, it is not common to draw columns rebar vertically. All rebars, horizontal or vertical drawn horizontal, column's listofer:
You are right! My wish to have the possibility to wrap rebar shapes into columns for the rebar shape cut list had the goal to optimize paper space. With your further proposal this could be achieved even in a more efficient way.
This fact is even more important when we talk about bar bending schedules, as your image shows.
Maybe designing rebar shapes independently of their location in space (I think this info isn't important for rebar shape cut list and bar bending schedule) could help as also to simplify the dimensioning of bent-shapes.

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

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by amrit3701 »

Suraj Dadral wrote: Fri Aug 14, 2020 10:16 am
test_rebar_shape.svg
test_rebar_shape.png
Nice work!
Amritpal Singh
Github, Like my work, sponsor me!
User avatar
Suraj Dadral
Posts: 307
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by Suraj Dadral »

Suraj Dadral wrote: Fri Aug 14, 2020 7:27 pm
balrobs wrote: Fri Aug 14, 2020 3:12 pm - Is the word "pitch" for helical rebar design hard-coded? If so maybe it would be better to try describing geometry in a more generic way to avoid localization issues ... see last shape in the following image
rebar_shapes.jpg
Yes, it is hard-coded. But, making dimension label as function parameter for helical rebar is an easy task, and will be done soon.
Hi @balrobs

Its done as per this commit.

This can be adjusted by argument helical_rebar_dimension_label_format
helical_rebar_dimension_label_format: str, optional
The format of helical rebar dimension label.
%L -> Length of helical rebar
%R -> Helix radius of helical rebar
%P -> Helix pitch of helical rebar
Default is "%L,r=%R,pitch=%P".

How to test:

Code: Select all

import importlib
from xml.etree import ElementTree

from RebarShapeCutList import RebarShapeCutListfunc

importlib.reload(RebarShapeCutListfunc)

rebar_shape_cut_list = RebarShapeCutListfunc.getRebarShapeCutList(
    helical_rebar_dimension_label_format="%L,r=%R,pitch=%P"
)

output_file = "/home/blank/GSoC20/test_rebar_shape.svg"
with open(output_file, "w") as f:
    f.write(ElementTree.tostring(rebar_shape_cut_list, encoding="unicode"))

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

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by Suraj Dadral »

Suraj Dadral wrote: Fri Aug 14, 2020 10:16 am
balrobs wrote: Mon Aug 10, 2020 10:19 pm - As discussed before, bent-shape rebars should show the deltaX and deltaY or angle dimension (to be discussed)
bent-shape rebar.jpg
This will be done soon...
This is done:
Implement bent angle dimensioning in rebar shape

Now, user can also specify which dimension angle needs to be excluded from dimensioning using parameter bent_angle_dimension_exclude_list having default value (45, 90, 180)

Sample output:
test_rebar_shape.svg
(18.69 KiB) Downloaded 49 times
test_rebar_shape.png
test_rebar_shape.png (13.99 KiB) Viewed 1557 times

Script to test:

Code: Select all

import importlib
from xml.etree import ElementTree

from RebarShapeCutList import RebarShapeCutListfunc

importlib.reload(RebarShapeCutListfunc)

rebar_shape_cut_list = RebarShapeCutListfunc.getRebarShapeCutList(
    bent_angle_dimension_exclude_list=[45, 90, 180]
)

output_file = "/home/blank/GSoC20/test_rebar_shape.svg"
with open(output_file, "w") as f:
    f.write(ElementTree.tostring(rebar_shape_cut_list, encoding="unicode"))


Thanks,
Post Reply