trimesh_slice

compas_rhino.geometry.trimesh.trimesh_slice(mesh, planes)[source]

Slice a mesh by a list of planes.

Parameters
  • mesh (tuple[sequence[[float, float, float] | Point], sequence[[int, int, int]]]) – The mesh to slice.

  • planes (sequence[[point, vector] | Plane]) – The slicing planes.

Returns

list[list[[float, float, float]]] – The points defining the slice polylines.

Examples

>>> from compas.geometry import Sphere, Plane, Point, Vector
>>> sphere = Sphere([1, 1, 1], 1)
>>> sphere = sphere.to_vertices_and_faces(u=30, v=30)
>>> P1 = Plane(Point(0, 0, 0), Vector(0, -1, 0))
>>> P2 = Plane(Point(0, 0, 0), Vector(0.87, -0.5, 0))
>>> planes = [P1, P2]
>>> points = trimesh_slice(sphere, planes)