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

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by ebrahim raeyat »

bernd wrote: Fri Jul 31, 2020 6:33 pm +1 to balrobs.

BTW: I only use inner straight rebars in columns if really nesesary. I try to avoid them if possible. One of twenty columns have them. May be even less. Other engineers do might use them more often.
I totally agree with this.
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: Fri Jul 31, 2020 8:30 pm I think, in real-world, we have a column in several stories and I think style 1 is not applicable, because we have almost a column on top of a column.
Hi @ebrahim raeyat,
Not sure if i understood you correctly. Did you think it would be a problem because multiple section views (one per storey) are required for columns that are one above the other? If that's the case the problem exists only if the column drawing shows every column from the foundation to the last storey. I use to do it differently .. Grouping columns by storey (as they usually are created) on a drawing. So every column on a drawing can have it's own section view. But, as I mentioned, I could also have misunderstood you.
columns_per_storey.jpeg
columns_per_storey.jpeg (152.23 KiB) Viewed 1426 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 »

Hi @all

Here are updates:
- Modify logic to calculate dimension line points. commit
Previous logic: Add offset point to each side of drawing which is used to place dimension label. And if dimension label is placed to left/right/top/bottom side, then x and y value of offset point of that side is modified accordingly.
New logic: Add offset length at each side of drawing. Then, e.g. if dimension label is placed to left side, then left_offset value is increased and y value selected randomly.
With new method, collisions decreases and there are further improvements that can be done to avoid collisions.

- Implement having dimension lines outside structure. commit
Add property "OuterDimension" of type "App::PropertyBool" to ReinforcementDimensioning object.
Set it to True if dimension lines are to be outside of reinforcement drawing for automated reinforcement dimensioning. OR False if dimension lines are to be extend within structure.

- Add mid-points to WayPoints in rebar dimension. commit
An alternate solution for comb-style dimension line: https://forum.freecadweb.org/viewtopic. ... 80#p420727

- Add rebar span-length to dimension label format as suggested by @balrobs here. commit

Sample models: https://github.com/SurajDadral/FreeCAD- ... ee/develop
Sample outputs:
straight_rebar_dim2.svg
(295.86 KiB) Downloaded 56 times
straight_rebar_dim2.png
straight_rebar_dim2.png (93.38 KiB) Viewed 1394 times
straight_rebar_dim3.svg
(216.57 KiB) Downloaded 58 times
straight_rebar_dim3.png
straight_rebar_dim3.png (162.52 KiB) Viewed 1394 times

My next plan is to create a function to take all required input values and generate drawing and dimensioning. I will try to finish this by today so that we can wrap up the drawing stuff and then continue to work on remaining modules i.e. Rebar shape cut list and Bar bending schedule.

Thanks and regards,
Last edited by Suraj Dadral on Sat Aug 01, 2020 9:45 pm, edited 1 time in total.
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 »

ebrahim raeyat wrote: Fri Jul 31, 2020 12:19 pm Hi @suraj Dadral, I think for this situation we can implement section's manner that I mentioned in the above post, we must write just the number of rebars and their diameter and the arrange of rebars will be found from their diameter in section. In my country, this approach is very common.
Hi @ebrahim raeyat

Thanks for your feedback. :)
If I understood correctly, then there maybe number of different arrangements present from same rebar diameter. In that case, we will not be able to identify rebars from their diameter. Please let me know if I am missing something.

Thanks,
Last edited by Suraj Dadral on Sat Aug 01, 2020 9:39 pm, edited 1 time in total.
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 Jul 31, 2020 2:12 pm Hi @all,
I totally agree, 1st method looks better and is clearer. With its implementation I think we have all neccessary labeling styles to create wonderfull reinforcement plans. Let's quickly report an overview table with some of IMHO most important labeling styles (good for section views and front views):
labeling_styles.jpg
I assume that most of them have already been implemented in one form or the other.
If we have the possibility to switch from one style to another and to control
1. position of dimension line with deltaY (inside or outside of the structure)
2. position of labeling text with deltaX (to avoid conflicts with other labels)
3. rotating of labeling text with phi (to avoid conflicts with other labels)
we will rock! :D
I know it's a lot of work ... and thankfully the motto is: "it's done when it's done".
Hi @balrobs

Thanks for this great suggestion. :D
Although above styles are possible with manual WayPoints in ReinforcementDimension object, but that may involve a lot of work finding WayPoints. So, for now, created issue regarding same here to implement later.

