trimesh_slice

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

Slice a mesh by a list of planes.

Parameters
  • mesh (tuple of vertices and faces) – The mesh to slice.

  • planes (list of (point, normal) tuples or compas.geometry.Plane) – The slicing planes.

Returns

list of arrays – 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)