Would you like to be able to get data as csv out of BOLTS or would you like to use csv to get data into BOLTS?
yes, basically use csv to export, validate, enrich and import back.
I think the CSV formats are much nicer to display and edit than yaml :) But maybe not as "rich" structurally so I'm looking at it very superficially.
Probably for a single table of values, the csv file is the most user-friendly, but including metadata for each table I'd say justifies the use of a dictionary.
The problem with csv starts when you have no 1-1 relational data like a list of properties with variable length.
@Jesusbill another package which relates to this thread that I recently re-discovered is sectionproperties which can be used to calculate your sectional properties needed for structural design. Since I was taking another look at the work you have done on I-Beams in the BOLTS project and I'm again unsure whether I like the idea better of a "database" structure for structural section properties or whether calculating these "on the fly" would make better sense. Perhaps it could make sense to integrate a tool like sectionproperties (written in Python) to be used to compute the structural section properties and write these directly as a custom pset for the structural IFC element. As far as I am aware for simple cross-sections (i.e. I-beams, rectangular sections, etc.) calculating structural properties is fairly fast. Another benefit to this approach would be that more complex shapes that might result from parametric design scenarios could be easily accounted for. Look forward to hearing your perspective on this.
@jchkoch this looks like a great library! It would be useful to have so as to calculate section properties for any profile.
I do think, however, that it would be better to have these properties already reported for standard steel profiles, or any other standardized shapes of other materials as well.
For rectangular, circular or other simple profiles, it is true that these calculations can be fairly straightforward and most of the times may even not be needed as structural software do cover these cases defining directly only the profile shape and dimensions, or at least this is true for Code_Aster. For symmetric I-beams I have also written this code in ifc2ca to calculate section properties but for most standard I profiles that have also some curved parts these calculations are not exact and I would think it is better to have the exact values already given.
Interestingly Code_Aster has also a macro command for calculating these properties for any shape, but I never used it and it would probably be more complex to implement compared with a python api.
Would you be interested to look into sectionproperties and create a couple of examples so that we can evaluate the code and time needed to do the calculations for a profile? I am definitely in favor of having such a tool available to users.
Thanks for chiming in
It is generally very fast to calculate the section properties for "standard" x-sections (i.e. I-sections, etc.). In my experience using the package 1-2 seconds is sufficient as long as the mesh_size is chosen appropriately (too small of a mesh can cause long calculation times); however, I think because of the flexibility of the library to also deal with complex geometrical x-sections where smaller meshes are needed this is usually a trade-off that is acceptable.
what is the best way to share a couple simple examples? is it best to do so directly on the OSArch Wiki?
I see so much resources, but I am confused on how to implement them in Blender straight away with a closed curve which can be used for modelling purposes.
My workflow of getting profiles might be a bit cumbersome, but there are so much predefined dwg profiles. There are a lot on this website
I use ODA file converter to convert them all at once to DXF, then I import them into Blender and set the scale and origin correctly.
The CSV tables in thread might be interesting to make some script with Python which converts all these coordinates to useful curves. Or maybe it already exists? Or some existing add-on?
@Coen once we have tables for all standard sections and we can create ifc project libraries that we can import then these profiles will be drawn automatically in Blender. I am supposed to work on this (we started with Moult ~10 days ago) but didn't find the time yet. Let me create this first test library and then we can discuss again.
Regarding the dxf polylines you have created, I tried sth similar in the past but I had difficulty meshing it to create the profile section which could be then extruded. I ended up using Salome to import dxf and convert to a face in stl format which was then imported in Blender.
I tried sth similar in the past but I had difficulty meshing it to create the profile section which could be then extruded. I ended up using Salome to import dxf and convert to a face in stl format which was then imported in Blender.
I also extrude the profile sections of the mesh, but I ran into no problems. Please correct me if I'm wrong in my understanding. Or if you see any problems with my workflow.
1) I imported the DXF and then Blender makes a Bezier curve from it?
2) Object -> Convert to Mesh. I just get edges
3) Select all Vertices with A and Pressing F I get the surface
4) Using the Extrude tool
Will the profile sections/or meshes also contain the structural data that goes with it? For example kg/m?
@Coen for some reason when I tried it with an I section it was failing at the 3rd step that you show. Pressing "f" was not good enough to get the section mesh as it was creating a mesh that was partly outside the perimeter. Other than that, the approach I followed is exactly what you show here.
I am very curious in your approach of getting all the profile sections and getting the IFC data attached to the mesh.
I will report here as soon as the first test library is done, hopefully Friday
Are you using the 60 days Free Trial?
If you do and the free trial stops after the 60 days. You could use LibreCAD. The experimental DWG import works fine for these files.
Also, you can install nanoCAD 5.0 It is a freeware software.
But when I update the blt/yaml file and attempt to write it back I get something much more ugly compared to the existing document and all the comments are lost, is there a specific way you prepare this file?
I have not forgotten about this ... There has been a lot going in FreeCAD FEM and in FreeCAD officials. But much more time consuming is our new earth dweller. It`s a boy :-) Thus less sleep and much less time for development ...
I really like the possibility of exporting csv data.
You added the data as csv to the repo as well. Thus the data is duplicated. This is some risk IMHO. Should we not have one place in the repo where the data is saved? All existing YAML have been created manually AFAIK. May be we could add something to be able to convert the csv data into the yaml data?
BTW: Before I came to BOLTS I did not know YAML either. Since than I use it everywhere in favour of xml, csv and whatever. Since it is so easy to read and write by Python and can be edited.
@bernd great to hear from you, congrats about the baby boy!
I will respond to you as soon as I have time as I will be probably away from keyboard for the next two days.
In general I agree with what you wrote, no need to duplicate data, I just pushed the csv tables to show what I did and then we can figure out the best way. Sorry I don't have time now to write more.
@Coen I did found sometime this morning but it is a very much work in progress and I have mixed up things a bit.
I attach the ifc library file I created based on the HEA sections and I also created a short screencast in Blender.
Bear in mind that right now we have a profile panel in the scene properties where you can see the profiles that you import from the project library but there is no way yet to assign this to a structural member. But you can see the properties and the mechanical property set (this latter is shown only for the first profile so this is a bug to fix and we also need to indicate units; the pset is in mm, while the profile properties were converted to meters before creating the project library).
For this reason I also created IfcBeam and IfcColumn Types so that one can visualize the profile and even modify it from the object materialprofile panel, but eventually I think there will be no need for these Types if one is interested only in the profiles.
This coming week I will continue working on this (after Monday) and with @Moult I think we can take care of things needed like being able to assign from the list of profiles to an element without need of Type, take care of units, make sure we can visualize sections of all type etc.
I was hobbying this saturday and tried to make some profile generator. It was more out of research and interest instead of a serious attempt.
It's no way near as advanced as your IFC profile tool. @Jesusbill
This was my attempt, I got a HEA profile table from internet and formatted it to CSV
@Jesusbill I took another look at your csv files for the section properties in the BOLTS repo and I think somehing must have slightly gone wrong as all of the profiles within each "table" (i.e. HEA, HEB, HEM, IPE, etc.) only seem to have the properties for the largest profile per table.
To recalculate myself I used the sectionproperties python package to compute the structural section properties (see https://github.com/jchkoch/BOLTS/blob/profile_dev/misc/calc_structural_properties.py). I also attempted to write the updated tables directly back into the YAML files (i.e. profile_i.blt) using the pyyaml package in python; however, it turns out to not be as straightforward to write human readable values into the YAML file using python. So for now I wrote the data results as csv files (see https://github.com/jchkoch/BOLTS/tree/profile_dev/data/profile_i).
UPDATE: managed to properly write structural section properties back into the YAML file (see https://github.com/jchkoch/BOLTS/blob/profile_dev/data/profile_i_2021.blt).
profile_i__struct.blt
profile_i_ibeam_hea.blt
profile_i_ibeam_heaa.blt
profile_i_ibeam_heb.blt
...
I like this idea because it would simplify reading the date by a human and tracking changes in the data would be much simpler. Changes in the data should happen only in rare cases wheras changes in the yaml class structure could happen.
BTW: have you tried the BOLTS frontend for FreeCAD. It implements a nice gui to add all BOLTS profile data. The gui dependend on the params of the BOLTS part and is dynamically created out of the params in the blt files.
In FreeCAD just got to the AddOn manager and install or update (I fixed some nasty import bug lately) BOLTSFC AddOn, than start it on the gui as one of the macros installed or by
@Jesusbill said:
I attach the ifc library file I created based on the HEA sections ...
blenderbim-demo-library.ifc
Is this some special ifc library file? Is this buildingSMART standard? There is not IfcProject inside the file thus none of my viewers displays anything. Some viewers even crash. I would send them the file if it was some standard.
Mhh they both just use the data of BOLTS but do not use the BOLTS API to access the data. I must admit doing this is not straight forward ATM. I started to make improvements in this regard.
Comments
yes, basically use csv to export, validate, enrich and import back.
Probably for a single table of values, the csv file is the most user-friendly, but including metadata for each table I'd say justifies the use of a dictionary.
The problem with csv starts when you have no 1-1 relational data like a list of properties with variable length.
@Jesusbill another package which relates to this thread that I recently re-discovered is sectionproperties which can be used to calculate your sectional properties needed for structural design. Since I was taking another look at the work you have done on I-Beams in the BOLTS project and I'm again unsure whether I like the idea better of a "database" structure for structural section properties or whether calculating these "on the fly" would make better sense. Perhaps it could make sense to integrate a tool like sectionproperties (written in Python) to be used to compute the structural section properties and write these directly as a custom pset for the structural IFC element. As far as I am aware for simple cross-sections (i.e. I-beams, rectangular sections, etc.) calculating structural properties is fairly fast. Another benefit to this approach would be that more complex shapes that might result from parametric design scenarios could be easily accounted for. Look forward to hearing your perspective on this.
@jchkoch this looks like a great library! It would be useful to have so as to calculate section properties for any profile.
I do think, however, that it would be better to have these properties already reported for standard steel profiles, or any other standardized shapes of other materials as well.
For rectangular, circular or other simple profiles, it is true that these calculations can be fairly straightforward and most of the times may even not be needed as structural software do cover these cases defining directly only the profile shape and dimensions, or at least this is true for Code_Aster. For symmetric I-beams I have also written this code in ifc2ca to calculate section properties but for most standard I profiles that have also some curved parts these calculations are not exact and I would think it is better to have the exact values already given.
Interestingly Code_Aster has also a macro command for calculating these properties for any shape, but I never used it and it would probably be more complex to implement compared with a python api.
Would you be interested to look into
sectionproperties
and create a couple of examples so that we can evaluate the code and time needed to do the calculations for a profile? I am definitely in favor of having such a tool available to users.Thanks for chiming in
@Jesusbill I have added the section-properties library on the OSArch Wiki.
It is generally very fast to calculate the section properties for "standard" x-sections (i.e. I-sections, etc.). In my experience using the package 1-2 seconds is sufficient as long as the mesh_size is chosen appropriately (too small of a mesh can cause long calculation times); however, I think because of the flexibility of the library to also deal with complex geometrical x-sections where smaller meshes are needed this is usually a trade-off that is acceptable.
what is the best way to share a couple simple examples? is it best to do so directly on the OSArch Wiki?
Sounds great @jchkoch , a page in the Wiki with a couple of examples could be nice or make a post in the forum?
I see so much resources, but I am confused on how to implement them in Blender straight away with a closed curve which can be used for modelling purposes.
My workflow of getting profiles might be a bit cumbersome, but there are so much predefined dwg profiles. There are a lot on this website
I use ODA file converter to convert them all at once to DXF, then I import them into Blender and set the scale and origin correctly.
The CSV tables in thread might be interesting to make some script with Python which converts all these coordinates to useful curves. Or maybe it already exists? Or some existing add-on?
@Coen once we have tables for all standard sections and we can create ifc project libraries that we can import then these profiles will be drawn automatically in Blender. I am supposed to work on this (we started with Moult ~10 days ago) but didn't find the time yet. Let me create this first test library and then we can discuss again.
Regarding the dxf polylines you have created, I tried sth similar in the past but I had difficulty meshing it to create the profile section which could be then extruded. I ended up using Salome to import dxf and convert to a face in stl format which was then imported in Blender.
@Jesusbill
I also extrude the profile sections of the mesh, but I ran into no problems. Please correct me if I'm wrong in my understanding. Or if you see any problems with my workflow.
1) I imported the DXF and then Blender makes a Bezier curve from it?
2) Object -> Convert to Mesh. I just get edges
3) Select all Vertices with A and Pressing F I get the surface
4) Using the Extrude tool
Will the profile sections/or meshes also contain the structural data that goes with it? For example kg/m?
The tool from DWG to DXF I used make is ODA file converter
Here is the blend file with different dimension of UNP profiles
I am very curious in your approach of getting all the profile sections and getting the IFC data attached to the mesh.
@Coen for some reason when I tried it with an I section it was failing at the 3rd step that you show. Pressing "f" was not good enough to get the section mesh as it was creating a mesh that was partly outside the perimeter. Other than that, the approach I followed is exactly what you show here.
I will report here as soon as the first test library is done, hopefully Friday
Are you using the 60 days Free Trial?
If you do and the free trial stops after the 60 days. You could use LibreCAD. The experimental DWG import works fine for these files.
Also, you can install nanoCAD 5.0 It is a freeware software.
@bitacovir
No, I don't think so. Atleast I have seen no mention of a trial period, seems like some batch tool.
Thanks for the tip. :-)
I have not forgotten about this ... There has been a lot going in FreeCAD FEM and in FreeCAD officials. But much more time consuming is our new earth dweller. It`s a boy :-) Thus less sleep and much less time for development ...
I really like the possibility of exporting csv data.
You added the data as csv to the repo as well. Thus the data is duplicated. This is some risk IMHO. Should we not have one place in the repo where the data is saved? All existing YAML have been created manually AFAIK. May be we could add something to be able to convert the csv data into the yaml data?
BTW: Before I came to BOLTS I did not know YAML either. Since than I use it everywhere in favour of xml, csv and whatever. Since it is so easy to read and write by Python and can be edited.
Gratuliere zum open-source Nachwuchs :-) Besonders die Mutti :-), wie schafft Sie das zwischen Windeln und Tastaturen.
@Jesusbill
Curious if you already found the time to show us a little part of the test library :-)
@bernd great to hear from you, congrats about the baby boy!
I will respond to you as soon as I have time as I will be probably away from keyboard for the next two days.
In general I agree with what you wrote, no need to duplicate data, I just pushed the csv tables to show what I did and then we can figure out the best way. Sorry I don't have time now to write more.
@Coen I did found sometime this morning but it is a very much work in progress and I have mixed up things a bit.
I attach the ifc library file I created based on the HEA sections and I also created a short screencast in Blender.
Bear in mind that right now we have a profile panel in the scene properties where you can see the profiles that you import from the project library but there is no way yet to assign this to a structural member. But you can see the properties and the mechanical property set (this latter is shown only for the first profile so this is a bug to fix and we also need to indicate units; the pset is in mm, while the profile properties were converted to meters before creating the project library).
For this reason I also created IfcBeam and IfcColumn Types so that one can visualize the profile and even modify it from the object materialprofile panel, but eventually I think there will be no need for these Types if one is interested only in the profiles.
This coming week I will continue working on this (after Monday) and with @Moult I think we can take care of things needed like being able to assign from the list of profiles to an element without need of Type, take care of units, make sure we can visualize sections of all type etc.
sorry just realized I was not recording my mouse ...
https://www.dropbox.com/s/z8dekr11cgutj87/project_profile_library_demo.mkv?dl=0
@Jesusbill
That is absolutely awesome!!!
I was hobbying this saturday and tried to make some profile generator. It was more out of research and interest instead of a serious attempt.
It's no way near as advanced as your IFC profile tool. @Jesusbill
This was my attempt, I got a HEA profile table from internet and formatted it to CSV
I wrote two functions which draw coordinates/edges from the CSV table
It's not very elegant yet as I don't know how to make a fillet radius along the edges the flanges of the profile.
This is my result:
the fixes are merged. https://github.com/boltsparts/BOLTS/compare/cb2f514e858f13a95300083b05fcbf0b904d55a6...bfcabba17d9b0ec34ab4338c378d8597122de78b
In the regard of the csv. How about your opinion ... see post https://community.osarch.org/discussion/comment/8493/#Comment_8493
vielen dank.
@Jesusbill I took another look at your csv files for the section properties in the BOLTS repo and I think somehing must have slightly gone wrong as all of the profiles within each "table" (i.e. HEA, HEB, HEM, IPE, etc.) only seem to have the properties for the largest profile per table.
To recalculate myself I used the
sectionproperties
python package to compute the structural section properties (see https://github.com/jchkoch/BOLTS/blob/profile_dev/misc/calc_structural_properties.py). I also attempted to write the updated tables directly back into the YAML files (i.e. profile_i.blt) using thepyyaml
package in python; however, it turns out to not be as straightforward to write human readable values into the YAML file using python. So for now I wrote the data results as csv files (see https://github.com/jchkoch/BOLTS/tree/profile_dev/data/profile_i).UPDATE: managed to properly write structural section properties back into the YAML file (see https://github.com/jchkoch/BOLTS/blob/profile_dev/data/profile_i_2021.blt).
@Jesusbill and @jchkoch
Would it help if we would sparate the data key from the BOLTS yaml files. Thus we would have one structure file and for each class a file which only contains the pure data from data key. https://github.com/boltsparts/BOLTS/blob/72676c7d413e444/data/profile_i.blt#L60-L83
profile_i.blt
would split into:
profile_i__struct.blt
profile_i_ibeam_hea.blt
profile_i_ibeam_heaa.blt
profile_i_ibeam_heb.blt
...
I like this idea because it would simplify reading the date by a human and tracking changes in the data would be much simpler. Changes in the data should happen only in rare cases wheras changes in the yaml class structure could happen.
BTW: have you tried the BOLTS frontend for FreeCAD. It implements a nice gui to add all BOLTS profile data. The gui dependend on the params of the BOLTS part and is dynamically created out of the params in the blt files.
In FreeCAD just got to the AddOn manager and install or update (I fixed some nasty import bug lately) BOLTSFC AddOn, than start it on the gui as one of the macros installed or by
most of it is FreeCAD independent PySide code https://github.com/boltsparts/BOLTS/blob/72676c7d413e44/backends/freecad/gui/freecad_bolts.py
I have never created widgets for Blender thus ATM I have no idea if it would be possible to reuse the PySide code to create a gui for Blender.
some screen from FreeCAD BOLTSFC AddOn ...
thanks :-)
blenderbim-demo-library.ifc
Is this some special ifc library file? Is this buildingSMART standard? There is not IfcProject inside the file thus none of my viewers displays anything. Some viewers even crash. I would send them the file if it was some standard.
cheers bernd
BTW:
Did you know BOLTS has a webpage with all the parts too ... The page es even translated. Attached the German HEM page
https://www.bolts-library.org/de/parts/index.html
just realized the drawings are missing on the webpage ... it should look like this for I-Beams...
I had a look at https://github.com/Jesusbill/BOLTS/blob/43d382a1c450/misc/export_data.py and https://github.com/jchkoch/BOLTS/blob/5b615689d313/misc/calc_structural_properties.py
Mhh they both just use the data of BOLTS but do not use the BOLTS API to access the data. I must admit doing this is not straight forward ATM. I started to make improvements in this regard.