GSoC Proposal: Extended functionality of Rebar Addon
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: GSoC Proposal: Extended functionality of Rebar Addon
I think weight (tonnage) should be included, since this is how steel is sold.
See https://www.reinforcing-bar.com/technol ... sizes.html for some conversion factors.
See https://www.reinforcing-bar.com/technol ... sizes.html for some conversion factors.
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: GSoC Proposal: Extended functionality of Rebar Addon
Thanks @Bance for reference.Bance wrote: ↑Wed Apr 01, 2020 4:52 pm I think weight (tonnage) should be included, since this is how steel is sold.
See https://www.reinforcing-bar.com/technol ... sizes.html for some conversion factors.
Now, I think we can have mapping of rebar diameter with its weight in configuration file.
Users from different countries can modify configuration file to meet their standards.
It will be done soon.
Thanks,
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: GSoC Proposal: Extended functionality of Rebar Addon
Its done as per commit: https://github.com/SurajDadral/FreeCAD- ... 194be9df15Bance wrote: ↑Wed Apr 01, 2020 4:52 pm I think weight (tonnage) should be included, since this is how steel is sold.
See https://www.reinforcing-bar.com/technol ... sizes.html for some conversion factors.
Sample output:
Suggestions are always welcome.
Thanks,
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: GSoC Proposal: Extended functionality of Rebar Addon
Update:
Modified program to automatically calculate column dia headers
Before:
Column dia headers are read from a variable in configuration file.
- If there exists rebars with diameter which is not present in variable column_dia_headers in config.py file, then generating BOM produces error.
- There are redundand diameter headers present in BOM corresponding to which, there exists no rebar.
Now:
- Configuration variable column_dia_headers is eliminated and column dia headers are calculated automatically by script
- Only that diameter headers are present in BOM corresponding to which there exists rebars.
Output:
In above output, the total weight for diameter 10 is not calculated because weight/m for diameter 10 is not specified in configuration variable "dia_weight_map".
Thanks,
Modified program to automatically calculate column dia headers
Before:
Column dia headers are read from a variable in configuration file.
- If there exists rebars with diameter which is not present in variable column_dia_headers in config.py file, then generating BOM produces error.
- There are redundand diameter headers present in BOM corresponding to which, there exists no rebar.
Now:
- Configuration variable column_dia_headers is eliminated and column dia headers are calculated automatically by script
- Only that diameter headers are present in BOM corresponding to which there exists rebars.
Output:
In above output, the total weight for diameter 10 is not calculated because weight/m for diameter 10 is not specified in configuration variable "dia_weight_map".
Thanks,
Re: GSoC Proposal: Extended functionality of Rebar Addon
great, need to give it a try. But first I will finish to make my rebar code public.
BTW: great we gone attrac this rebar cut shape list. The idea dates back into 2017 ... https://forum.freecadweb.org/viewtopic. ... 40#p180645
BTW: great we gone attrac this rebar cut shape list. The idea dates back into 2017 ... https://forum.freecadweb.org/viewtopic. ... 40#p180645
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: GSoC Proposal: Extended functionality of Rebar Addon
I also added a new icon for BOM in dropdown menu of Rebar Addon. And code is present in branch "BOM" here: https://github.com/SurajDadral/FreeCAD- ... t/tree/BOM
Yeah.bernd wrote: ↑Thu Apr 02, 2020 8:40 pm BTW: great we gone attrac this rebar cut shape list. The idea dates back into 2017 ... https://forum.freecadweb.org/viewtopic. ... 40#p180645
I am thinking of making columns in Material Bill configurable i.e. user can choose which columns to be shown and their sequence. Do you think this will be helpful?
Thanks,
Re: GSoC Proposal: Extended functionality of Rebar Addon
yes good idea!
What do you use for material calculation, the real length or the length with sharp edges. In switzerland the sharp edge length is taken, even if modeled in 3D! You can check on the example I provided.
How about india and other countries?
What do you use for material calculation, the real length or the length with sharp edges. In switzerland the sharp edge length is taken, even if modeled in 3D! You can check on the example I provided.
How about india and other countries?
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: GSoC Proposal: Extended functionality of Rebar Addon
Implemented above.
And these are the changes:
1. Pass structure elements as input to BOM function
New function definition:
def makeBillOfMaterial(
column_headers=COLUMN_HEADERS,
dia_weight_map=DIA_WEIGHT_MAP,
structures_list=None,
obj_name="RebarBillOfMaterial",
)
e.g.
from BillOfMaterial import BillOfMaterial
BillOfMaterial.makeBillOfMaterial(structures_list=[FreeCAD.ActiveDocument.Structure, FreeCAD.ActiveDocument.Structure001])
2. Make column names and sequence configurable
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 "Member" to "Member Name" replace
("Member", 1) with ("Member Name", 1)
2. To modify sequence of column, change second value in tuple in below
dictionary.
e.g. To place "Member" column at third column in BOM, change
("member", 1) to ("Member", 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 "Member", replace ("Member", 1) with ("Member", 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 = {
"Member": ("Member", 1),
"Mark": ("Mark", 2),
"RebarsCount": ("No. of Rebars", 3),
"Diameter": ("Diameter in mm", 4),
"RebarLength": ("Length in m/piece", 5),
"RebarsTotalLength": ("Total Length in m", 6),
}
And implemented GUI for above:
Suggestions are always welcome.
I used rebar length with sharp edges.
I think we should implement with both real length and length with sharp edges, And user can choose which one to use.
Thanks,
- Suraj Dadral
- Posts: 307
- Joined: Fri Sep 07, 2018 5:32 pm
- Contact:
Re: GSoC Proposal: Extended functionality of Rebar Addon
Implemented above.Suraj Dadral wrote: ↑Sun Apr 05, 2020 1:03 am
I used rebar length with sharp edges.
I think we should implement with both real length and length with sharp edges, And user can choose which one to use.
Now, user can switch between using real rebar length and length with sharp edges by modifying configuration variable REBAR_LENGTH_TYPE which takes values "RealLength" and "LengthWithSharpEdges"
User can also select this through UI while creating Rebars Bill of Material.
Modified UI:
Output with rebar length with sharp edges:
Output with real rebar length:
Function to calculate real rebar length:
Code: Select all
def getRebarRealLength(rebar):
base = rebar.Base
# When rebar is drived from DWire or from Sketch
if hasattr(base, "Length") or base.isDerivedFrom("Sketcher::SketchObject"):
wire = base.Shape.Wires[0]
radius = rebar.Rounding * rebar.Diameter.Value
import DraftGeomUtils
fillet_wire = DraftGeomUtils.filletWire(wire, radius)
real_rebar_length = fillet_wire.Length
return FreeCAD.Units.Quantity(str(real_rebar_length) + "mm")
else:
print("Cannot calculate rebar real length from its base object")
return FreeCAD.Units.Quantity("0 mm")
Thanks,