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: