User:Suraj Dadral/GSoC20/proposal


 * Name: Suraj


 * IRC nick: 	SurajDadral


 * Blog: https://hacksj4u.wordpress.com


 * GitHub profile: https://github.com/SurajDadral

Brief Background Information

I am a B.Tech. (3rd year) student of Computer Science @ Guru Nanak Dev Engineering College, India. Practiced in writing code in C/C++, Python and used Git, Qt, Django, Twisted, OpenCV, Make, Jekyll and PySide2.

I completed the project Automate Reinforcement Process in FreeCAD during GSoC’19. Repository Link: https://github.com/SurajDadral/FreeCAD-Reinforcement/tree/gsoc19

= Project Information =

= Project Title: Extended functionality of Rebar Addon in FreeCAD =

= Brief Project Summary =

This Project is to create rebar shape cut list, bar bending schedule, export to BVBS format and automatic drawing of a structural element after reinforcement with dimensions in FreeCAD. For automatic drawing, the idea is to create a UI which lists different templates for columns and beams and for different reinforcement elements inside them which can be created, deleted and modified through some UI. The user will choose the template to apply to drawing sheets and can export output drawing to svg and pdf format.

= Detailed Project Description =

Current Scenario in FreeCAD

Now with rebar addon we are able to create reinforcement in the structural elements with much ease. But there is one big limitation due to which it is not much used in the real world. The problem is, a user has to do a lot of manual work to produce a single drawing sheet. And “rebar shape cut list” and “bar bending schedule” cannot be created for rebars without which rebar tools of FreeCAD cannot be used in real world problems.

To create drawing of structural elements in FreeCAD

 In the TechDraw workbench, we first need to create a page for drawing. Then select structural elements to be included in drawing including their reinforcement objects. Then select the view (e.g. top, bottom, left, right, etc.) of objects to be added in the drawing and click on the “insert view” icon of TechDraw to create a view in the drawing sheet. Then we need to manually add annotations and dimensions to structural elements and reinforcement inside them. Then export output to required format (e.g. svg, dxf, etc.). 

Doing the above steps manually for beams and columns in a building is a repetitive and time consuming task.

There is no provision to create a Bill of Material for rebars. If user wants to do so, he needs to perform following steps:  Create a new spreadsheet using Spreadsheet workbench to store material data. Fill spreadsheet by performing queries on model to get reinforcement information.</li> Create a new drawing sheet in the TechDraw workbench.</li> Create view from spreadsheet using command “Insert spreadsheet view” in drawing.</li> </ol> Even after performing above steps, the output is not as cool as shared by @bernd here: https://forum.freecadweb.org/viewtopic.php?f=18&t=17061#p135030

For creating Bill of Material, bar shape cut list, bar bending schedule and drawing of reinforcement, one of the prerequisites is the mark number property of rebars. As explained by @bernd here: https://forum.freecadweb.org/viewtopic.php?f=8&t=44580&start=20#p382093 ''The rebar mark is a number which has to be unique in one rebar shape cut list. This is the number on the drawing to identify the rebar. On the building site the worker takes all rebars of mark X from the delivered real rebars. Then he looks at the rebar drawing or may be on the rebar BIM model, searches for that number and then knows where to put these rebars.'' Currently, there is no implementation for mark number for rebars.

Proposed solution to the problem

For mark number, as explained by @bernd here: https://forum.freecadweb.org/viewtopic.php?f=8&t=44580&start=20#p382307 ''The mark will be created automatically a new rebar is instantiated. If this exact rebar shape is somewhere (in the group of rebars created for a specific rebar cut list) the mark will be taken from there. If the user does not want it he can immediately overwrite it, or later overwrites it.''

For creating Bill of Material, a new icon will be added to the dropdown menu of the rebar addon which will create a bill of material as a spreadsheet object with a single click of mouse. For more ease, while creating reinforcement drawing, a checkbox will be provided that if he wants to include BOM in the drawing. Then a spreadsheet will be added to drawing after applying formatting (if required).

For creating bar shape cut list, a new icon will be added to the dropdown menu of rebar addon which will perform following task:  Compute parameters for each unique rebar shape in the model and store them inside spreadsheet object.</li> Export bar shape cut list to svg/pdf format.</li> </ol> For more ease, while creating reinforcement drawing, a checkbox will be provided that if he wants to include bar shape cut list in the drawing.

