Difference between revisions of "User:Amritpal singh/gsoc proposal"

From BRL-CAD
(Created page with "'''Name:''' Amritpal Singh '''IRC Nick:''' Amritpal '''Blog:''' '''https://amritpals.com''' '''GitHub Profile:''' '''https://github.com/amrit3701''' <!-- '''Brief Backgroun...")
 
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
'''GitHub Profile:''' '''https://github.com/amrit3701'''
 
'''GitHub Profile:''' '''https://github.com/amrit3701'''
<!--
+
 
 
'''Brief Background Information'''
 
'''Brief Background Information'''
  
I am a final year B.Tech. student of Computer Science and Engineering at Guru Nanak Dev Engineering College, Ludhiana, India.
+
I am B.Tech. (3rd year), Information Technology (IT) student of Guru Nanak Dev Engineering College, India. Proficient in writing code in C/C++, Python, bash scripting and recently also worked on Open-source Mathematical Software System (SageMath).
  
I have always been passionate about programming. My work on various open source projects is briefed below:
+
I also worked on Structure Information Modeling (SIM) and made a parser to store contents of STAAD PRO files into MySQL database. User can provide building specifications (for example) through web browser and at the back-end, FreeCAD macros use these input values to draw different views of the building on different drawing sheets. To support 3D rendering on the web browser, an option is provided to convert FreeCAD native file format (.FCStd) to WebGL format.
  
<ul>
+
Link: https://github.com/amrit3701/Sim
<li><blockquote><p>''PyDrain-'' A project for automating drawing creation in DXF using dxfwrite library and calculating area of enclosed entities.</p></blockquote></li>
 
<li><blockquote><p>''Civil Octave-'' This project is used for the Analysis of Dynamics of Structures.</p></blockquote></li>
 
<li><blockquote><p>''Booking System:'' A Django based web-application for booking seminar halls.</p></blockquote></li>
 
<li><blockquote><p>I have experience of Image Processing using MATLAB.</p></blockquote></li>
 
