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 »

ebrahim raeyat wrote: Wed Dec 09, 2020 2:47 am for exporting to DXF, I think we must split some function for writing SVG (get*SVGData) to get the edges of rebars, I wrote a macro to examine this for uUShapeRebar:
Hi @ebrahim raeyat

As getUShapeRebarSVGData (get*SVGData) function returns dictionary of data, so we can just add one more value (edges_list) to dictionary to return. :idea:
So, function return statement will be like:

Code: Select all

return {
    "svg": stirrup_svg,
    "visibility": is_rebar_visible,
    "edges": visible_edges_list,
}
Benefit of using this approach instead of refactoring functions is we need to make less changes to functions. Other functions using these functions will work without any changes.

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 »

Hi @All

The Reinforcement Drawing Dimensioning GUI made by @balrobs is integrated into Rinforcement Workbench as per PR: https://github.com/amrit3701/FreeCAD-Re ... t/pull/119
Will be merged into master branch soon...

Till then, you may test it by getting code from "integrate-drawing-dimensioning-ui" branch from here: https://github.com/SurajDadral/FreeCAD- ... sioning-ui

ShapeUi.png
ShapeUi.png (53.01 KiB) Viewed 3641 times
DrawingUi.png
DrawingUi.png (73.7 KiB) Viewed 3641 times
DimensionUI1.png
DimensionUI1.png (61.97 KiB) Viewed 3641 times
DimensionUI2.png
DimensionUI2.png (61.39 KiB) Viewed 3641 times
DimensionUI3.png
DimensionUI3.png (66.76 KiB) Viewed 3641 times

Thanks,
User avatar
ebrahim raeyat
Posts: 620
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: Wed Dec 16, 2020 6:11 am
ebrahim raeyat wrote: Wed Dec 09, 2020 2:47 am for exporting to DXF, I think we must split some function for writing SVG (get*SVGData) to get the edges of rebars, I wrote a macro to examine this for uUShapeRebar:
Hi @ebrahim raeyat

As getUShapeRebarSVGData (get*SVGData) function returns dictionary of data, so we can just add one more value (edges_list) to dictionary to return. :idea:
So, function return statement will be like:

Code: Select all

return {
    "svg": stirrup_svg,
    "visibility": is_rebar_visible,
    "edges": visible_edges_list,
}
Benefit of using this approach instead of refactoring functions is we need to make less changes to functions. Other functions using these functions will work without any changes.

Thanks,
Thanks @Suraj Dadral. You right. it is a true solution. but I think we can add some helper function like get_ushape_rebar_edges and so on and call these in getUShapeRebarSVGData (get*SVG). this way, the code didn't need to change, is it possible? I say this only for speed performance in large files and the zen of python. each function must do one and exactly one thing.

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 »

ebrahim raeyat wrote: Wed Dec 16, 2020 7:24 am

Thanks @Suraj Dadral. You right. it is a true solution. but I think we can add some helper function like get_ushape_rebar_edges and so on and call these in getUShapeRebarSVGData (get*SVG). this way, the code didn't need to change, is it possible? I say this only for speed performance in large files and the zen of python. each function must do one and exactly one thing.

thanks.
In above, I am assuming that get_ushape_rebar_edges() will return only visible edges (Right?).
In function getUShapeRebarSVGData(), to check if an edge is visible or not, I first generated SVG of each edge and then checked for each edge having unique svg is visible.

So, if we need get_ushape_rebar_edges() should only return visible edges and if we are not going to change above logic of finding visible edges, then its better to return visible edges from getUShapeRebarSVGData() function.
Otherwise we will be first generating svg of each edge in get_ushape_rebar_edges() function to find visible edges and then again generating svg of each edge in getUShapeRebarSVGData(), which will degrade performance.

If get_ushape_rebar_edges() should return all edges of rebar, then we can surely refactor getUShapeRebarSVGData() function.

Thanks,
atomkarinca
Posts: 2
Joined: Fri Dec 04, 2020 1:17 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by atomkarinca »

Suraj Dadral wrote: Wed Dec 16, 2020 5:50 am
atomkarinca wrote: Fri Dec 04, 2020 1:23 pm I guess crossties aren't supported yet. Is this something that's in the roadmap?

