OSArch Community

Profile Section Libraries for Structural Engineering and beyond!

  1. C

    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

    
    HEA;h;b;a;e;r;h1;kg/m;cm2;m2/m;m2/t
    
    100;96;100;5;8;12;56;16.7;21.2;0.562;33.7
    
    120;114;120;5;8;12;74;19.9;25.3;0.677;34.1
    
    140;133;140;5.5;8.5;12;92;24.7;31.4;0.794;32.2
    
    160;152;160;6;9;15;104;30.4;38.8;0.896;29.8
    
    180;171;180;6;9.5;15;122;35.5;45.3;1.02;28.9
    
    200;190;200;6.5;10;18;134;42.3;53.8;1.14;26.8
    
    220;210;220;7;11;18;152;50.5;64.3;1.26;24.9
    
    240;230;240;7.5;12;21;164;60.3;76.8;1.37;22.7
    
    260;250;260;7.5;12.5;24;177;68.2;86.8;1.48;21.8
    
    280;270;280;8;13;24;196;76.4;97.3;1.6;21
    
    300;290;300;8.5;14;27;208;88.3;112.5;1.72;19.4
    
    320;310;300;9;15.5;27;225;97.6;124.4;1.76;18
    
    340;330;300;9.5;16.5;27;243;105;133.5;1.79;17.1
    
    360;350;300;10;17.5;27;261;112;142.8;1.83;16.4
    
    400;390;300;11;19;27;298;125;159;1.91;15.3
    
    450;440;300;11.5;21;27;344;140;178;2.01;14.4
    
    500;490;300;12;23;27;390;155;197.5;2.11;13.6
    
    550;540;300;12.5;24;27;438;166;211.8;2.21;13.3
    
    600;590;300;13;25;27;486;178;226.5;2.31;13
    
    650;640;300;13.5;26;27;534;190;241.6;2.41;12.7
    
    700;690;300;14.5;27;27;582;204;260.5;2.5;12.3
    
    800;790;300;15;28;30;674;224;285.8;2.7;12
    
    900;890;300;16;30;30;770;252;320.5;2.9;11.5
    
    1000;990;300;16.5;31;30;868;272;346.8;3.1;11.4
    

    I wrote two functions which draw coordinates/edges from the CSV table

    
    
    import csv
    
    import bpy
    
    import mathutils
    
    from mathutils import Vector
    
    
    def get_hea_data():
    
    
    
        hea_list = []
    
    
        with open("C:\\Algemeen\\07_prive\\02_Blender_Python_scripts\\hea.csv") as csv_file:
    
            csv_reader = csv.reader(csv_file, delimiter=';')
    
    
    
            next(csv_reader, None) 
    
    
    
            for row in csv_reader:
    
                print (row)
    
                hea_list.append(row)
    
    
    
        return hea_list
    
    
    
    
    
    
    
    
    
    def create_profile_HEA(profile_name, h,b,tw,tf):
    
    
    
        w = 1          
    
    
    
        cList = [       Vector((0,0,0)),
    
                        Vector((0,tf,0)),
    
                        Vector((b/2-tw,tf,0)),
    
                        Vector((b/2-tw,h-tf,0)),
    
                        Vector((0,h-tf,0)),    
    
                        Vector((0,h,0)), 
    
                        Vector((b,h,0)),
    
                        Vector((b,h-tf,0)),  
    
                        Vector((b/2+tw,h-tf,0)), 
    
                        Vector((b/2+tw,tf,0)),
    
                        Vector((b,tf,0)),
    
                        Vector((b,0,0)),
    
                        Vector((0,0,0))
    
    
    
                      ]          
    
    
        curvedata = bpy.data.curves.new(name='Curve', type='CURVE')
    
        curvedata.dimensions = '3D'
    
    
        objectdata = bpy.data.objects.new(profile_name, curvedata)
    
        objectdata.location = (0,0,0) 
    
    
    
        bpy.context.scene.collection.objects.link(objectdata)
    
    
    
    
        polyline = curvedata.splines.new('POLY')
    
        polyline.points.add(len(cList)-1)
    
        for num in range(len(cList)):
    
            x, y, z = cList[num]
    
            polyline.points[num].co = (x, y, z, w)
    
    
    
    
    
    scale_factor = 1000
    
    move_factor = 0
    
    
    for i in get_hea_data():
    
    
    
    
    
        move_factor += 1
    
        #create_profile_HEA(profile_name='HEA'+str(i[0], h=96,b=100,tw=5,tf=8) 
    
        create_profile_HEA(profile_name=(  'HEA'+str(i[0])), 
    
                                            h=float(i[1])/scale_factor,
    
                                            b=float(i[2])/scale_factor,
    
                                            tw=float(i[3])/scale_factor,
    
                                            tf=float(i[4])/scale_factor)
    
    
    
    
    
    
    
        hea_profile = bpy.data.objects['HEA'+str(i[0])]
    
    
    
        vec = mathutils.Vector((move_factor, 0.0, 0.0))
    
        inv = hea_profile.matrix_world.copy()
    
        inv.invert()
    
    
    
        vec_rot = vec @ inv
    
        hea_profile.location = hea_profile.location + vec_rot
    
    

    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:

  2. B
  3. B

    @lukas said:

    Gratuliere zum open-source Nachwuchs :-) Besonders die Mutti :-), wie schafft Sie das zwischen Windeln und Tastaturen.

    vielen dank.

  4. J

    @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).

  5. B

    @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.

  6. B

    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

    from BOLTS import show_widget as sw
    
    sw()

    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.

  7. B

    some screen from FreeCAD BOLTSFC AddOn ...

  8. B

    @Jesusbill said:

    @bernd great to hear from you, congrats about the baby boy!

    thanks :-)

  9. B

    @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.

    cheers bernd

  10. B

    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...

  11. B
  12. B

    @Coen said:

    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

    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:

    ...

    Some question which might be oblivious for most people around (I am a FreeCAD guy).

    How do I execute this code in Blender?

  13. C

    @bernd

    Click on the script tab.

    Then open the python file.

  14. J

    @bernd said:

    @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.

    i definitely think that would help!

  15. J

    @bernd said:

    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.

    maybe I missed but if @bernd you would point me to the right direction, i'd be more than happy to re-write my script to utilize the BOLTS API to access the data.

  16. J
  17. J

    Hi guys, sorry for the late answers but here I am.

    @bernd

    May be we could add something to be able to convert the csv data into the yaml data?

    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

    I am in favor of splitting the data into csv tables for each family and to yaml metadata files. But I would not favor damping all these into a data folder, I think we need at least a profiles folder inside data to group these.

    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.

    Would be good to layout the possible cases; why data could change (correction, ammendment, etc) and how to handle each case. As I wrote in a previous comment I do fancy the idea of a unique identifier for each profile and a status property that would allow to know the state in each version of the library. I just throw it out there right now, it is sth to discuss maybe in the future.

    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.

    For the same reasons I am a big fan of json format, which interestingly is a superset of yaml. My vote is for json, which I think it is easier to edit and looks like a python dictionary, but I can live with yaml as well :)

    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.

    Blender has its own api for gui so it is not possible to reuse that code, it can give a direction though. But I feel the simplest way for now is to go with the Ifc Project Libraries

    @jchkoch

    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.

    Yikes!! What the heck did I do?!? You are too kind ... I wouldn't call it "slightly gone wrong" at all :D :D

    To recalculate myself I used the sectionproperties python package to compute the structural section properties

    That's very nice to see, it could potentially be used for arbitrary sections, I will give it a try one of these days

    So for now I wrote the data results as csv files

    Looks good but I think we need better names for the columns and we need to agree which properties to include.

    @Coen

    That is absolutely awesome!!!

    Thanks!

    It's no way near as advanced as your IFC profile tool.

    Well it's mostly work done by @Moult honestly :)

    So, how do we proceed right now, should we try to arrange a call in the next days and decide the next steps?

    Or do we continue discussing here? Or open an issue in GitHub?

    My intention would be for the coming weeks to enrich existing profiles and add at least some of the US profiles (W, HSS, C) and create the Ifc Project Libraries from there.

    Also, I would like to add other types, mostly materials (concrete, timber, steel) and eventually material-layer-sets for Cross-Laminated-Timber panels (I am sure @jchkoch can appreciate as well ;)), etc. I do have tables for all these where we could start off.

  18. J

    @Jesusbill said:

    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.

    Yikes!! What the heck did I do?!? You are too kind ... I wouldn't call it "slightly gone wrong" at all :D :D

    that is probably my Canadian upbringing (being polite) :)

    To recalculate myself I used the sectionproperties python package to compute the structural section properties

    That's very nice to see, it could potentially be used for arbitrary sections, I will give it a try one of these days

    So for now I wrote the data results as csv files

    Looks good but I think we need better names for the columns and we need to agree which properties to include.

    yes, i took my lead from the section-properties python package as to names for the columns aka which properties to include as I generally like the approach to generalize the names of the properties to be useful regardless of the material used. But I am definitely open to other schemes.

    So, how do we proceed right now, should we try to arrange a call in the next days and decide the next steps?

    Or do we continue discussing here? Or open an issue in GitHub?

    @Jesusbill @bernd @coen i think a call would be definitely be helpful to help decide next steps. I'm generally available in the evenings (European time) as I work full-time as a structural engineer.

    My intention would be for the coming weeks to enrich existing profiles and add at least some of the US profiles (W, HSS, C) and create the Ifc Project Libraries from there.

    Also, I would like to add other types, mostly materials (concrete, timber, steel) and eventually material-layer-sets for Cross-Laminated-Timber panels (I am sure @jchkoch can appreciate as well ;)), etc. I do have tables for all these where we could start off.

    my intention is generally to help where i can while learning how better to navigate in blender and blenderbim ... i'm still very new to it :) ...

  19. J

    For the same reasons I am a big fan of json format, which interestingly is a superset of yaml. My vote is for json, which I think it is easier to edit and looks like a python dictionary, but I can live with yaml as well :)

    just to add my two cents, adding structural properties to the tables (depending on how many of course) increases the amount of data that needs to be stored and from my perspective makes it more complex to read / write into python to compute the structural properties (perhaps I'm just not aware how to properly serialize the data with compression maybe???); on the otherhand as it is a database that we are creating it really only needs to be computed "once" or when revisions are required (i.e. due to changes in fabrication methods/tolerances) so maybe tishe extra complexity is not a issue. that being said i'm open to either option.

  20. J

    @jchkoch

    i think a call would be definitely be helpful to help decide next steps. I'm generally available in the evenings (European time)

    I think we are all in European time, I am mostly available throughout the day

    Regarding the data formats I feel csv is the easiest to deal with for tabulated data, even for contributions from people that may not be comfortable with executing code, but for metadata I reckon a dictionary-type format is much better.

  21. B

    @Jesusbill said:

    @jchkoch

    i think a call would be definitely be helpful to help decide next steps. I'm generally available in the evenings (European time)

    I think we are all in European time, I am mostly available throughout the day

    We definitely should to this. I work as full time structural engineer too. Since there is a new baby around outside European working there is rare time range for a call (Accept you guys would like to call in the middle of the night when all the others are asleep :-)). Thus European working time perfectly fits for me if I do not have any meetings.

    cheers bernd

  22. B

    @jchkoch said:

    @bernd would this https://github.com/boltsparts/BOLTS/blob/master/bolttools/blt.py be the backend BOLTS API?

    I had a closer look. I did not use the API myself either. I have just used BOLTS for years and added profile sections. Since the original author has left the project and I continued to use BOLTS I started to fix any upcoming bug and eventually I was the maintainer ...

    May be one important information! From readme ...

    _ This repository contains all the tools and data that are required to build the different distributions and the website. You only need to get the content of this repository if you want to contribute content to BOLTS or want to develop the tools that are used to manage it.

    If you just want to use BOLTS, then you should get the BOLTS distribution for the CAD tool of your choice ... _

    ATM there are distributions for FreeCAD, OpenSCAD and there is a alfa version for Nemetschek Allplan which is used only by me.

    Installing for FreeCAD is very easy. Just use the AddOn manager of FreeCAD. This is called BOLTSFC. That is the reason for having two repos on github.

    If FreeCAD is installed a distribution can be directly created out of BOLTS code and started with FreeCAD (it even starts FreeCAD with the code from BOLTS regardless even if BOLTSFC is installed). Very handy on one side development can be made, but FreeCAD can be started and used with the release of BOLTSFC too.

    It is not intended to initialize a repo directly out of BOLTS code. It might be possible, but I have never tried.

    Once BOLTSFC is intalled browsing the repo by Python is straight forward pythonic ... I did some helper methods here ...

    https://github.com/boltsparts/BOLTSFC/blob/9897c083b54fc5/BOLTS/__init__.py#L260-L350

    I have played with BOLTSFC a bit more today ...

    
    # ************************************************************************************************
    
    import BOLTS as boltsfc
    
    rep = boltsfc.repo
    
    
    # each *.blt file in data directory is a collection
    
    # a collections consists of classes
    
    # class and collection names are uniqe in the whole repo
    
    
    # two possibilities
    
    # ONE:
    
    # use iterators from freecad.py in bolttools
    
    # iterators are not generic, they are implemented in freecad and openscad)
    
    last_coll = None
    
    for cl, coll in rep.iterclasses(["class", "collection"]):
    
        if coll != last_coll:
    
            last_coll = coll
    
            print(coll.id)
    
            print("    - ", cl.id)
    
        else:
    
            print("    - ", cl.id)
    
    
    for it in rep.iterclasses():
    
        cl = it[0]
    
        print("{}:\n    - {}\n    - {}\n    - {}\n".format(cl.id, cl.url, cl.source, sorted(cl.parameters.parameters)))
    
    
    
    
    # TWO:
    
    # iterate over the attributes from the repo
    
    sorted(list(rep.__dict__.keys()))
    
    for collname, cl in rep.collections.items():
    
        print(collname)
    
    
    for clname in sorted(list(rep.names.keys())):
    
        print(clname)
    
    
    
    
    # ************************************************************************************************
    
    import BOLTS as boltsfc
    
    rep = boltsfc.repo
    
    
    # some attributes of repo
    
    sorted(list(rep.collections.keys()))
    
    sorted(list(rep.classes.keys()))
    
    sorted(list(rep.bodies.keys()))
    
    sorted(list(rep.names.keys()))
    
    sorted(list(rep.collection_names.__dict__.keys()))
    
    
    
    
    # iterators
    
    for it in rep.iterclasses():
    
        print(sorted(list(it[0].__dict__.keys())))
    
    
    for it in rep.iterclasses():
    
        print(sorted(list(it[0].parameters.__dict__.keys())))
    
    
    for it in rep.iterclasses():
    
        print(it[0].id)
    
    
    for cl in sorted([class_id[0].id for class_id in rep.iterclasses()]):
    
        cl
    
    
    for it in rep.iterclasses():
    
        print(it[0].id)
    
    
    for it in rep.iterclasses(["class"]):
    
        print(it[0].id)
    
    
    for cl, coll in rep.iterclasses(["class", "collection"]):
    
        print(coll.id, " --> ", cl.id)
    
    
    for name in rep.iternames():
    
        print(sorted(list(name[0].__dict__.keys())))
    
    
    for name in rep.iternames():
    
        print(name[0].name.__dict__.keys())
    
    
    for name in rep.iternames():
    
        print(name[0].name.nice)
    
    
  23. B

    There might be a distribution needed in pure Python which does not create any geometry, but just has the API and is able to browse the repo.

    Than browsing the repo would be possible even without any CAD.

    Since all bits are there it should not be to much afford to create such distribution.

  24. B

    @Jesusbill said:

    My intention would be for the coming weeks to enrich existing profiles and add at least some of the US profiles (W, HSS, C) and create the Ifc Project Libraries from there.

    Also, I would like to add other types, mostly materials (concrete, timber, steel) and eventually material-layer-sets for Cross-Laminated-Timber panels (I am sure @jchkoch can appreciate as well ;)), etc. I do have tables for all these where we could start off.

    Any library is as good as the data it has, regardless how good the API around is. Thus as more data as better.

  25. B

    just a simple example to access the data from BOLTSFC ... in FreeCAD Python console

    
    import BOLTS as bolts
    
    cl = bolts.repo.classes["ibeam_hea"]
    
    cl.parameters.tables[0].columns
    
    for k, v in cl.parameters.tables[0].data.items():
    
        print("{}: {}".format(k, v))
    
    
    
    Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
    
    [GCC 8.3.0] on linux
    
    Type 'help', 'copyright', 'credits' or 'license' for more information.
    
    >>> Gui.runCommand('Std_Workbench',36)
    
    >>> Gui.runCommand('Std_ViewStatusBar',1)
    
    >>> import BOLTS as bolts
    
    >>> cl = bolts.repo.classes["ibeam_hea"]
    
    >>> cl.parameters.tables[0].columns
    
    ['h', 'b', 'tw', 'tf', 'r']
    
    >>> for k, v in cl.parameters.tables[0].data.items():
    
    ...     print("{}: {}".format(k, v))
    
    ... 
    
    HEA100: [96.0, 100.0, 5.0, 8.0, 12.0]
    
    HEA120: [114.0, 120.0, 5.0, 8.0, 12.0]
    
    HEA140: [133.0, 140.0, 5.5, 8.5, 12.0]
    
    HEA160: [152.0, 160.0, 6.0, 9.0, 15.0]
    
    HEA180: [171.0, 180.0, 6.0, 9.5, 15.0]
    
    HEA200: [190.0, 200.0, 6.5, 10.0, 18.0]
    
    HEA220: [210.0, 220.0, 7.0, 11.0, 18.0]
    
    HEA240: [230.0, 240.0, 7.5, 12.0, 21.0]
    
    HEA260: [250.0, 260.0, 7.5, 12.5, 24.0]
    
    HEA280: [270.0, 280.0, 8.0, 13.0, 24.0]
    
    HEA300: [290.0, 300.0, 8.5, 14.0, 27.0]
    
    HEA320: [310.0, 300.0, 9.0, 15.5, 27.0]
    
    HEA340: [330.0, 300.0, 9.5, 16.5, 27.0]
    
    HEA360: [350.0, 300.0, 10.0, 17.5, 27.0]
    
    HEA400: [390.0, 300.0, 11.0, 19.0, 27.0]
    
    HEA450: [440.0, 300.0, 11.5, 21.0, 27.0]
    
    HEA500: [490.0, 300.0, 12.0, 23.0, 27.0]
    
    HEA550: [540.0, 300.0, 12.5, 24.0, 27.0]
    
    HEA600: [590.0, 300.0, 13.0, 25.0, 27.0]
    
    HEA650: [640.0, 300.0, 13.5, 26.0, 27.0]
    
    HEA700: [690.0, 300.0, 14.5, 27.0, 27.0]
    
    HEA800: [790.0, 300.0, 15.0, 28.0, 30.0]
    
    HEA900: [890.0, 300.0, 16.0, 30.0, 30.0]
    
    HEA1000: [990.0, 300.0, 16.5, 31.0, 30.0]
    
    >>> 
    
  1. Page 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7

Login or Register to reply.