Merge Meshes
#1422
Replies: 2 comments 2 replies
-
Hi, such a function would indeed be nice - however, it is probably out of scope. For my understanding, meshio is just for import/export - not mesh manipulation. Personally, I'm using the import meshio
import felupe as fem
# container = fem.mesh.read("filename.vtk") # read a mesh using meshio
meshes = [fem.Rectangle(n=2), fem.Rectangle(n=2)]
container = fem.MeshContainer(meshes, merge=False) # optional merge of duplicated points
mesh = container.stack()
The result can be converted back to a meshio-mesh.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
It's straightforward with PyVista. import pyvista as pv
mesh = pv.from_meshio(a) + pv.from_meshio(b) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just wanted to use meshio to write me nice vtk files for some meshes, and therefore I need to merge multiple meshes together.
I did not found a direct way to do that, thus I wrote this (very simplified and not generally usable) function:
It simply concatenates the point vectors and adjusts the numbering in the second mesh.
Because that could be useful for other things as well, I wondered, if I overlooked something and there is more generic way already implemented?
Beta Was this translation helpful? Give feedback.
All reactions