pymeshfix.MeshFix#
- class pymeshfix.MeshFix(*args)#
Clean and tetrahedralize surface meshes using MeshFix.
- Parameters:
args (pyvista.PolyData | (np.ndarray, np.ndarray)) – Either a pyvista surface mesh
pyvista.PolyData
or an x 3
vertex array andn x 3
face array (indices of the triangles).
Examples
Create a meshfix object from a pyvista mesh.
>>> from pyvista import examples >>> from pymeshfix import MeshFix >>> cow = examples.download_cow() >>> mfix = MeshFix(cow)
Create a meshfix object from two numpy arrays. This example is incomplete as it does not contain the entire array.
>>> import numpy as np >>> points = np.array( ... [ ... [3.71636, 2.343387, 0.0], ... [4.126565, 0.642027, 0.0], ... [3.454971, 2.169877, 0.0], ... ..., ... [4.12616, 2.12093, 1.17252], ... [4.133175, 2.175231, 1.259323], ... [4.232341, 1.903079, 0.534362], ... ], ... dtype=float32, ... ) >>> faces = np.array( ... [ ... [210, 252, 251], ... [250, 251, 252], ... [201, 253, 210], ... ..., ... [1965, 2193, 2194], ... [2391, 2398, 970], ... [966, 961, 970], ... ] ... ) >>> mfix = MeshFix(points, faces)
Methods
Extract the boundaries of the holes in this mesh to a new PyVista mesh of lines.
MeshFix.load_arrays
(v, f)Load triangular mesh from vertex and face numpy arrays.
MeshFix.plot
([show_holes])Plot the mesh.
MeshFix.repair
([verbose, joincomp, ...])Perform mesh repair using MeshFix's default repair process.
MeshFix.save
(filename[, binary])Write a surface mesh to disk.
Attributes
Return the indices of the faces of the mesh.
Return the surface mesh.
Return the points of the mesh.