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
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: Tue Jul 07, 2020 1:16 pm Hi Suraj,
I've tried to test your code but entcountered some problems. After installing your update I created a sample column and tried to launch your commands
in order to create some ReinforcementDrawing.
In the object-tree the single pages (Front, Rear, Left, Right, Top and Bottom) are created but unfortunately don't contain any reinforcement.
What could be the problem here?
Hi @balrobs,

Thanks for investing your time to test. I found the problem.
In config.py file, to get the default template file, I used this code:

Code: Select all

# Default Template File for Drawing
TEMPLATE_FILE = FreeCAD.ParamGet(
    "User parameter:BaseApp/Preferences/Mod/TechDraw/Files"
).GetString("TemplateFile")
This is working on my Linux system. But, when I tried it in windows system, then these preference values are not present there.
And due to missing template, the template width and height are having value 0, and thus scaling factor is calculated wrong.

To fix this issue, I copied one template file from TechDraw templates into repository to use as default template.
User can change default template value in config.py file to use any other template file.
commit: https://github.com/SurajDadral/FreeCAD- ... cfe8f8ac0b

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 testet your code on my windows-machine and now I'm able to produce ReinforcementViews for my Test-Column. Wow!
Column.FCStd
(89.82 KiB) Downloaded 69 times
After that I created a reinforment plan for my column with a proprietary 2D Cad-software as I'm used to do, just to gave an idea what a column reinforcement plan might look like for me ...
Column.jpg
Column.jpg (111.03 KiB) Viewed 1853 times
This work brought to my mind several aspects:
- I think it's quite hard to automate the labeling process and get a satisfactory result right away. So additional tools for manipulating and/or adding rebar-labels will become very important.
- It is necessary to provide also the mark-number for the reinforcing bars in the views so that a better understanding can take place.
- Maybe @Bernd 's reinforcement classification (ReinforcementCustom, ReinforcementIndividual, ReinforcementLinear, ReinforcementLattice, ReinforcementGeneric) could be useful for the automated labeling process. This because different types of reinforcements could ask for different types of labels/dimensions.
- Last but not least, we could consider the possibility for future versions of not drawing all but only a few rebars when they are repeatedly laid. For members with a lot of reinforcement (e.g. slabs), this could IMO greatly improve the clarity.

Cheers balrobs!
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 »

Hello everyone,

An update:
Make reinforcement drawing view object parametric
- Change object name from ReinforcementDrawingContent to ReinforcementDrawingView
- Add structure and Rebars parameter to ReinforcementDrawingView object,
which keeps generated svg content in sync with rebars in model
- Some code improvements

commit: https://github.com/SurajDadral/FreeCAD- ... 10431ec862

Test it using:

Code: Select all

from ReinforcementDrawing import make_reinforcement_drawing

make_reinforcement_drawing.makeStructuresReinforcementDrawing(view="Front")
make_reinforcement_drawing.makeStructuresReinforcementDrawing(view="Rear")
make_reinforcement_drawing.makeStructuresReinforcementDrawing(view="Left")
make_reinforcement_drawing.makeStructuresReinforcementDrawing(view="Right")
make_reinforcement_drawing.makeStructuresReinforcementDrawing(view="Top")
make_reinforcement_drawing.makeStructuresReinforcementDrawing(view="Bottom")
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: Wed Jul 08, 2020 6:45 am Hi @Suraj,
I testet your code on my windows-machine and now I'm able to produce ReinforcementViews for my Test-Column. Wow!
Nice!

balrobs wrote: Wed Jul 08, 2020 6:45 am After that I created a reinforment plan for my column with a proprietary 2D Cad-software as I'm used to do, just to gave an idea what a column reinforcement plan might look like for me ...
We definitely need these examples to improve our drawing and dimensioning.

balrobs wrote: Wed Jul 08, 2020 6:45 am This work brought to my mind several aspects:
- I think it's quite hard to automate the labeling process and get a satisfactory result right away. So additional tools for manipulating and/or adding rebar-labels will become very important.
Yes, and we may not need to develop some additional tool for that as to add new labels/dimensions manually, user can use TechDraw workbench as we are storing generated drawing in scripted TechDraw object.
But for manipulating automatically generated dimensions, we need to take care during its implementation.

