trimesh.parent module

parent.py

The base class for Trimesh, PointCloud, and Scene objects

Classes

Geometry

Parent of geometry classes.

class trimesh.parent.Geometry

Bases: abc.ABC

Parent of geometry classes.

The Geometry object is the parent object of geometry classes, including: Trimesh, PointCloud, and Scene objects.

By decorating a method with abc.abstractmethod it just means the objects that inherit from Geometry MUST implement those methods.

Methods

apply_scale(scaling)

Scale the mesh equally on all axis.

apply_transform(matrix)

apply_translation(translation)

Translate the current mesh.

copy()

is_empty()

show()

Attributes

bounding_box

An axis aligned bounding box for the current mesh.

bounding_box_oriented

An oriented bounding box for the current mesh.

bounding_cylinder

A minimum volume bounding cylinder for the current mesh.

bounding_primitive

The minimum volume primitive (box, sphere, or cylinder) that bounds the mesh.

bounding_sphere

A minimum volume bounding sphere for the current mesh.

bounds

extents

apply_scale(scaling)

Scale the mesh equally on all axis.

Parameters

scaling (float) – Scale factor to apply to the mesh

abstract apply_transform(matrix)
apply_translation(translation)

Translate the current mesh.

Parameters

translation ((3,) float) – Translation in XYZ

property bounding_box

An axis aligned bounding box for the current mesh.

Returns

aabb – Box object with transform and extents defined representing the axis aligned bounding box of the mesh

Return type

trimesh.primitives.Box

property bounding_box_oriented

An oriented bounding box for the current mesh.

Returns

obb – Box object with transform and extents defined representing the minimum volume oriented bounding box of the mesh

Return type

trimesh.primitives.Box

property bounding_cylinder

A minimum volume bounding cylinder for the current mesh.

Returns

mincyl – Cylinder primitive containing current mesh

Return type

trimesh.primitives.Cylinder

property bounding_primitive

The minimum volume primitive (box, sphere, or cylinder) that bounds the mesh.

Returns

bounding_primitive – Smallest primitive which bounds the mesh: trimesh.primitives.Sphere trimesh.primitives.Box trimesh.primitives.Cylinder

Return type

object

property bounding_sphere

A minimum volume bounding sphere for the current mesh.

Note that the Sphere primitive returned has an unpadded, exact sphere_radius so while the distance of every vertex of the current mesh from sphere_center will be less than sphere_radius, the faceted sphere primitive may not contain every vertex

Returns

minball – Sphere primitive containing current mesh

Return type

trimesh.primitives.Sphere

abstract property bounds
abstract copy()
abstract property extents
abstract is_empty()
abstract show()