GSoC Proposal: Extended functionality of Rebar Addon

A forum dedicated to the Draft, Arch and BIM workbenches development.
carlopav
Posts: 1622
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby carlopav » Mon Apr 06, 2020 1:19 pm

Nice, may I suggest for the interface to just put the name of the "Column data" and a checkbox on the left, without a the Hide label, and set all of them checked by default (so user will uncheck what he wants to hide)?
O - Member - Member

It will just look cleaner :)
follow my experiments on BIM modelling for architecture design
User avatar
Suraj Dadral
Posts: 304
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby Suraj Dadral » Mon Apr 06, 2020 9:17 pm

carlopav wrote:
Mon Apr 06, 2020 1:19 pm
Nice, may I suggest for the interface to just put the name of the "Column data" and a checkbox on the left, without a the Hide label, and set all of them checked by default (so user will uncheck what he wants to hide)?
O - Member - Member

It will just look cleaner :)
Thanks @carlopav for your suggestion.
Implemented above as per commit: https://github.com/SurajDadral/FreeCAD- ... d7d3f76803

Modified UI:
ModifiedUi.png
ModifiedUi.png (40.42 KiB) Viewed 376 times

Thanks,
carlopav
Posts: 1622
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby carlopav » Mon Apr 06, 2020 9:19 pm

So quick! thanks for your work :)
follow my experiments on BIM modelling for architecture design
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby bernd » Thu Apr 09, 2020 4:21 am

If your latest wb is installed how do I create a BOM ?

I tried this branch https://github.com/SurajDadral/FreeCAD- ... BOM-rebar2

EDIT: found it. if the correct branch is installed the icon is there.
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby bernd » Thu Apr 09, 2020 4:29 am

Screenshot_20200409_062739.png
Screenshot_20200409_062739.png (55.81 KiB) Viewed 327 times
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby bernd » Thu Apr 09, 2020 4:38 am

some remarks:

- mark is an integer
- no. of rebars is integer as well
- is it possible to change the units?
- I prefer diameter in mm (ok), piece length in cm (not ok), and total length in m (ok)

more to come after testing on real data ...

How to get it on a A4 paper?
User avatar
karansohal875
Posts: 4
Joined: Wed Apr 24, 2019 10:09 am
Location: Punjab,India

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby karansohal875 » Thu Apr 09, 2020 4:33 pm

Hello Suraj!
Thanks for adding BOM, this tool is really useful. :D

I was using BOM and I found that after exporting BOM spreadsheet to CSV file all the units(including m ) were automatically changed to mm again.
Here I'm attaching the screenshots of BOM sheet before
Before exporting.png
Before exporting.png (80.24 KiB) Viewed 286 times
and after
After exporting.jpg
After exporting.jpg (194.4 KiB) Viewed 286 times
exporting to CSV file.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19955 (Git)
Build type: Release
Branch: master
Hash: fd907d6d9789f71007b8d0177d167f1de82629b8
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby bernd » Thu Apr 09, 2020 8:43 pm

tried a real world example ... very cool we have a BOM :)

- the diameter would look much better if rounded on mm as well
- the column count of the rebars for each mark is missing (the manufactor needs to know how many of each marks he should produce)

compared the crane foundation example and th BOM with sharp edges. Still the length is different.


Screenshot_20200409_223928.png
Screenshot_20200409_223928.png (94.4 KiB) Viewed 267 times
User avatar
Suraj Dadral
Posts: 304
Joined: Fri Sep 07, 2018 5:32 pm
Contact:

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby Suraj Dadral » Thu Apr 09, 2020 9:03 pm

bernd wrote:
Thu Apr 09, 2020 4:38 am
some remarks:

- mark is an integer
- no. of rebars is integer as well
- is it possible to change the units?
- I prefer diameter in mm (ok), piece length in cm (not ok), and total length in m (ok)
Hi @bernd
Implemented solution for above suggestions and made column units configurable through configuration file and ui as per commit: https://github.com/SurajDadral/FreeCAD- ... c2cce32bdf

Modified config file

Code: Select all

import FreeCAD


# Units used to display data in Bill Of Material
COLUMN_UNITS = {
    "Diameter": "mm",
    "RebarLength": "m",
    "RebarsTotalLength": "m",
}

