pymeshfix.MeshFix.load_arrays#

MeshFix.load_arrays(v, f)#

Load triangular mesh from vertex and face numpy arrays.

Both vertex and face arrays should be 2D arrays with each vertex containing XYZ data and each face containing three points.

Parameters:
  • v (np.ndarray) – n x 3 vertex array.

  • f (np.ndarray) – n x 3 face array.

Examples

Create a meshfix object from two numpy arrays. This example is incomplete as it does not contain the entire array.

>>> from pymeshfix import MeshFix
>>> 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)