balrobs wrote: Wed Jul 08, 2020 6:45 am - It is necessary to provide also the mark-number for the reinforcing bars in the views so that a better understanding can take place.
- Maybe @Bernd 's reinforcement classification (ReinforcementCustom, ReinforcementIndividual, ReinforcementLinear, ReinforcementLattice, ReinforcementGeneric) could be useful for the automated labeling process. This because different types of reinforcements could ask for different types of labels/dimensions.
Yes, the mark number is important. But, for now, we are generating automated drawing and dimensioning for primitive shapes (StraightRebar, Stirrup, etc.) generated using Reinforcement Workbench.
We will be able to support rebar2 objects, when the primitive shapes will be generated using rebar2 objects through Reinforcement Workbench.
So, for Mark number in Arch Rebar objects, we may either add mark property to Rebar objects OR generate Mark number automatically for them as we did in case of Bill Of Material.
balrobs wrote: Wed Jul 08, 2020 6:45 am - Last but not least, we could consider the possibility for future versions of not drawing all but only a few rebars when they are repeatedly laid. For members with a lot of reinforcement (e.g. slabs), this could IMO greatly improve the clarity.
Interesting, but looks like this is possible with current implementation also. You can call function "makeReinforcementDrawing()" with few rebars as rebars list.

Code: Select all

def makeReinforcementDrawing(
    structure,
    rebars_list,
    view,
    font_family,
    font_size,
    drawing_left_offset,
    drawing_top_offset,
    drawing_min_right_offset,
    drawing_min_bottom_offset,
    drawing_max_width,
    drawing_max_height,
    template_file,
):
    """makeReinforcementDrawing(Structure, RebarsList, View, FontFamily,
    FontSize, DrawingLeftOffset, DrawingTopOffset, DrawingMinRightOffset,
    DrawingMinBottomOffset, DrawingMaxWidth, DrawingMaxHeight, TemplateFile):
    Generates Reinforcement Drawing SVG view for structure.
    view can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
    Returns reinforcement drawing view svg.
    """

Thanks,
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by hardeeprai »

balrobs wrote: Wed Jul 08, 2020 6:45 am ... future versions of not drawing all but only a few rebars when they are repeatedly laid. For members with a lot of reinforcement (e.g. slabs), this could IMO greatly improve the clarity.
That is he standard way of preparing 2D drawings.

Still current is needed (with improvements).

These may be treated as different views (there may may views, not only two views), and user may select any view as per his requirements.
--
H.S.Rai
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by bernd »

balrobs wrote: Wed Jul 08, 2020 6:45 am After that I created a reinforment plan for my column with a proprietary 2D Cad-software as I'm used to do, just to gave an idea what a column reinforcement plan might look like for me ...
May I ask ... Which software did you use? Was it 2D or 3D reinforcement in this software?
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: Wed Jul 08, 2020 2:49 pm Interesting, but looks like this is possible with current implementation also. You can call function "makeReinforcementDrawing()" with few rebars as rebars list.

Code: Select all

def makeReinforcementDrawing(
    structure,
    rebars_list,
    view,
    font_family,
    font_size,
    drawing_left_offset,
    drawing_top_offset,
    drawing_min_right_offset,
    drawing_min_bottom_offset,
    drawing_max_width,
    drawing_max_height,
    template_file,
):
    """makeReinforcementDrawing(Structure, RebarsList, View, FontFamily,
    FontSize, DrawingLeftOffset, DrawingTopOffset, DrawingMinRightOffset,
    DrawingMinBottomOffset, DrawingMaxWidth, DrawingMaxHeight, TemplateFile):
    Generates Reinforcement Drawing SVG view for structure.
    view can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".
    Returns reinforcement drawing view svg.
    """
Hi @Suraj,

I also able to produced drawing and it is amazing. :D Great works. With the new approach of drawing creation, I think now you have full control of rebars (position, visibility and etc).