# Column are configurable i.e. you can change Name of column header, change
# their sequence and show/hide column.
# 1. To change column headers, change first value in tuple in below dictionary.
#    e.g. To change column header "Mark" to "Mark Number" replace ("Mark", 1)
#    with ("Mark Number", 1))
# 2. To modify sequence of column, change second value in tuple in below
# dictionary.
#    e.g. To place "Mark" column at third column in BOM, change ("Mark", 1)
#    to ("Mark", 3)
# 3. To hide column, set second value in tuple in below dictionary to 0. And to
#    show column, set it to other than 0 which will be used used as placement
#    sequence number for that column.
#    e.g. to hide column "Mark", replace ("Mark", 1) with ("Mark", 0)
#
# Note: You must take care that no two columns get same placement number. And
#       must not delete/modify values in LHS of ":" (colon).
COLUMN_HEADERS = {
    "Mark": ("Mark", 1),
    "RebarsCount": ("No. of Rebars", 2),
    "Diameter": ("Diameter in " + COLUMN_UNITS["Diameter"], 3),
    "RebarLength": ("Length in " + COLUMN_UNITS["RebarLength"] + "/piece", 4),
    "RebarsTotalLength": (
        "Total Length in " + COLUMN_UNITS["RebarsTotalLength"],
        5,
    ),
}

# Map diameter (in mm) with weight (kg/m)
# Default list is taken as per book SP34 from here:
# https://archive.org/details/gov.in.is.sp.34.1987/page/n236/mode/2up
DIA_WEIGHT_MAP = {
    6: FreeCAD.Units.Quantity("0.222 kg/m"),
    8: FreeCAD.Units.Quantity("0.395 kg/m"),
    10: FreeCAD.Units.Quantity("0.617 kg/m"),
    12: FreeCAD.Units.Quantity("0.888 kg/m"),
    14: FreeCAD.Units.Quantity("1.206 kg/m"),
    16: FreeCAD.Units.Quantity("1.578 kg/m"),
    18: FreeCAD.Units.Quantity("2.000 kg/m"),
    20: FreeCAD.Units.Quantity("2.466 kg/m"),
    22: FreeCAD.Units.Quantity("2.980 kg/m"),
    25: FreeCAD.Units.Quantity("3.854 kg/m"),
    28: FreeCAD.Units.Quantity("4.830 kg/m"),
    32: FreeCAD.Units.Quantity("6.313 kg/m"),
    36: FreeCAD.Units.Quantity("7.990 kg/m"),
    40: FreeCAD.Units.Quantity("9.864 kg/m"),
    45: FreeCAD.Units.Quantity("12.490 kg/m"),
    50: FreeCAD.Units.Quantity("15.410 kg/m"),
}

# Type of length to be used in BOM
# It can be "RealLength" or "LengthWithSharpEdges"
REBAR_LENGTH_TYPE = "RealLength"
Modified UI:
SetUnitsUi.png
SetUnitsUi.png (45.07 KiB) Viewed 256 times

If user enter wrong units:
WrongUnitUi.png
WrongUnitUi.png (45.32 KiB) Viewed 256 times
bernd wrote:
Thu Apr 09, 2020 4:38 am
more to come after testing on real data ...

How to get it on a A4 paper?
I am planning to export it to svg format, which then can be inserted on A4 paper. And after that a checkbox to add it to techdraw page.

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

Re: GSoC Proposal: Extended functionality of Rebar Addon

Postby Suraj Dadral » Thu Apr 09, 2020 9:48 pm

karansohal875 wrote:
Thu Apr 09, 2020 4:33 pm
Hello Suraj!
Thanks for adding BOM, this tool is really useful. :D
Thanks @karansohal875
karansohal875 wrote:
Thu Apr 09, 2020 4:33 pm
I was using BOM and I found that after exporting BOM spreadsheet to CSV file all the units(including m ) were automatically changed to mm again.
Here I'm attaching the screenshots of BOM sheet beforeBefore exporting.png and afterAfter exporting.jpg exporting to CSV file.
I found a workaround to do this. We need to set displayed data in each cell by adding ' (single quote) before it.
But there is one limitation with this that we can't modify data units after doing this. So, we need to do this at the end i.e. just before exporting spreadsheet.

I think there might be a better way to do this which I am not aware of as I am new to spreadsheet workbench.
@bernd or other members here may help in this.

Thanks,