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!
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

Suraj Dadral wrote: Sun Aug 09, 2020 10:11 pm
We can add new placeholder like %s for spacing in rebars.
I will implement it soon. For now, created issue here to track this.

Thanks,
Thank you @Suraj for the good news :D ,
Today I tried to use your latest code to draw a shape cut list for this model.
Test_Rebar_Shape_Cut_List.FCStd
(254.64 KiB) Downloaded 48 times
Unfortunately I wasn't able to produce the output_file = "/home/blank/GSoC20/test_rebar_shape.svg" because of permission errors, so I tried to modify it to output_file = "/home/balrobs/test_rebar_shape.svg" ... but the content of the generated SVG is only

Code: Select all

<svg height="40mm" width="60mm" viewBox="0 0 60 40" />
What am I doing wrong?

Thank you for your help!

Here my environment:
OS: Ubuntu 20.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 6d56b3e3b3c582533147040a26fd547020b7a81a
Python version: 3.8.2
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
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: Mon Aug 10, 2020 6:04 pm Today I tried to use your latest code to draw a shape cut list for this model.
Test_Rebar_Shape_Cut_List.FCStd
Unfortunately I wasn't able to produce the output_file = "/home/blank/GSoC20/test_rebar_shape.svg" because of permission errors, so I tried to modify it to output_file = "/home/balrobs/test_rebar_shape.svg" ... but the content of the generated SVG is only

Code: Select all

<svg height="40mm" width="60mm" viewBox="0 0 60 40" />
What am I doing wrong?
Hi @balrobs

The problem is Rebar.Mark is empty for all rebars in your shared model.
And if base_rebars_list is not passed to function getRebarShapeCutList(), then it will call function getBaseRebarsList(one_rebar_per_mark = True) to get list of rebars. And this function eliminates rebars with empty mark, when one_rebar_per_mark=True as function argument.

So, the solution is:
1. Either assign mark to all rebars OR
2. Call function getBaseRebarsList(one_rebar_per_mark=False) to get rebars list including rebars with empty mark and then pass that list to function getRebarShapeCutList(. For this, you can utilize below script:

Code: Select all

import importlib
from xml.etree import ElementTree

from RebarShapeCutList import RebarShapeCutListfunc

importlib.reload(RebarShapeCutListfunc)

rebars = RebarShapeCutListfunc.getBaseRebarsList(one_rebar_per_mark=False)
rebar_shape_cut_list = RebarShapeCutListfunc.getRebarShapeCutList(
    base_rebars_list=rebars
)

output_file = "/home/balrobs/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, my mistake, should have figured it out myself :mrgreen:
After I assigned a mark number to each rebar things are starting to get better. Now the generated rebar shape cut list looks like this:
test_rebar_shape.svg
(11.75 KiB) Downloaded 52 times
I see this problems:
- As @ebrahim raeyat mentioned before, length are shown with decimal places
- Stirrups with bend angle 90° should be drawn the following way for clarity
stirrup.jpg
stirrup.jpg (11.22 KiB) Viewed 1575 times
- For some strange reason, straight rebars (generated with the rebar addon for columns) are shown in a wrong way ...
- As discussed before, bent-shape rebars should show the deltaX and deltaY or angle dimension (to be discussed)
bent-shape rebar.jpg
bent-shape rebar.jpg (23.58 KiB) Viewed 1575 times
- Helical rebar are not shown

Thank you for all your efforts
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 »

amrit3701 wrote: Mon Aug 10, 2020 4:43 pm
Suraj Dadral wrote: Sun Aug 09, 2020 10:32 pm Do we also need to add bent angles in the rebar shape cut list, or will we do it in the bar bending schedule?
Bent angle is part to specify rebar shape. So, I think it should be present in rebar share cut list. But we can skip 90 angle because user can interpret it from rebar shape. Maybe bernd, balrobs and ebrahim tell us better here. :)
In my case, it is rarely needed for bent rebar shape, except for stairs and some other situation, but in stirrups it is 90 or 135 degrees and can be found from shape.
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 »

New suggestion! :
I think we need one additional rebar shape that is convenience for columns and beams where overlap occurred and rebar is L-shape rebar. I mean the rebar that has bent angle at one side an L-shape at another side.
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

Suraj Dadral wrote: Sun Aug 09, 2020 10:32 pm
- The above functions will work for ArchRebar and Rebar2 objects.
Hi @Suraj,
I tested your code for Rebar2 objects with this sample file
Test_Rebar2_Shape_Cut_List.FCStd
(65.83 KiB) Downloaded 47 times
and noticed that there seems to be a problem with rounded corners and with dimensions.
Test_Rebar2_Shape_Cut_List.png
Test_Rebar2_Shape_Cut_List.png (181.74 KiB) Viewed 1493 times
BTW wouldn't it make sense to have an option for selecting length units (i.e. mm or cm) as we did for BOM?

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

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

Did another test with the example_03_crane_foundation.ifc model shared by @Bernd.
Here rounded corners look nice but there are also issues with their dimension-labels.
Screenshot from 2020-08-12 12-26-19.png
Screenshot from 2020-08-12 12-26-19.png (43.92 KiB) Viewed 1481 times
Cheers
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: Wed Aug 12, 2020 10:36 am Did another test with the example_03_crane_foundation.ifc model shared by @Bernd.
Here rounded corners look nice but there are also issues with their dimension-labels.
Screenshot from 2020-08-12 12-26-19.png
Cheers
Hi @balrobs

Thanks for sharing the issues with rebar shape cut list. :D
The problem with above shared model is that, the round edges formed are created by small straight edges. And we are labeling straight edges with their length, so all small-small straight edges forming round edges are labeled and causing issue.
But, the other way to apply rounding is by creating base wire with sharp edges and set value for Rounding parameter of BaseRebar. This way is used in ArchRebar also and works best for BOM and RebarShape.

Example model of rebar2 with second approach:
crane_foundation.FCStd
(235.29 KiB) Downloaded 43 times

For other issues you discussed in previous posts, I am trying to resolve issues and will let you know soon. :)

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

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

Suraj Dadral wrote: Wed Aug 12, 2020 10:47 am
... The problem with above shared model is that, the round edges formed are created by small straight edges. And we are labeling straight edges with their length, so all small-small straight edges forming round edges are labeled and causing issue ...
Thank you @Suraj for your reply,
I guess this specific problem comes from the Import of @Bernd's IFC-Model to FreeCAD. So the problem could be adressed in Bernds IFC importer. Bernd can certainly tell us better ...

Thank you @Suraj for your effort
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: Wed Aug 12, 2020 10:36 am Did another test with the example_03_crane_foundation.ifc model shared by @Bernd.
Here rounded corners look nice but there are also issues with their dimension-labels.
Screenshot from 2020-08-12 12-26-19.png
Cheers
I think we can define minimum length for not dimensioning for example 5 centimeters.
Post Reply