Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save tetgenpy output to file? #5

Open
Florian-Konrad opened this issue Sep 26, 2023 · 3 comments
Open

Save tetgenpy output to file? #5

Florian-Konrad opened this issue Sep 26, 2023 · 3 comments

Comments

@Florian-Konrad
Copy link

Florian-Konrad commented Sep 26, 2023

Hi :)
I generated a tetrahedral mesh like this

tetgenout = tetgenpy.tetrahedralize("", plc.to_tetgenio())

now i'm wondering what a good way is to save the mesh in tetgenout to file?
Cheers
Florian

@j042
Copy link
Member

j042 commented Oct 2, 2023

Hi Florian,

if you are familiar with / your pipline uses tetgen native formats, you could use TetgenIO.save_*() functions. You can load those using TetgenIO.load_*() functions

Otherwise I can imagine a simple numpy based io:

np.save("tetgen_io.npz", points=tetgenout.points() , ...)

Best,
Jae

@j042
Copy link
Member

j042 commented May 16, 2024

Thankfully, vedo started to natively support TetgenIO objects - see #9. For example:

import vedo
...
tet = vedo.TetMesh(tetgenout)
tet.write("out.vtk")

@Florian-Konrad
Copy link
Author

Hi Jae,
thanks for the info! Vedo looks awesome!
I had solved it with building a meshio object from the tetgenout myself and exporting to exodus format.
But cool that vedo can probably do this now, too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants