trimesh.boolean module

boolean.py

Do boolean operations on meshes using either Blender or OpenSCAD.

Functions

boolean_automatic(meshes, operation)

Automatically pick an engine for booleans based on availability.

difference(meshes[, engine])

Compute the boolean difference between a mesh an n other meshes.

intersection(meshes[, engine])

Compute the boolean intersection between a mesh an n other meshes.

union(meshes[, engine])

Compute the boolean union between a mesh an n other meshes.

trimesh.boolean.boolean_automatic(meshes, operation)

Automatically pick an engine for booleans based on availability.

Parameters
  • meshes (list of Trimesh) – Meshes to be booleaned

  • operation (str) – Type of boolean, i.e. ‘union’, ‘intersection’, ‘difference’

Returns

result – Result of boolean operation

Return type

trimesh.Trimesh

trimesh.boolean.difference(meshes, engine=None)

Compute the boolean difference between a mesh an n other meshes.

Parameters
  • meshes (list of trimesh.Trimesh) – Meshes to be processed

  • engine (str) – Which backend to use, i.e. ‘blender’ or ‘scad’

Returns

difference

Return type

a - (other meshes), **kwargs for a Trimesh

trimesh.boolean.intersection(meshes, engine=None)

Compute the boolean intersection between a mesh an n other meshes.

Parameters
  • meshes (list of trimesh.Trimesh) – Meshes to be processed

  • engine (str) – Which backend to use, i.e. ‘blender’ or ‘scad’

Returns

intersection – volume that is contained by all meshes

Return type

**kwargs for a Trimesh object of the

trimesh.boolean.union(meshes, engine=None)

Compute the boolean union between a mesh an n other meshes.

Parameters
  • meshes (list of trimesh.Trimesh) – Meshes to be processed

  • engine (str) – Which backend to use, i.e. ‘blender’ or ‘scad’

Returns

union

Return type

a + (other meshes), **kwargs for a Trimesh