GSoC Proposal: Extended functionality of Rebar Addon

A forum dedicated to the Draft, Arch and BIM workbenches development.
User avatar
amrit3701
Posts: 278
Joined: Mon Jun 13, 2016 5:37 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby amrit3701 » Mon May 18, 2020 8:35 am

Suraj Dadral wrote:
Sun May 17, 2020 5:16 pm
Using number of decimals from freecad units preferences looks fine to me.
@amrit3701 or @bernad may suggest if it is right approach or not.
Yes, use No of Decimals from FreeCAD preferences (General -> Units tab).
User avatar
Suraj Dadral
Posts: 184
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby Suraj Dadral » Fri May 22, 2020 5:35 pm

Hi @bernd and @amrit3701,

Here is update:
Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
1. When we increase font size in BOM_content object, text goes out of their rectangular cells. To fix this, we need to find string width in pixels for text in cells and set rectangular cell size accordingly. To find string width in pixels, we can use PySide2 as here. The problem with this method is that we can't use it in pure console having no gui, as it internally uses some components from gui. For, pure console, we can use Pillow python library. So, to generate BOM svg in pure console, power users can install Pillow library themselves.
Its done as per commit: commit1, commit2

To make BOM_SVG work in pure console mode, added parameter "FontFilename" to BOM_content object. It is required by Pillow library to find string width.

Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
2. Use round(FreeCAD.Units.Quantity("10 mm").Value) instead of round(FreeCAD.Units.Quantity("10 mm")).
Its done as per commit: https://github.com/SurajDadral/FreeCAD- ... c471e97518

Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
3. For exception handling, don't use base exception, instead use appropriate exception.
Its done as per commit: https://github.com/SurajDadral/FreeCAD- ... 3db393f9e7

Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
6. For checking properties of BOM_content object in function setProperties() here, use ```if not hasattr(obj, "Font")``` instead of "if "Font" not in pl" from performance point of view.
Its done as per commit: https://github.com/SurajDadral/FreeCAD- ... 3db393f9e7

Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
7. Although BOM code is designed to have separate console and gui code, but I need to test BOM generation in pure console with no gui element as I didn't did it yet.
I tested it and fixed some code and is now working fine in pure console mode and in FreeCAD console and Gui.

Please review and give your suggestions.

Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
4. To manage Rebar Addon configurations, we can use freecad preferences database. Check if preferences are not loaded before using them and load them first if needed.
Now, going to implement this.

Thanks,
User avatar
Suraj Dadral
Posts: 184
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby Suraj Dadral » Sun May 24, 2020 12:30 am

Suraj Dadral wrote:
Fri May 22, 2020 5:35 pm
Suraj Dadral wrote:
Sun May 17, 2020 3:04 pm
4. To manage Rebar Addon configurations, we can use freecad preferences database. Check if preferences are not loaded before using them and load them first if needed.
Now, going to implement this.
Its done.
commit1: Store preferences in FreeCAD user preferences path
commit2: Add save preferences button while creating BOM. As suggested by @balbros here.

Suggestions are always welcome. :)

Thanks,
User avatar
amrit3701
Posts: 278
Joined: Mon Jun 13, 2016 5:37 pm

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby amrit3701 » Sun May 24, 2020 10:08 am

Hi,

We are close to the end of the community bonding period, so I conducted a meeting with Suraj to show his progress. ;)

Meeting URL: https://www.patreon.com/posts/freecad-rebar-37466170

Thanks,