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

the input of pytetgen #20

Open
tftangming opened this issue Aug 21, 2020 · 6 comments
Open

the input of pytetgen #20

tftangming opened this issue Aug 21, 2020 · 6 comments

Comments

@tftangming
Copy link

Now I only have some point saved by a .ply file, and I want to use the pytetgen to generate the tetrahedra and visualize.Is it possible?

@akaszynski
Copy link
Member

Now I only have some point saved by a .ply file

I'm assuming you have a surface. If so, I'd follow the steps in the README to load and tetrahedralize the surface. See the sphere example, but substitute your mesh for the sphere by first loading your mesh with pyvista.read.

@banesullivan
Copy link
Member

To be extra clear, try this:

import pyvista as pv
import tetgen

surface = pv.read('mysurface.ply')

tet = tetgen.TetGen(surface)
tet.tetrahedralize()
grid = tet.grid

grid.plot(show_edges=True)

grid.clip().plot(show_edges=True)

@banesullivan
Copy link
Member

Once you tetrahedralize it, then you should head over to PyVista's documentation to learn how to do all the visualization: https://docs.pyvista.org/examples/index.html

@chenzhaiyu
Copy link

Hi, is it possible for this interface to generates the Delaunay tetrahedralization from points only, instead of a surface?

With C++ tetgen this functionality is there (Figure 12 of http://wias-berlin.de/software/tetgen/1.5/doc/manual/manual005.html).

To be extra clear, try this:

import pyvista as pv
import tetgen

surface = pv.read('mysurface.ply')

tet = tetgen.TetGen(surface)
tet.tetrahedralize()
grid = tet.grid

grid.plot(show_edges=True)

grid.clip().plot(show_edges=True)

Tried loading a ply file using this example with point coordinates only (no face record) but failed:

RuntimeError: Failed to tetrahedralize.
May need to repair surface by making it manifold

@banesullivan
Copy link
Member

Hi, is it possible for this interface to generates the Delaunay tetrahedralization from points only, instead of a surface?

Nope, the input must be a manifold, triangular surface

@chenzhaiyu
Copy link

Hi, is it possible for this interface to generates the Delaunay tetrahedralization from points only, instead of a surface?

With C++ tetgen this functionality is there (Figure 12 of http://wias-berlin.de/software/tetgen/1.5/doc/manual/manual005.html).

Thanks @banesullivan. For others looking for this, scipy.spatial.Delaunay supports Delaunay tessellation in N dimensions.

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

4 participants