After playing with this here are a few suggestions.
  1. As you are producing each view on a single page and automatically calculated scale is fine but when I moved all views to a single page, I unable to set scale. So, there should be some way to set the user custom scale factor.
  2. Same for the position of views, when I move all views in single drawing page and recompute, all view are displaced to the default position.
  3. User must have the option to fill or not fill the structure with colour.
  4. User can set style (stroke width, colour) of rebar, dimension and structure element so that it should be easily differentiated.
I think drawing only must have rebar distribution, rebar labels and structure dimensions. From rebar labels, the user can see each rebar dimensions from rebar cut list.

Screenshot 2020-07-09 at 4.41.06 PM.png
Screenshot 2020-07-09 at 4.41.06 PM.png (152.04 KiB) Viewed 1726 times
test_drawing.FCStd
(137.15 KiB) Downloaded 45 times
Thanks,
Amritpal Singh
Github, Like my work, sponsor me!
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by balrobs »

bernd wrote: Thu Jul 09, 2020 10:24 am
balrobs wrote: Wed Jul 08, 2020 6:45 am After that I created a reinforment plan for my column with a proprietary 2D Cad-software as I'm used to do, just to gave an idea what a column reinforcement plan might look like for me ...
May I ask ... Which software did you use? Was it 2D or 3D reinforcement in this software?
Hi @Bernd,
It's a 2D reinforcement software which treats individual reinforcements in the different views according to your RebarShape / RebarDistribution concept and binds logicaly different rebars-rapresentations with same mark-number.
Cheers balrobs
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by bernd »

@balbros: thanks

in the regard of the views ... it should be possible not to show all rebars. See attached side view of a wall. A column would be similar.

view.png
view.png (66.37 KiB) Viewed 1687 times

groundview.png
groundview.png (47.28 KiB) Viewed 1687 times
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 »

amrit3701 wrote: Thu Jul 09, 2020 11:15 am
Hi @Suraj,
Hi @amrit3701,

amrit3701 wrote: Thu Jul 09, 2020 11:15 am I also able to produced drawing and it is amazing. :D Great works. With the new approach of drawing creation, I think now you have full control of rebars (position, visibility and etc).

After playing with this here are a few suggestions.
  1. As you are producing each view on a single page and automatically calculated scale is fine but when I moved all views to a single page, I unable to set scale. So, there should be some way to set the user custom scale factor.
Its done as per commit: https://github.com/SurajDadral/FreeCAD- ... e0a6de1aba
To set custom scale, you need to set ScaleType property to "Custom" and then you will be able to use custom scaling.

amrit3701 wrote: Thu Jul 09, 2020 11:15 am [*] Same for the position of views, when I move all views in single drawing page and recompute, all view are displaced to the default position.
Till now, we are calculating position of rebars by utilizing constraints like LeftOffset, TopOffset, etc. to automatically position drawing on Template.
But, if user wants to set its position manually, then he first need to set property PositionType to "Custom" and then he will be able to set drawing view position by using obj.X and obj.Y attributes or by dragging view in ui.

amrit3701 wrote: Thu Jul 09, 2020 11:15 am [*] User must have the option to fill or not fill the structure with colour.
[*] User can set style (stroke width, colour) of rebar, dimension and structure element so that it should be easily differentiated.
[/list]
Its done as per commit: https://github.com/SurajDadral/FreeCAD- ... e0a6de1aba
For dimensions, I will do it when I will start working on dimensioning.

amrit3701 wrote: Thu Jul 09, 2020 11:15 am I think drawing only must have rebar distribution, rebar labels and structure dimensions. From rebar labels, the user can see each rebar dimensions from rebar cut list.
+1
Now, I will start working on it.

After doing above suggested changes, sample outputs:
rebars_color_from_shape.jpg
rebars_color_from_shape.jpg (98.98 KiB) Viewed 1648 times
same_color_for_all_rebars.jpg
same_color_for_all_rebars.jpg (100.34 KiB) Viewed 1648 times

Thanks,
Post Reply