protomotions.utils.mesh_utils module

General-purpose mesh utilities.

Provides functions for working with 3D mesh objects, used across the codebase.

protomotions.utils.mesh_utils.as_mesh(scene_or_mesh)[source]

Convert a Trimesh Scene or Mesh to a single Mesh object.

Parameters:

scene_or_mesh – Trimesh Scene or Mesh

Returns:

Trimesh Mesh (concatenated if Scene)

protomotions.utils.mesh_utils.compute_bounding_box(mesh)[source]

Compute bounding box dimensions and min corner of a mesh.

Parameters:

mesh – Trimesh mesh object

Returns:

Tuple of (width, height, depth, min_x, min_y, min_z)