Merge 3D Meshes

Hello everybody,
I would like to merge several 3D Meshes created by netgen, based on multiple step files.
Using‘meshname’), I have stored a mesh file (‘meshname.vol.gz’) for each single body. Within the netgen GUI I am able to merge these meshes (File->Merge Mesh) and then export them to a single mesh. Is there the opportunity to merge these meshes by a python command? I couldn’t find anything in the documentation and I have seen that a couple of forum members ask for similar questions, but these discussions didn’t helped me.

Hi, see here

Hi Christopher,
thank you for your reply and merry christmas to everybody.
I followed you advise and tried to merge the meshes as described in the tutorial. Unfortunately it does not do the job in my case. My 3D Geometries are partially intersecting each other, which leads to the error:
NgException: Stop meshing since boundary mesh is overlapping

The final goal is to calculate contact forces of a priori intersecting geometries. Therefore I need two separated meshes such that I can start thinking about how to implement the contact.
I have attached a minimal working example, which leads to the upper mentioned and hopefully is meaningful enough in order to describe the problem.

I appreciate any tips or recommendation,
best regards

Attachment: Intersecting_3D_mesh.ipynb

Hi, for what you want to do you don’t have to create separate meshes. You can put the 2 geometry parts in different layers, then they will be meshed separately and this results in overlapping meshes (think this is what you want). See attached file.


Attachment: Intersecting_3D_mesh.ipynb

Thank you Christopher, that is exactly what I was looking for.

Is there a similar layer structure loading a step file via LoadOCCGeometry? The step file could either be an assembly or multiple step files containing a single geometry.

Don’t think this is working right now, but it may be only a few lines of code. Could you provide a simple overlapping assembly you want to mesh?

Sure, a huge and a tiny box are attached as separate step files. The should intersect in the z-axis by 0.1 (similar to the example above). Additionally a small notebook containing the generation of these step files with occ.

Would be great if it works.

Attachment: export_boxes.ipynb

Attachment: HugeBox.stp

Attachment: TinyBox.stp