open3d.t.io.read_triangle_mesh#

open3d.t.io.read_triangle_mesh(filename: os.PathLike | str | bytes, enable_post_processing: bool = False, print_progress: bool = False) open3d.pybind.t.geometry.TriangleMesh#

Read a TriangleMesh from a file.

The format is inferred from the file extension.

Supported formats:

  • ply – native Open3D reader (geometry + colors/normals).

  • npz – Open3D NPZ format (full round-trip including materials and texture maps).

  • obj, stl, off, gltf, glb, fbx – via ASSIMP (geometry; optional vertex normals/colors, UVs, and material/PBR data depending on format, e.g. STL is geometry-only).

The following example reads a triangle mesh with the .ply extension:

import open3d as o3d
mesh = o3d.t.io.read_triangle_mesh('mesh.ply')
Parameters:
  • filename (str) – Path to the mesh file.

  • enable_post_processing (bool) –

    If True enables post-processing for ASSIMP-read formats. Post-processing will

    • triangulate meshes with polygonal faces

    • remove redundant materials

    • pretransform vertices

    • generate face normals if needed

    For more information see ASSIMP’s documentation on the flags aiProcessPreset_TargetRealtime_Fast, aiProcess_RemoveRedundantMaterials, aiProcess_OptimizeMeshes, aiProcess_PreTransformVertices.

    Note that identical vertices will always be joined regardless of whether post-processing is enabled or not, which changes the number of vertices in the mesh. The ply format is not affected by post-processing.

  • print_progress (bool) – If True print the reading progress to the terminal.

Returns:

Returns the mesh object. On failure an empty mesh is returned.