pyvista.from_trimesh

pyvista.from_trimesh#

from_trimesh(mesh: trimesh.Trimesh, *, pass_data: _PassDataOptions = True) PolyData[ソース]#

Convert a Trimesh mesh to a PyVista mesh.

  • vertex_attributes are stored as point data.

  • face_attributes are stored as cell data.

  • metadata is stored as field data: NumPy arrays are stored directly as field data arrays, and any other metadata (e.g. strings or lists) is stored in the user_dict.

注釈

No copies of point, cell, or data arrays are made. Use copy() after converting to avoid any side effects.

Added in version 0.47.

パラメータ:
meshtrimesh.Trimesh

Trimesh object to convert.

pass_databool | str | sequence[str], default: True

Pass point, cell, and/or field data from the Trimesh object. All data is passed by default. Set this to 'point', 'cell', 'field' or any combination thereof to only pass specific fields.

See ​他のオブジェクトのラップ for examples.