Image
Hi @atomkarinca

Yes crossties aren't present as special rebar types in Reinforcement Workbench. But, these can be easily created using Arch_Rebar tool.
But, having crossties as special rebar type may make things more easy, so created an issue regarding same here to implement later.

Thanks,
Thanks @Suraj Dadral, that's amazing.

Another amazing feature would be chair rebars:

Image
User avatar
ebrahim raeyat
Posts: 620
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: Wed Dec 16, 2020 7:51 am
ebrahim raeyat wrote: Wed Dec 16, 2020 7:24 am

Thanks @Suraj Dadral. You right. it is a true solution. but I think we can add some helper function like get_ushape_rebar_edges and so on and call these in getUShapeRebarSVGData (get*SVG). this way, the code didn't need to change, is it possible? I say this only for speed performance in large files and the zen of python. each function must do one and exactly one thing.

thanks.
In above, I am assuming that get_ushape_rebar_edges() will return only visible edges (Right?).
In function getUShapeRebarSVGData(), to check if an edge is visible or not, I first generated SVG of each edge and then checked for each edge having unique svg is visible.

So, if we need get_ushape_rebar_edges() should only return visible edges and if we are not going to change above logic of finding visible edges, then its better to return visible edges from getUShapeRebarSVGData() function.
Otherwise we will be first generating svg of each edge in get_ushape_rebar_edges() function to find visible edges and then again generating svg of each edge in getUShapeRebarSVGData(), which will degrade performance.

If get_ushape_rebar_edges() should return all edges of rebar, then we can surely refactor getUShapeRebarSVGData() function.

Thanks,
I am not familiar with SVG, but I say we can get the list of edges from a function and then send the list to each function that need this edges to draw, in SVG or DXF or even plot it via matplotlib.
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: Wed Dec 16, 2020 8:17 am
I am not familiar with SVG, but I say we can get the list of edges from a function and then send the list to each function that need this edges to draw, in SVG or DXF or even plot it via matplotlib.
Looks Great :idea: . I will try to refactor the get*SVGData() functions maybe this weekend.

Thanks,
User avatar
ebrahim raeyat
Posts: 620
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: Wed Dec 16, 2020 8:24 am
ebrahim raeyat wrote: Wed Dec 16, 2020 8:17 am
I am not familiar with SVG, but I say we can get the list of edges from a function and then send the list to each function that need this edges to draw, in SVG or DXF or even plot it via matplotlib.
Looks Great :idea: . I will try to refactor the get*SVGData() functions maybe this weekend.

Thanks,
Thanks, I think this way we have robust API
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 Dec 16, 2020 6:30 am Hi @All
The Reinforcement Drawing Dimensioning GUI made by @balrobs is integrated into Rinforcement Workbench as per PR: https://github.com/amrit3701/FreeCAD-Re ... t/pull/119
Will be merged into master branch soon...
Till then, you may test it by getting code from "integrate-drawing-dimensioning-ui" branch from here: https://github.com/SurajDadral/FreeCAD- ... sioning-ui
Hi @Suraj Dadral,
amazing work! I tried your latest code on my windows machine and it works like a charme ;)
Thanks a lot for giving a sense to my work.
BTW do you know a possible workflow to put different views (e.g. Front and Top) of the same structural element on the same drawing sheet? I tried this
  1. create drawing sheet with <Front view>
  2. adapt <scale type> and <scale parameter> for all elements of the <Front view>
  3. create drawing sheet with <Top view>
  4. adapt <scale type> and <scale parameter> for all elements of the <Top view>
  5. here I stuck ... I'd like to merge both views in a single drawing sheet but I don't know how?
Your advice is highly appreciated!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Post by Kunda1 »

balrobs wrote: Wed Dec 16, 2020 9:37 am
Suraj Dadral wrote: Wed Dec 16, 2020 6:30 am The Reinforcement Drawing Dimensioning GUI made by @balrobs is integrated into Rinforcement Workbench as per PR: https://github.com/amrit3701/FreeCAD-Re ... t/pull/119
Will be merged into master branch soon...
amazing work! I tried your latest code on my windows machine and it works like a charme ;)
Thanks a lot for giving a sense to my work.
Can we see some screencasts of this in action ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply