Importing complex BRep geometry from step files
Dear @geuzaine , I am using a step file to introduce geometry in gmsh. I am having some issues with the gable walls. In particular, I can access and mesh surfaces as 2d elements but I don't get the volumes (see pic).
To perform finite element analysis for the scope of my Ph.D. I need to mesh these elements in 3D using tetraedron elements. I wondered if it was possible to collect the 2D geometry in gmsh and generate volumes starting from it so that I can mesh. I tried this:
gmsh.initialize()
# Create a new model
gmsh.model.add("example")
entities = gmsh.open("converted.step")
# Print the entity tags
for e in entities:
print(e[0])
# Add the surface entities to the model
surfaces = []
for e in entities:
if e["dim"] == 2:
# Create a surface from the entity's geometry and add it to the model
surfaces.append(gmsh.model.occ.addSurface(e["geometry"]))
# Create a surface filling from the surfaces
sf = gmsh.model.geo.addSurfaceFilling(surfaces)
# Create a volume from the surface filling
v = gmsh.model.geo.addVolume([sf])
# Generate and draw the model
gmsh.model.geo.synchronize()
gmsh.fltk.run()
# Finalize the model
gmsh.finalize()
But the output is the following error:
Traceback (most recent call last):
File "c:/Users/mlaur/Desktop/JanuaryCode/ProjectMesh.py", line 120, in <module>
for e in entities:
TypeError: 'NoneType' object is not iterable
Do you have some hints?
Regards, Maria Laura Leonardi