For creating bar bending schedule, a new icon will be added to the dropdown menu of rebar addon which will create bar bending schedule by combining the functionality of bar shape cut list and bill of material. This schedule will be exported to svg/pdf format. Expected output of bar bending schedule is the same as the example mentioned in SP 34: Handbook on Concrete Reinforcement and Detailing.

And expected output shared by @bernd that can be found here.

An icon will be created to export bar bending schedule to BVBS format.

For creating reinforcement drawing automatically, an interactive UI will be developed which will perform following tasks: Show list of templates for columns and beams and for different reinforcement elements inside them which can be created, deleted and modified through some UI. The user will choose the template to apply to drawing sheets and can export output drawing to svg and pdf format. The idea is to have outcome like this: https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/ASD-Reinforcement/files/GUID-1E2D9170-4AF3-4498-A187-738984DB61A1-htm.html

Implementation

For adding new icon to the dropdown menu of rebar addon, we need to add new class to RebarTools.py file of rebar addon by defining functions GetResources, IsActive and Activated similar to commit: https://github.com/SurajDadral/FreeCAD-Reinforcement/commit/ae96339d326d6ffb0f81554378857d3572a6b8bc

For adding mark number, a new property will be added to store mark number as explained by @bernd here: https://forum.freecadweb.org/viewtopic.php?f=8&t=44580&start=20#p382296 ''The mark number should be a property of the rebar shape. As said I have some code working already which takes this into account. The rebar class is splitted into two classes, the rebar shape with its unique mark number and the distribution of this mark (rebar shape) in the model. We need to somehow merge this into existing FreeCAD rebar code and keep compatibility with all the great gui tools you guys did in former GSoC.''

For creating Bill of Material, a new icon will be added to drop down menu of rebar addon which will perform following task with single click of mouse:  Create a new spreadsheet object to store data for Bill of Material. This will be done adding the line “FreeCAD.ActiveDocument.addObject('Spreadsheet::Sheet','Spreadsheet')” to the program.</li> Perform queries on model to get reinforcement data and store it in the spreadsheet.</li> If a user chooses to insert BOM in a drawing sheet, then  Create new drawing sheets using the TechDraw workbench.</li> Create view from spreadsheet using command “Insert spreadsheet view” in drawing after formatting data in spreadsheet as per requirements.</li> </ol></li> </ol> Workflow for creating BOM:

For creating bar shape cut list  An icon for bar shape cut list will be made and integrated in the drop down menu of Rebar Addon.</li> Rebar shapes in svg format will be stored in the directory in the rebar addon.</li> When the user clicks on the bar shape cut list button, then selected structural elements (if any) will be passed to a function. If no structural element is selected, then all structural elements from the model will be passed to a function.</li> <li>Then the function will compute the unique list of rebar shapes present in structural elements passed as function parameters.</li> <li>Then rebar shape cut list will be generated by mapping rebar shapes present in the model with stored rebar shapes.</li> <li>This list can be exported to svg or pdf format.</li> </ol> Workflow for creating bar shape cut list:

For creating bar bending schedule, <ol style="list-style-type: decimal;"> <li>An icon for bar bending schedule will be made and integrated in the drop down menu of Rebar Addon.</li> <li>When the user clicks on the dropdown icon, then the bar shape cut list will be created by following steps described above.</li> <li>Then the bill of material will be calculated for each type of rebar shape. This will be done by utilizing functions created for creating the bill of material as discussed above.</li> <li>Then final output can be exported into svg or pdf format.</li> <li>The final output can also be exported as BVBS format.</li> </ol> Workflow for creating bar bending schedule:

For creating reinforcement drawing automatically <ol style="list-style-type: decimal;"> <li>An icon for reinforcement drawing will be made and integrated in the drop down menu of Rebar Addon. Integration in the drop down menu can be done by modifying RebarTools.py file of Rebar Addon.</li> <li>When the user will click on the reinforcement drawing button after selecting structural elements, then the list of selected structural elements will be passed to a function which will find the rebars associated with the selected structural elements.</li> <li>Then these rebars list will be passed to a dialog box including selected structural elements which will be developed using QtDesigner.</li> <li>User will select the rebars to be included in the drawing and will provide input through the dialog box.</li> <li>User will select the template from the list of available templates to apply for creating reinforcement drawing. Template is nothing but a configuration of input parameters.</li> <li>A new scripted object will be created which will store input parameters (selected columns/beams etc.) and some calculated parameters (rebars in selected columns/beams etc.) by program.</li> <li>The inputs provided by the user from the dialog box will be passed to a function which will store inputs in scripted object and then create drawing and dimensioning for structural elements including their reinforcement by utilizing TechDraw and Drawing Dimensioning workbench and svgwrite/ezdxf python modules as and when required.</li> </ol> Workflow for creating reinforcement drawing automatically:

