tetmesh

Support for tetrahedral meshes.

TetMesh

class vedo.tetmesh.TetMesh(inputobj=None, c='r', 'y', 'lg', 'lb', 'b', alpha=0.5, 1, alphaUnit=1, mapper='tetra')[source]

Bases: vtkRenderingCorePython.vtkVolume, vedo.base.BaseGrid

The class describing tetrahedral meshes.

clone()[source]

Clone the TetMesh object to yield an exact copy.

decimate(scalarsName, fraction=0.5, N=None)[source]

Downsample the number of tets in a TetMesh to a specified fraction.

Parameters
  • fraction (float) – the desired final fraction of the total.

  • N (int) – the desired number of final tets

Note

Setting fraction=0.1 leaves 10% of the original nr of tets.

isosurface(threshold=True)[source]

Return a Mesh isosurface.

Parameters

threshold (float,list) – value or list of values to draw the isosurface(s)

slice(origin=0, 0, 0, normal=1, 0, 0)[source]

Return a 2D slice of the mesh by a plane passing through origin and assigned normal.

subdvide()[source]

Increase the number of tets of a TetMesh. Subdivide one tetrahedron into twelve for every tetra.

threshold(name=None, above=None, below=None)[source]

Threshold the tetrahedral mesh by a cell scalar value. Reduce to only tets which satisfy the threshold limits.

delaunay3D

vedo.tetmesh.delaunay3D(mesh, alphaPar=0, tol=None, boundary=False)[source]

Create 3D Delaunay triangulation of input points.

tetralize

vedo.tetmesh.tetralize(dataset, tetsOnly=True)[source]

Tetralize any type of dataset. If tetsOnly is True will cull all 1D and 2D cells from the output.

Return a TetMesh.

Example

from vedo import *
ug = loadUnStructuredGrid(datadir+'ugrid.vtk')
tmesh = tetralize(ug)
tmesh.write('ugrid.vtu').show(axes=1)