Thanks,
User avatar
ebrahim raeyat
Posts: 621
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 Jul 31, 2020 9:54 pm Hi @ebrahim raeyat,
Not sure if i understood you correctly. Did you think it would be a problem because multiple section views (one per storey) are required for columns that are one above the other? If that's the case the problem exists only if the column drawing shows every column from the foundation to the last storey. I use to do it differently .. Grouping columns by storey (as they usually are created) on a drawing. So every column on a drawing can have it's own section view. But, as I mentioned, I could also have misunderstood you.
columns_per_storey.jpeg
Cheers
you are right, I only mentioned for Style1 that represent rebar's label in above of column. thanks
User avatar
ebrahim raeyat
Posts: 621
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: Sat Aug 01, 2020 9:25 pm
Hi @ebrahim raeyat

Thanks for your feedback. :)
If I understood correctly, then there maybe number of different arrangements present from same rebar diameter. In that case, we will not be able to identify rebars from their diameter. Please let me know if I am missing something.

Thanks,
In real-world, it is almost 2 or 3 of different diameter appears in one section that can be recognized from the diameter of those rebars. although it is only for sections and not for other views.
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: Sat Aug 01, 2020 9:12 pm .. next plan is to create a function to take all required input values and generate drawing and dimensioning ...
Hi @Suraj, please keep in mind by implementing this function that it would be very usufull if a user can select reinforcements to be drawn. So a user could i.e. decide to create a drawing with lower reinforcements and one with upper reinforcements.
BTW your created drawings look very good. Will give a try to your lastest code in the next days.
Thanks and greetings!
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 »

Hi @all

Update:
Implemented single function to create drawing and dimensioning. commit
- Modified function makeStructuresReinforcementDrawing to accept dimensioning input data
- Add config varaibles for reinforcement dimensioning in config.py
- Add parameters "SingleRebar_LineStartSymbol", "SingleRebar_LineEndSymbol", "MultiRebar_LineStartSymbol", "MultiRebar_LineEndSymbol", "SingleRebar_OuterDimension", "MultiRebar_OuterDimension", "SingleRebar_TextPositionType" and "MultiRebar_TextPositionType" to ReinforcementDimensioning object to better control rebars automatic dimensioning.

Function signature:

Code: Select all