= Timeline =

As an overview, the bill of material will be implemented first followed by bar shape cut list, bar bending schedule and then automatic reinforcement drawing. <ul> <li>Community Bonding Period (4 May - 01 June) <ul> <li>Having interaction on the mailing list and IRC regarding important aspects of the project.</li> <li>Understand BVBS file format and its specifications.</li> <li>Explore TechDraw and Drawing Dimensioning workbench.</li> <li>Learn more about reinforcement drawing specifications.</li> <li>Integrate mark number code developed by @bernd into existing rebar addon code and modify gui tools accordingly (if required).</li></ul></li>

<li>01 June - 25 June (25 days) <ul> <li>Implement function for creating the bill of material.</li> <li>Implement exporting bill of material to svg/pdf format.</li> <li>Set a unique number for each rebar shape which will require changes at the base of rebar implementation as discussed here.</li> <li>Create required icons and integrate with rebar addon.</li></ul></li>

<li>26 June - 28 June (3 days) <ul> <li>Backup days for any backlog or pending task and preparation for phase I evaluation.</li></ul></li>

<li>29 June - 03 July (5 days, Phase I evaluation) <ul> <li>Create documentation on FreeCAD wiki pages.</li> <li>Submit all the work to mentor.</li></ul></li>

<li>04 July - 23 July (20 days) <ul> <li>Implement bar shape cut list and its export to svg/pdf format.</li> <li>Implement bar bending schedule and its export to svg/pdf format.</li> <li>Implement export of bar bending schedule to BVBS format.</li> <li>Create required icons and integrate with Rebar Addon.</li></ul></li>

<li>24 July - 26 July (3 days) <ul> <li>Backup days for any backlog or pending task and preparation for phase II evaluation.</li></ul></li>

<li>27 July - 31 July (5 days, Phase II evaluation) <ul> <li>Create documentation on FreeCAD wiki pages.</li> <li>Submit all the work to mentor.</li></ul></li>

<li>01 August - 18 August (18 days) <ul> <li>Create UI for automatic drawing generation.</li> <li>Create function for automatic reinforcement drawing generation.</li> <li>Implement option in UI and a function for inserting bill of material, bar shape cut list and bar bending schedule in reinforcement drawing.</li> <li>Integrate UI with functions created above.</li> <li>Integrate UI with Rebar Addon.</li></ul></li>

<li>19 August - 25 August (1 week) <ul> <li>Work on UI enhancement to improve user experience.</li> <li>Work on backlogs, testing and bug fixes.</li></ul></li>

<li>24 August - 31 August (8 days, Final evaluation) <ul> <li>Create documentation on FreeCAD wiki pages.</li> <li>Submit all the work to mentor.</li></ul></li>

<li>01 September - 07 September (1 week) <ul> <li>Add examples of output drawing, bill of material, bar shape cut list and bar bending schedule in FreeCAD wiki.</li> <li>Complete pending task, if any.</li></ul></li>

= Time Availability =

I will be able to dedicate 40 hours per week. During regular days from Monday to Friday, my college timings are 8:00 am to 4:00 pm IST. So, these days I am available for 4 hours after my college and can manage to get 1-2 hours in my college timing. I am free on weekends during which I am free to work. From 20th May to 12th June, I have my final exams during which there are 3 to 4 holidays before each exam. So, I can spend 2 out of 4 days working on my project. Since, the actual coding part will start from 1st June, so my final exams will not be going to affect much the timeline of my project. From 13th June to 17 July, there will be holidays during which I will be available full time. My new semester will start from 18th July and therefore I can contribute 5 hours per day as mentioned above for July and August.

= Why FreeCAD? =

I have always been fascinated by the operation of CAD softwares. I’m an open source enthusiast and FreeCAD is the only CAD software I have ever used. There are several workbenches included in it and third party workbenches are also available from within the FreeCAD Addon manager is a very interesting feature. FreeCAD has a well established community of great developers and this project will give me an opportunity to work with them. So, this project is going to be a great learning experience for me.

= Why you? =

I found myself fit to this project according to my skill set and interest. I also completed the project Automate Reinforcement Process in FreeCAD during GSoC’19 so I have an understanding of the code of rebar addon. And I have keen interest and good coding skills in Python, C/C++ and bash scripting. I will also actively contribute and maintain the code even after GSoC.