<li><blockquote><p>Apart from this, I also have my profound interest in Web development and Shell Scripting. I did several mini projects for fun and learning.</p></blockquote></li></ul>
 
  
For more details about my work, you may refer my GitHub account:
+
I also developed a Python script for AutoCAD to change the dimensions in a DXF file with a defined increment. Currently, I am working on code compliance on IFC files using parsing functionality of IfcOpenShell using Python.
 
 
[https://github.com/mandeeps708 ''https://github.com/mandeeps708'']
 
 
 
My knowledge of various open source technologies expands over
 
 
 
<ul>
 
<li><blockquote><p>Python</p></blockquote></li>
 
<li><blockquote><p>Shell scripting</p></blockquote></li>
 
<li><blockquote><p>Web Technologies (HTML, CSS, JS)</p></blockquote></li>
 
<li><blockquote><p>Frameworks: Django, meteor.js, Bootstrap</p></blockquote></li>
 
<li><blockquote><p>CGI (Common Gateway Interface)</p></blockquote></li>
 
<li><blockquote><p>Databases: MySQL and MongoDB</p></blockquote></li>
 
<li><blockquote><p>LaTeX, Doxygen</p></blockquote></li>
 
<li><blockquote><p>Git, IRC and basic development workflow etc.</p></blockquote></li></ul>
 
  
 
= Project Information =
 
= Project Information =
  
= Project Title: The FreeCAD Plugin Installer =
+
= Project Title: Rebar Addon for FreeCAD =
  
 
= Brief Project Summary =
 
= Brief Project Summary =
  
My main idea is to implement a plugin manager for FreeCAD that will be used to install/remove/update plugins and other unofficial workbenches or modules and macros. Besides, this project will make the life of the FreeCAD developers, workbench authors as well as the end-user easier.
+
My project is to create a rebar addon for Arch Workbench of FreeCAD to ease up the process of creating reinforcement in structural element. The main purpose of this project is to enable the user to create reinforcement through an easy and intuitive way. For this proposal, I will be considering rebaring systems for rectangular footing, pedestal, column, beam and slab.
  
 
= Detailed Project Description =
 
= Detailed Project Description =
  
'''Current Scenario'''
+
'''Existing system in FreeCAD'''
 +
 
 +
At present, the rebar functionality in FreeCAD is very limited and creating a reinforcement system is quite tedious. The current approach is followed by creating a sketch for the rebar profile and defining the required set of constraints. This becomes very time-consuming task when user has building model with several structural objects.
  
There are many plugins available for FreeCAD and developers are creating more. So the task for getting pull requests, managing and merging them becomes a tedious task. Quite similar is in the case of macros. And it also makes the code base of FreeCAD a bit more or like bloatware to be delivered to the end-user. Efforts have been done by the FreeCAD developers to separate the installation of plugins from the FreeCAD software itself.
 
  
One has to do manual work for getting plugins installed on their system to be able to use them. So this project considers the issue and tends to implement an universal plugin manager that will manage the plugins and it will include the following:
+
'''Proposed solution to the problem'''
  
<ol style="list-style-type: decimal;">
+
To ease up the rebaring process in FreeCAD, an interactive addon will be developed where user will input the required data as per the design requirements and they will need not to draw rebars from the Sketcher workbench for creating reinforcement in the structural object.
<li><blockquote><p>List all the plugins installed</p></blockquote></li>
 
<li><blockquote><p>Remove the installed plugins</p></blockquote></li>
 
<li><blockquote><p>Add new plugins locally/remotely</p></blockquote></li>
 
<li><blockquote><p>Plugin Compatibility Test</p></blockquote></li>
 
<li><blockquote><p>Update the plugins (basically git pull)</p></blockquote></li>
 
<li><blockquote><p>Enable/Disable the plugin</p></blockquote></li>
 
<li><blockquote><p>Adding Git support</p></blockquote></li>
 
<li><blockquote><p>Implementing Plugin details (identifier)</p></blockquote></li>
 
<li><blockquote><p>Package and dependencies resolver</p></blockquote></li></ol>
 
  
As FreeCAD is having many workbenches/macros fully coded in Python so they can be imported, without any necessity of compilation. As the plugins authors have to go through the painful (and somewhat lengthy) process of Pull Request on GitHub to get their code reviewed and accepted. This project focuses on making the same process rather easier to get the plugins working at the user’s end, so that user can integrate designs modules into their projects as a plug-in with ease. So the main idea is to present a simple, intuitive and interactive user interface.
+
The basic procedure to achieve this goal will as per the following points:
  
The problem with the existing system is that it’s currently using manual technique to get everything done i.e. it uses git submodules that have to be fetched manually every time a workbench/macro code is updated. Rather, it has to be automated.
+
<ol style="list-style-type: decimal;">
 +
<li><p>The first step will begin in the Arch workbench by creating a structure from the “Create a Structure” tab, or alternatively the user may also create a sketch of the profile from Sketcher workbench and then extrude it to transform into the desired structure.</p></li>
 +
<li><p>Then the user will select the desired element or a number of elements of a same category.</p></li>
 +
<li><p>After selecting the element(s), user will click on rebar dropdown provided in Arch workbench. From dropdown, user will select the rebar shape. Upon selection, dialog box will pop-out with input fields specific to selected rebar. User can enter the input values in the input fields and finally submit with button click.</p></li></ol>
  
'''Project Goals'''
+
Options or input parameters for reinforcement are categorised into three groups that forms three different tabs on the rebar dialogue box as following:
  
<ol style="list-style-type: decimal;">
+
<ol style="list-style-type: decimal">
<li><blockquote><p>'''''Better User Interface:''''' The main objective of the project is to helping the FreeCAD users to manage their plugins with simple user interface to make the overall user experience better. This product that will be delivered to the end user will include the UI such that he could manage the plugins with a few simple clicks.</p></blockquote></li></ol>
+
<li><p>Stirrup parameters</p></li>
 +
<li><p>Stirrup distribution</p></li>
 +
<li><p>Bars</p></li></ol>
  
<blockquote>''''Implementation Process''''
 
</blockquote>
 
<ol style="list-style-type: upper-alpha;">
 
<li><blockquote><p>A menu item or a sub-item will be added to launch the plugin installer.</p></blockquote></li>
 
<li><blockquote><p>Then it will proceed to a new window (tabular based) which will show the plugins currently installed.</p></blockquote></li>
 
<li><blockquote><p>It can have a checkbox beside each plugin to select/deselect it.</p></blockquote></li>
 
<li><blockquote><p>There will be buttons like Enable/Disable, Remove (Uninstall) and Update etc. for plugins. After selecting a particular set of plugins, user will be able to click on a particular option (button) as specified above.</p></blockquote></li></ol>
 
  
Here is a prototype for the same:
+
'''User Interface'''
 +
<dl>
 +
<dt>'''Tab I'''</dt>
 +
<dd>[[File:RebaraddonUI.png|frame|center|200px]]</dd>
  
[[Image:image01.png]]
 
  
<ol style="list-style-type: decimal;">
+
<dt>'''Tab II'''</dt>
<li><blockquote><p>'''''Getting list of installed workbenches and stored macros:''''' To get the list of installed workbenches and created macros, we will first look for the specific plugin directory which will be different for different operating systems. As FreeCAD is a cross-platform application, we may use something like environment variables or as suggested by the mentors. After getting listed all the available plugins, the plugin installer will show the details of the plugin like description, purpose of the plugin and some other information.</p></blockquote></li>
+
<dd>[[File:RebaraddonUI2.png|frame|center|200px]]</dd>
<li><blockquote><p>'''''Adding/Removing workbenches and macros:''''' After getting the list of installed plugins, the user will be able to add new plugins according to his requirements. It will allow the user to provide a link to the Git hosted repository and install that directly. On the back-end, it will clone the repository and place it in the appropriate directory. If it’s planned to use a particular repository for hosting the plugins, then what we can have is to scan (fetch) for that repository and list down the plugins for the user to choose from and install from the installer itself. For this to be implemented, we can request the repository and can get the json response of the available plugins on the repository and which later on can be filtered with the installed plugins.</p></blockquote></li>
 
<li><blockquote><p>'''''Plugin Compatibility Test:''''' The plugin authors can be suggested to create a particular file i.e. a “plugin detail file”. This file would contain a specific version of requirements e.g. Python version needed, version of FreeCAD needed. Even if some dependency is missed in the plugin detail file, the plugin installer will be able to detect the plugin and perform some tests already laid down to check compatibility. For example, this test may include a module that will check for the Python version. One approach could be that the tester module can try executing the plugin sub-module and get to know if it’s compatible or not. If it’s found to be incompatible, then it should revert the installation or in simpler words delete the particular plugin directory.</p></blockquote></li></ol>
 
  
The structure of the plugin directory may go like this. Suppose there is a main plugin directory i.e. ''/usr/lib/freecad/Mod/Plugins/'' and it contains two plugins “Plugin1” and “Plugin2”. Then each plugin will have some sub-directories (like images) or files (python modules). The tree structure will look like following:
+
<dt>'''Tab III'''</dt>
 +
<dd>[[File:RebaraddonUI3.png|frame|center|200px]]</dd>
 +
</dl>
  
<blockquote>Plugins directory (/usr/lib/freecad/Mod/Plugins)
 
  
|
+
'''Features of Rebar addon'''
 +
<ol style="list-style-type: decimal">
 +
<li><p>User can input the following values in the stirrup parameters tab of the addon:</p>
 +
<ul>
 +
<li><p>Dia</p></li>
 +
<li><p>Material</p></li>
 +
<li><p>Cover</p></li>
 +
<li><p>Stirrup Type</p></li>
 +
<li><p>Angle of the hooks as per the type of stirrup</p></li></ul></li>
  
| - Plugin 1
+
<li><p>In the stirrup distribution tab user will be asked to input the following values:</p>
 +
<ul>
 +
<li><p>Distribution pattern</p></li>
 +
<li><p>Value(s) of spacing(s) as per the distribution pattern</p></li></ul>
 +
</li>
  
| | - File1
+
<li><p>In the bars tab user can enter the following inputs for both the lower and upper bars:</p>
 +
<ul>
 +
<li><p>Dia</p></li>
 +
<li><p>Material</p></li>
 +
<li><p>Hooks angle</p></li>
 +
<li><p>Number of layers</p></li>
 +
<li><p>Number of bars in each layer</p></li>
 +
<li><p>Spacing</p></li></ul></li>
  
| | - File2
+
<li><p>The created rebars will have their own view and data properties.</p></li>
 +
<li><p>User can edit the parameters of the group of rebars from the view & data properties itself.</p></li>
 +
<li><p>These rebars will be fully parametric. Hence the parameters of the rebars will automatically adjust themselves if the changes are made to their parent structure.</p></li>
 +
<li><p>The rebars will also have the functionality to cut, copy, clone, move and rotate.</p></li>
 +
</ol>
  
| | - File3
 
  
| | - File 4
+
'''Implementation'''
 +
<ul>
 +
<li><p>Every workbench is nothing more than a folder containing an Init.py and/or InitGui.py. I just need to define FreeCAD commands, that can be made into menu items or toolbar buttons.</p></li>
 +
<li><p>The inputs provided by user from rebar dialog box will be passed to our custom rebar function. This function will use the inputs to define the shape of rebar and in this function the sketcher object will be added to the FreeCAD active document which will hold the profile of the rebar by calculating coordinates of vertices and drawing the shape of rebar from user inputs.</p></li>
 +
<li><p>Then this sketcher object and the selected structural object will pass to the prebuilt function of FreeCAD which will create the rebar. Below is the detailed description of that function.</p>
 +
<ul><li><p>''makeRebar([baseobj,sketch,diameter,amount,offset,name])'': Adds a reinforcement bar object to the given structural object, using the given sketch as profile.</p></li></ul></li></ul>
  
| | - Plugin detail file
+
By following the above approach I can reuse the existing implementation of reinforcement system in the FreeCAD and at the same time proposing something new and interesting which will enrich user experience.
  
|
+
<dd>[[File:RebaraddonDFD.png|frame|center|200px]]</dd>
  
| - Plugin 2
+
I created separated workbench to understand how Python scripts run from FreeCAD UI. Here is the code of my workbench: https://github.com/amrit3701/Structural. Doing this exercise helped me in understanding internal structure and flow of FreeCAD.
  
| | - Directory
+
Here is the reference link for Dialog creation in FreeCAD that may helpful during development:
 +
https://www.freecadweb.org/wiki/Dialog_creation
  
| | - File1
 
  
| | - File2
+
= Milestones =
  
| | - File 3
+
As an overview, out of five rebars (as mentioned in brief description), the simplest one footing rebar, will be completed in the first phase itself before the first evaluation. Next two rebars i.e. column and pedestal are too similar, they will be completed in the second phase before second evaluation. The remaining two rebars beam and slab will be completed in the last phase after second evaluation. Following is the detailed breakdown:
  
| | - Plugin detail file
+
'''Community Bonding Period'''
</blockquote>
 
Then the idea is to have a “Plugin detail file” that will reside in the plugin directory itself and will contain the following information:
 
  
 
<ul>
 
<ul>
<li><blockquote><p>Author Information</p></blockquote></li>
+
<li><p>Interaction with mentors and other developers on IRC / mailing list regarding the crucial aspects of the project.</p></li>
<li><blockquote><p>Plugin details like what the plugin is all about (description).</p></blockquote></li>
+
<li><p>Learn Pyside (QT) to create to create UI components like dropdown, dialog box etc.</p></li>
<li><blockquote><p>Path settings (like which file to load)</p></blockquote></li>
+
<li><p>Study Chakkree’s reinforcement scripts: (https://forum.freecadweb.org/viewtopic.php?f=23&t=16375).</p></li></ul>
<li><blockquote><p>Dependencies details (like required Python and FreeCAD version) etc.</p></blockquote></li></ul>
 
  
So this is the file that will be looked for by the plugin installer.
+
'''30 May - 13 June  (2 weeks)'''
  
<ol style="list-style-type: decimal;">
+
<ul>
<li><blockquote><p>'''''Updates:''''' The user can set his preferences for the duration to check for updates for the already installed modules. As already described, the plugin installer will try connecting to the remote repository from where the plugins are to be fetched and check if it contains some updated code. If some update (git fetch) is detected, then the user may simply click on update and it will simply do the git pull.</p></blockquote></li>
+
<li><p>Writing scripts of reinforcement of footing to achieve following:</p>
<li><blockquote><p>'''''Adding Git support:''''' As discussed above, adding and updating plugins will be achieved using Git hosted repositories. So it will be essential to add Git support to make all those happen. On Linux and Mac, it’ll be pretty easier to set up git via some shell script. And for Windows, we can set up “git for Windows” ([https://git-for-windows.github.io/ ''https://git-for-windows.github.io'']) with the standalone (or portable) installer and then create a batch (.bat) file for setting it up. As “git for Windows” includes a program named “Git BASH” that includes bash shell and later configuration can be done in it.</p></blockquote></li>
+
<ul><li><p>Parametrization</p></li>
<li><blockquote><p>'''''FreeCAD dependency tracking:''''' It’s good to be considered that some plugins depends on other plugins to be able to work correctly. As already discussed above, the plugin author will have a “Plugin detail file” in the plugin directory. That file will include the list of dependencies that needs to be resolved first. We can incorporate something like ''pypi'' or a plugin manager like ''bower'' such that plugin’s dependencies can be manageable.</p></blockquote></li></ol>
+
<li><p>Placement with respect to structure element</p></li>
 +
<li><p>Grouping</p></li></ul></li>
 +
<li><p>Following rebar shapes will be included in its reinforcement:</p>
 +
<ul><li><p>Straight rebar</p></li>
 +
<li><p>C-Shape rebar</p></li></ul>
 +
</li>
 +
</ul>
  
= Milestones =
+
'''14 June - 20 June  (1 week)'''
 
 
'''Community Bonding Period'''
 
  
 
<ul>
 
<ul>
<li><blockquote><p>Having interaction on Mailing list and IRC.</p></blockquote></li>
+
<li><p>Develop initial phase of Addon UI that involves dropdown (to select different rebar shapes) and dialog box with options.</p></li></ul>
<li><blockquote><p>Get to know the code of FreeCAD and try solving some existing issues to get better understanding of the code.</p></blockquote></li>
 
<li><blockquote><p>Seeing the scope where we can reuse the existing code in an efficient manner</p></blockquote></li></ul>
 
  
'''23 May - 31 May'''
+
'''21 June - 23 June (3 days)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Understand the existing implementation of the plugin loader and Macro installer and reuse whatever is possible.</p></blockquote></li></ul>
+
<li><p>Integration of UI with custom functions.</p></li>
 +
<li><p>At the end of this milestone, user will be able to see rebars in dropdown. Selecting the rebar will open dialog box with its associated properties.</p></li>
 +
</ul>
  
'''1 June - 7 June'''
+
'''24 June - 26 June (3 days)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Write prototype (Qt window with basic widgets like buttons and scroll) code to list all the plugins installed.</p></blockquote></li>
+
<li><p>Backup days, for any backlogs or any pending tasks and preparation for phase I evaluation.</p></li>
<li><blockquote><p>Discuss the implementation with Organisation and getting reviews.</p></blockquote></li></ul>
+
</ul>
  
'''8 June - 14 June'''
+
'''27 June - 30 June (4 days, Phase I evaluation)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Integrating “Plugin detail list” with UI to implement “list all plugins” feature.</p></blockquote>
+
<li><p>Developer documentation using Doxygen.</p></li>
<ul>
+
<li><p>Submitting all the work to mentor.</p></li>
<li><blockquote><p>Get data from “Plugin detail list” and show in the UI window the information like Author detail, plugin purpose and description etc.</p></blockquote></li></ul>
+
</ul>
</li></ul>
 
  
'''15 June - 20 June'''
+
'''1 July - 7 July (1 week)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Setup Git and its integration with FreeCAD.</p></blockquote>
+
<li><p>Writing scripts for reinforcement of column.</p></li>
<ul>
+
<li><p>Following rebar shapes will be included in its reinforcement:</p>
<li>Making scripts for Linux and Mac (auto-detection of OS).
+
<ul><li>Straight Rebar<p></p></li>
 +
<li><p>L-Shape</p></li>
 +
<li><p>C-Shape</p></li>
 +
<li><p>Stirrups (2 legs, 3 legs and 4 legs)</p></li>
 +
<li><p>Diagonal Stirrup</p></li></ul>
 
</li>
 
</li>
<li>Making batch file for downloading, installing on Windows and use Git Bash to set up.
+
</ul>
</li></ul>
 
</li>
 
<li><blockquote><p>Add new plugins remotely using Git remote repository link.</p></blockquote></li>
 
<li><blockquote><p>Setup UI to show the fetched available plugins from GitHub (or any remote Git hosted) repository.</p></blockquote></li></ul>
 
  
'''21 June - 28 June'''
+
'''8 July - 12 July (5 days)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>After getting the plugins listed on the UI, implementing the remove (Uninstall) plugins feature.</p></blockquote></li>
+
<li><p>Writing scripts for reinforcement of pedestal.</p></li>
<li><blockquote><p>Testing and fixing found bugs</p></blockquote></li>
+
<li><p>Following rebar shapes will be included in its reinforcement:</p>
<li><blockquote><p>Documenting the code using Doxygen or any other recommended tool</p></blockquote></li>
+
<ul><li><p>L-Shape rebar</p></li>
<li><blockquote><p>Mid-term evaluation.</p></blockquote></li></ul>
+
<li><p>Stirrup (Rectangular shape)</p></li></ul></li>
 +
</ul>
  
'''29 June - 7 July'''
+
'''13 July - 19 July (1 week)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Implementing keyboard shortcuts for launching Plugin installer.</p></blockquote></li></ul>
+
<li><p>Adding UI fields in dialog box for reinforcement of column and pedestal.</p></li>
 +
</ul>
 +
 
 +
'''20 July - 23 July (4 days)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Document the code.</p></blockquote></li>
+
<li><p>Integration of developed UI of column and pedestal with custom rebar function.</p></li>
<li><blockquote><p>Adding Macros support</p></blockquote></li></ul>
+
</ul>
  
'''8 July - 14 July'''
+
'''24 July - 28 July (5 days, Phase II evaluation)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Plugin compatibility test</p></blockquote></li></ul>
+
<li><p>Work on backlogs or bugs if any.</p></li>
 +
<li><p>UI enhancements.</p></li>
 +
<li><p>Submitting all the work to mentor.</p></li>
 +
</ul>
  
'''15 July - 21 July'''
+
'''29 July - 4 August (1 week)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Working on feature Enabling/Disabling the plugin.</p></blockquote></li>
+
<li><p>Writing scripts for reinforcement of beam.</p></li>
<li><blockquote><p>Prototype code for Update the plugins (basically git pull).</p></blockquote></li></ul>
+
<li><p>Following rebar shapes will be included in its reinforcement:</p>
 +
<ul>
 +
<li><p>Straight Rebar</p></li>
 +
<li><p>L-Shape</p></li>
 +
<li><p>C-Shape</p></li>
 +
<li><p>Stirrups (2 legs, 3 legs, 4 legs )</p></li>
 +
<li><p>Diagonal Stirrup</p></li>
 +
</ul></li>
 +
</ul>
  
'''22 July - 28 July'''
+
'''5 August - 9 August (5 days)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>FreeCAD dependency tracking</p></blockquote>
+
<li><p>Writing scripts for reinforcement of slab.</p></li>
 +
<li><p>Following rebar shapes will be included in its reinforcement:</p><ul>
 +
<li><p>Bentup rebar</p></li>
 +
<li><p>Straight rebar</p></li>
 +
<li><p>C-Shape rebar</p></li>
 +
</ul></li>
 +
</ul>
 +
 
 +
 
 +
'''10 August - 14 August (5 days)'''
 +
 
 
<ul>
 
<ul>
<li><blockquote><p>Integrating with plugin detail file</p></blockquote></li>
+
<li><p>Adding UI fields for reinforcement of beam and slab.</p></li>
<li><blockquote><p>Adding support for plugin manager</p></blockquote></li></ul>
+
</ul>
</li></ul>
 
  
'''29 July - 7 August'''
+
'''15 August - 17 August (3 days)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Brush Up the UI of plugin installer.</p></blockquote></li>
+
<li><p>Integration of developed UI of beam and slab with custom rebar functions.</p></li>
<li><blockquote><p>Discuss about the security concerns if we get some extra extra time.</p></blockquote></li></ul>
+
</ul>
  
'''8 August-15 August'''
+
'''18 August - 24 August (1 week)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>More testing and cleaning.</p></blockquote></li>
+
<li><p>Work on Addon UI to implement input validations and error handling on dialog box.</p></li>
<li><blockquote><p>Writing user documentation for the project.</p></blockquote></li>
+
<li><p>Work on backlogs, testing and bug fixes.</p></li>
<li><blockquote><p>Time to make up for missed milestone (if any).</p></blockquote></li></ul>
+
</ul>
 +
 
  
'''16 August - 24 August'''
+
'''25 August - 29 August (5 days, Final Phase)'''
  
 
<ul>
 
<ul>
<li><blockquote><p>Cleaning and Testing code.</p></blockquote></li>
+
<li><p>Developer documentation using Doxygen.</p></li>
<li><blockquote><p>Final Evaluation</p></blockquote></li></ul>
+
<li><p>User documentation through detailed tutorial and post with screenshots on FreeCAD wiki. </p></li>
 +
<li><p>Submitting all the work to the mentor.</p></li>
 +
</ul>
 +
 
 +
The advent of this rebar addon in FreeCAD will reduce the effort in creating rebaring to a great extent and thus saving time. Structural engineers will find it easier to do the rebar detailing in their structural models and generate the rebar shop drawings in an easy but professional way.
  
 
= Time Availability =
 
= Time Availability =
Line 239: Line 267:
 
= Why FreeCAD? =
 
= Why FreeCAD? =
  
I have always been fascinated by operating of CAD softwares. This project got my interest. It will provide me a great opportunity to work on a realistic project in collaboration with great experienced developers.
+
The very first reason to choose FreeCAD is that it is the first free and open source BIM software with the functionality of CAD in it. It is a powerful parametric modeler. There are several workbenches included in it which are integrated with one another. The community of FreeCAD is very well established with plenty of helpful coders and engineers of respective domains from different parts of the Globe.
  
 
= Why you? =
 
= Why you? =
  
I found myself fit for this project according to my skill set and interest. I am very passionate to explore and learn new things. I understood well the workflow of this project. I want to work for FreeCAD organisation to gain more experience and enhance my knowledge about CAD. I will also be actively contributing and maintaining the code even after GSoC.
+
I’m a practical programmer with good proficiency in the languages like C/C++, Python and bash scripting. I worked with Civil engineers, solved their problems and also ease their work through my programming knowledge. All of my previous projects were on FreeCAD only which included Structural Information Modeling (SIM), Parametric building and python-scripted objects. It has been one year that I’m an active member on FreeCAD forum.
-->
 

Latest revision as of 14:13, 6 May 2017

Name: Amritpal Singh

IRC Nick: Amritpal

Blog: https://amritpals.com

GitHub Profile: https://github.com/amrit3701

Brief Background Information

I am B.Tech. (3rd year), Information Technology (IT) student of Guru Nanak Dev Engineering College, India. Proficient in writing code in C/C++, Python, bash scripting and recently also worked on Open-source Mathematical Software System (SageMath).

I also worked on Structure Information Modeling (SIM) and made a parser to store contents of STAAD PRO files into MySQL database. User can provide building specifications (for example) through web browser and at the back-end, FreeCAD macros use these input values to draw different views of the building on different drawing sheets. To support 3D rendering on the web browser, an option is provided to convert FreeCAD native file format (.FCStd) to WebGL format.

Link: https://github.com/amrit3701/Sim

I also developed a Python script for AutoCAD to change the dimensions in a DXF file with a defined increment. Currently, I am working on code compliance on IFC files using parsing functionality of IfcOpenShell using Python.

Project Information[edit]

Project Title: Rebar Addon for FreeCAD[edit]

Brief Project Summary[edit]

My project is to create a rebar addon for Arch Workbench of FreeCAD to ease up the process of creating reinforcement in structural element. The main purpose of this project is to enable the user to create reinforcement through an easy and intuitive way. For this proposal, I will be considering rebaring systems for rectangular footing, pedestal, column, beam and slab.

Detailed Project Description[edit]

Existing system in FreeCAD

At present, the rebar functionality in FreeCAD is very limited and creating a reinforcement system is quite tedious. The current approach is followed by creating a sketch for the rebar profile and defining the required set of constraints. This becomes very time-consuming task when user has building model with several structural objects.


Proposed solution to the problem

To ease up the rebaring process in FreeCAD, an interactive addon will be developed where user will input the required data as per the design requirements and they will need not to draw rebars from the Sketcher workbench for creating reinforcement in the structural object.

The basic procedure to achieve this goal will as per the following points:

  1. The first step will begin in the Arch workbench by creating a structure from the “Create a Structure” tab, or alternatively the user may also create a sketch of the profile from Sketcher workbench and then extrude it to transform into the desired structure.

  2. Then the user will select the desired element or a number of elements of a same category.

  3. After selecting the element(s), user will click on rebar dropdown provided in Arch workbench. From dropdown, user will select the rebar shape. Upon selection, dialog box will pop-out with input fields specific to selected rebar. User can enter the input values in the input fields and finally submit with button click.

Options or input parameters for reinforcement are categorised into three groups that forms three different tabs on the rebar dialogue box as following:

  1. Stirrup parameters

  2. Stirrup distribution

  3. Bars


User Interface

Tab I
RebaraddonUI.png


Tab II
RebaraddonUI2.png
Tab III
RebaraddonUI3.png


Features of Rebar addon

  1. User can input the following values in the stirrup parameters tab of the addon:

    • Dia

    • Material

    • Cover

    • Stirrup Type

    • Angle of the hooks as per the type of stirrup

  2. In the stirrup distribution tab user will be asked to input the following values:

    • Distribution pattern

    • Value(s) of spacing(s) as per the distribution pattern

  3. In the bars tab user can enter the following inputs for both the lower and upper bars:

    • Dia

    • Material

    • Hooks angle

    • Number of layers

    • Number of bars in each layer

    • Spacing

  4. The created rebars will have their own view and data properties.

  5. User can edit the parameters of the group of rebars from the view & data properties itself.

  6. These rebars will be fully parametric. Hence the parameters of the rebars will automatically adjust themselves if the changes are made to their parent structure.

  7. The rebars will also have the functionality to cut, copy, clone, move and rotate.


Implementation

  • Every workbench is nothing more than a folder containing an Init.py and/or InitGui.py. I just need to define FreeCAD commands, that can be made into menu items or toolbar buttons.

  • The inputs provided by user from rebar dialog box will be passed to our custom rebar function. This function will use the inputs to define the shape of rebar and in this function the sketcher object will be added to the FreeCAD active document which will hold the profile of the rebar by calculating coordinates of vertices and drawing the shape of rebar from user inputs.

  • Then this sketcher object and the selected structural object will pass to the prebuilt function of FreeCAD which will create the rebar. Below is the detailed description of that function.

    • makeRebar([baseobj,sketch,diameter,amount,offset,name]): Adds a reinforcement bar object to the given structural object, using the given sketch as profile.

By following the above approach I can reuse the existing implementation of reinforcement system in the FreeCAD and at the same time proposing something new and interesting which will enrich user experience.

RebaraddonDFD.png

I created separated workbench to understand how Python scripts run from FreeCAD UI. Here is the code of my workbench: https://github.com/amrit3701/Structural. Doing this exercise helped me in understanding internal structure and flow of FreeCAD.

Here is the reference link for Dialog creation in FreeCAD that may helpful during development: https://www.freecadweb.org/wiki/Dialog_creation


Milestones[edit]

As an overview, out of five rebars (as mentioned in brief description), the simplest one footing rebar, will be completed in the first phase itself before the first evaluation. Next two rebars i.e. column and pedestal are too similar, they will be completed in the second phase before second evaluation. The remaining two rebars beam and slab will be completed in the last phase after second evaluation. Following is the detailed breakdown:

Community Bonding Period

  • Interaction with mentors and other developers on IRC / mailing list regarding the crucial aspects of the project.

  • Learn Pyside (QT) to create to create UI components like dropdown, dialog box etc.

  • Study Chakkree’s reinforcement scripts: (https://forum.freecadweb.org/viewtopic.php?f=23&t=16375).

30 May - 13 June (2 weeks)

  • Writing scripts of reinforcement of footing to achieve following:

    • Parametrization

    • Placement with respect to structure element

    • Grouping

  • Following rebar shapes will be included in its reinforcement:

    • Straight rebar

    • C-Shape rebar

14 June - 20 June (1 week)

  • Develop initial phase of Addon UI that involves dropdown (to select different rebar shapes) and dialog box with options.

21 June - 23 June (3 days)

  • Integration of UI with custom functions.

  • At the end of this milestone, user will be able to see rebars in dropdown. Selecting the rebar will open dialog box with its associated properties.

24 June - 26 June (3 days)

  • Backup days, for any backlogs or any pending tasks and preparation for phase I evaluation.

27 June - 30 June (4 days, Phase I evaluation)

  • Developer documentation using Doxygen.

  • Submitting all the work to mentor.

1 July - 7 July (1 week)

  • Writing scripts for reinforcement of column.

  • Following rebar shapes will be included in its reinforcement:

    • Straight Rebar

    • L-Shape

    • C-Shape

    • Stirrups (2 legs, 3 legs and 4 legs)

    • Diagonal Stirrup

8 July - 12 July (5 days)

  • Writing scripts for reinforcement of pedestal.

  • Following rebar shapes will be included in its reinforcement:

    • L-Shape rebar

    • Stirrup (Rectangular shape)

13 July - 19 July (1 week)

  • Adding UI fields in dialog box for reinforcement of column and pedestal.

20 July - 23 July (4 days)

  • Integration of developed UI of column and pedestal with custom rebar function.

24 July - 28 July (5 days, Phase II evaluation)

  • Work on backlogs or bugs if any.

  • UI enhancements.

  • Submitting all the work to mentor.

29 July - 4 August (1 week)

  • Writing scripts for reinforcement of beam.

  • Following rebar shapes will be included in its reinforcement:

    • Straight Rebar

    • L-Shape

    • C-Shape

    • Stirrups (2 legs, 3 legs, 4 legs )

    • Diagonal Stirrup

5 August - 9 August (5 days)

  • Writing scripts for reinforcement of slab.

  • Following rebar shapes will be included in its reinforcement:

    • Bentup rebar

    • Straight rebar

    • C-Shape rebar


10 August - 14 August (5 days)

  • Adding UI fields for reinforcement of beam and slab.

15 August - 17 August (3 days)

  • Integration of developed UI of beam and slab with custom rebar functions.

18 August - 24 August (1 week)

  • Work on Addon UI to implement input validations and error handling on dialog box.

  • Work on backlogs, testing and bug fixes.


25 August - 29 August (5 days, Final Phase)

  • Developer documentation using Doxygen.

  • User documentation through detailed tutorial and post with screenshots on FreeCAD wiki.

  • Submitting all the work to the mentor.

The advent of this rebar addon in FreeCAD will reduce the effort in creating rebaring to a great extent and thus saving time. Structural engineers will find it easier to do the rebar detailing in their structural models and generate the rebar shop drawings in an easy but professional way.

Time Availability[edit]

I will be available 40 hours / week, if needed can spend more. No restriction of time.

Why FreeCAD?[edit]

The very first reason to choose FreeCAD is that it is the first free and open source BIM software with the functionality of CAD in it. It is a powerful parametric modeler. There are several workbenches included in it which are integrated with one another. The community of FreeCAD is very well established with plenty of helpful coders and engineers of respective domains from different parts of the Globe.

Why you?[edit]

I’m a practical programmer with good proficiency in the languages like C/C++, Python and bash scripting. I worked with Civil engineers, solved their problems and also ease their work through my programming knowledge. All of my previous projects were on FreeCAD only which included Structural Information Modeling (SIM), Parametric building and python-scripted objects. It has been one year that I’m an active member on FreeCAD forum.