makeStructuresReinforcementDrawing(
    structure_list=None,
    rebars_list=None,
    view="Front",
    rebars_stroke_width=REBARS_STROKE_WIDTH,
    rebars_color_style=REBARS_COLOR_STYLE,
    rebars_color=REBARS_COLOR,
    structure_stroke_width=STRUCTURE_STROKE_WIDTH,
    structure_color_style=STRUCTURE_COLOR_STYLE,
    structure_color=STRUCTURE_COLOR,
    drawing_left_offset=DRAWING_LEFT_OFFSET,
    drawing_top_offset=DRAWING_TOP_OFFSET,
    drawing_min_right_offset=DRAWING_MIN_RIGHT_OFFSET,
    drawing_min_bottom_offset=DRAWING_MIN_BOTTOM_OFFSET,
    drawing_max_width=DRAWING_MAX_WIDTH,
    drawing_max_height=DRAWING_MAX_HEIGHT,
    template_file=TEMPLATE_FILE,
    perform_dimensioning=False,
    dimension_rebars_filter_list=None,
    dimension_label_format=DIMENSION_LABEL_FORMAT,
    dimension_font_family=DIMENSION_FONT_FAMILY,
    dimension_font_size=DIMENSION_FONT_SIZE,
    dimension_stroke_width=DIMENSION_STROKE_WIDTH,
    dimension_line_style=DIMENSION_LINE_STYLE,
    dimension_line_color=DIMENSION_LINE_COLOR,
    dimension_text_color=DIMENSION_TEXT_COLOR,
    dimension_single_rebar_line_start_symbol=(
        DIMENSION_SINGLE_REBAR_LINE_START_SYMBOL
    ),
    dimension_single_rebar_line_end_symbol=(
        DIMENSION_SINGLE_REBAR_LINE_END_SYMBOL
    ),
    dimension_multi_rebar_line_start_symbol=(
        DIMENSION_MULTI_REBAR_LINE_START_SYMBOL
    ),
    dimension_multi_rebar_line_end_symbol=(
        DIMENSION_MULTI_REBAR_LINE_END_SYMBOL
    ),
    dimension_line_mid_point_symbol=DIMENSION_LINE_MID_POINT_SYMBOL,
    dimension_left_offset=DIMENSION_LEFT_OFFSET,
    dimension_right_offset=DIMENSION_RIGHT_OFFSET,
    dimension_top_offset=DIMENSION_TOP_OFFSET,
    dimension_bottom_offset=DIMENSION_BOTTOM_OFFSET,
    dimension_left_offset_increment=DIMENSION_LEFT_OFFSET_INCREMENT,
    dimension_right_offset_increment=DIMENSION_RIGHT_OFFSET_INCREMENT,
    dimension_top_offset_increment=DIMENSION_TOP_OFFSET_INCREMENT,
    dimension_bottom_offset_increment=DIMENSION_BOTTOM_OFFSET_INCREMENT,
    dimension_single_rebar_outer_dim=DIMENSION_SINGLE_REBAR_OUTER_DIM,
    dimension_multi_rebar_outer_dim=DIMENSION_MULTI_REBAR_OUTER_DIM,
    dimension_single_rebar_text_position_type=(
        DIMENSION_SINGLE_REBAR_TEXT_POSITION_TYPE
    ),
    dimension_multi_rebar_text_position_type=(
        DIMENSION_MULTI_REBAR_TEXT_POSITION_TYPE
    ),
):
    """makeStructuresReinforcementDrawing([StructureList, RebarsList, View,
    RebarsStrokeWidth, RebarsColorStyle, RebarsColor, StructureStrokeWidth,
    StructureColorStyle, StructureColor, DrawingLeftOffset, DrawingTopOffset,
    DrawingMinRightOffset, DrawingMinBottomOffset, DrawingMaxWidth,
    DrawingMaxHeight, TemplateFile, PerformDimensioning,
    DimensionRebarsFilterList, DimensionLabelFormat, DimensionFontFamily,
    DimensionFontSize, DimensionStrokeWidth, DimensionLineStyle,
    DimensionLineColor, DimensionTextColor,
    SingleRebar_DimensionLineStartSymbol, SingleRebar_DimensionLineEndSymbol,
    MultiRebar_DimensionLineStartSymbol, MultiRebar_DimensionLineEndSymbol,
    DimensionLineMidPointSymbol, DimensionLeftOffset, DimensionRightOffset,
    DimensionTopOffset, DimensionBottomOffset, DimensionLeftOffsetIncrement,
    DimensionRightOffsetIncrement, DimensionTopOffsetIncrement,
    DimensionBottomOffsetIncrement, SingleRebar_OuterDimension,
    MultiRebar_OuterDimension, SingleRebar_TextPositionType,
    MultiRebar_TextPositionType]):
    Generates Reinforcement Drawing SVG view for structures.

    structure_list is the list of structural objects. If not provided,
    structures will be selected from active document acting as Host for rebar
    objects.

    rebars_list is the list of rebar objects. If not provided, rebars objects
    having Host in structure_list will be selected from active document.

    view can be "Front", "Rear", "Left", "Right", "Top" or "Bottom".

    rebars_color_style/structure_color_style can be "Automatic" to select color
    from rebar/structure shape or "Custom" to use color as defined by parameter
    rebars_color/structure_color.

    rebars_color/structure_color is tuple of r, g, b values of color.
    r, g, b must be between 0 to 1 and must be float. Divide r, g, b value of
    color to get values between 0 and 1.

    Dimensioning:
    set perform_dimensioning True to dimension reinforcement drawing,
    False otherwise.

    dimension_rebars_filter_list is the list of rebars to perform dimensioning.
    Set it to None to dimension all visible rebars in drawing.

    Returns dictionary with structure as key and corresponding reinforcement
    drawing page as value.
    """
With above function, it is expected to control every aspect (supported) of reinforcement drawing and dimensioning.
And we can also select which rebars to be included in reinforcement drawing, do we need to create dimensioning, which rebars to be included in dimensioning (as suggested by @balrobs here), etc.

Sample script to test:

Code: Select all

from ReinforcementDrawing.make_reinforcement_drawing import (
    makeStructuresReinforcementDrawing,
)

for view in ("Front", "Rear", "Left", "Right", "Top", "Bottom"):
    struct_drawing_page_dict = makeStructuresReinforcementDrawing(
        view=view, perform_dimensioning=True
    )
    for drawing_page in struct_drawing_page_dict.values():
        drawing_view = drawing_page.Views[0]
        drawing_view.setExpression(
            "LeftOffset",
            u".Template.Width.Value / 2 - .Width.Value * .Scale / 2",
        )
        drawing_view.setExpression(
            "TopOffset",
            u".Template.Height.Value / 2 - .Height.Value * .Scale / 2",
        )
        drawing_view.recompute(True)
        drawing_page.recompute(True)

Also updated models here: https://github.com/SurajDadral/FreeCAD- ... t-Examples

Now, we can start with rebar shape cut list.

Thanks and regards,
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 @All

The documentation pages for reinforcement drawing and dimensioning are ready:
Reinforcement Drawing: Arch_Rebar_Drawing
Reinforcement Dimensioning: Arch_Rebar_Dimensioning
Reinforcement Drawing and Dimensioning: Arch_Rebar_Drawing_Dimensioning

Suggestions are always welcome. :)
Now, going to start with Rebar-shape cut list.

Thanks,
Post Reply