FEM and Blender: Difference between revisions
From wikiluntti
Line 21: | Line 21: | ||
* Parts list | * Parts list | ||
** Using a script: Selected parts only, and don't apply rotations! https://github.com/kittengue-dot/Blender-Script-Export-Part-list https://www.youtube.com/watch?v=C1RZszKlojQ | ** Using a script: Selected parts only, and don't apply rotations! https://github.com/kittengue-dot/Blender-Script-Export-Part-list https://www.youtube.com/watch?v=C1RZszKlojQ | ||
<syntaxhighlight lang="python"> | |||
import bpy | |||
import csv | |||
def export_selected_mesh_dimensions_to_csv(filepath): | |||
"""Export Parts | |||
Args: | |||
filepath (str): Le chemin du fichier CSV de sortie. | |||
""" | |||
with open(filepath, 'w', newline='', encoding='utf-8') as csvfile: | |||
fieldnames = ['Part', 'Section X (mm)', 'Section Y (mm)', 'Length Z (mm)'] | |||
writer = csv.DictWriter(csvfile, fieldnames=fieldnames) | |||
writer.writeheader() | |||
for obj in bpy.context.selected_objects: | |||
if obj.type == 'MESH': | |||
dimensions = obj.dimensions | |||
x = [0,0,0] | |||
x[0] = round(dimensions.x * 1000, 3) | |||
x[1] = round(dimensions.y * 1000, 3) | |||
x[2] = round(dimensions.z * 1000, 3) | |||
x.sort() | |||
writer.writerow({'Part': obj.name, 'X (mm)': x[0], 'Y (mm)': x[1], 'Z (mm)': x[2]}) | |||
filepath = "/home/user/Downloads/part_list.csv" # Replace destination path | |||
export_selected_mesh_dimensions_to_csv(filepath) | |||
</syntaxhighlight> |
Revision as of 21:30, 26 June 2025
Introduction
- Blender
- 3D print add-on (Check all)
- BFEX - Blender FEA Exporter https://github.com/MiguelDLM/BFEX
- Blendmsh https://github.com/senthurayyappan/blendmsh
- quad remesher https://www.youtube.com/watch?v=kfQfU_cDRWE
- Fix meshes https://github.com/evaherbst/Blender_remeshing_guide
- Elmer https://www.elmerfem.org/blog/
- FreeCAD
- Gmsh https://gmsh.info/
- Netgen https://ngsolve.org/
- OpenFOAM https://www.openfoam.com/
- Paraview https://www.paraview.org/
- Salome
- TetGen
Blender and CAD
- TinyCAD https://docs.blender.org/manual/en/4.1//addons/mesh/tinycad.html
- CadSketcher https://www.cadsketcher.com/
- Parts list
- Using a script: Selected parts only, and don't apply rotations! https://github.com/kittengue-dot/Blender-Script-Export-Part-list https://www.youtube.com/watch?v=C1RZszKlojQ
import bpy
import csv
def export_selected_mesh_dimensions_to_csv(filepath):
"""Export Parts
Args:
filepath (str): Le chemin du fichier CSV de sortie.
"""
with open(filepath, 'w', newline='', encoding='utf-8') as csvfile:
fieldnames = ['Part', 'Section X (mm)', 'Section Y (mm)', 'Length Z (mm)']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
for obj in bpy.context.selected_objects:
if obj.type == 'MESH':
dimensions = obj.dimensions
x = [0,0,0]
x[0] = round(dimensions.x * 1000, 3)
x[1] = round(dimensions.y * 1000, 3)
x[2] = round(dimensions.z * 1000, 3)
x.sort()
writer.writerow({'Part': obj.name, 'X (mm)': x[0], 'Y (mm)': x[1], 'Z (mm)': x[2]})
filepath = "/home/user/Downloads/part_list.csv" # Replace destination path
export_selected_mesh_dimensions_to_csv(filepath)