slice_mesh_planes

compas_cgal.slicer.slice_mesh_planes(mesh, planes)

Slice a mesh by a list of planes.

Parameters:
meshcompas_cgal.types.VerticesFaces

The mesh to slice.

planescompas_cgal.types.Planes

The slicing planes.

Returns:
compas_cgal.types.PolylinesNumpy

A list of slice polylines, with each polyline an array of points.

Examples

>>> from compas.geometry import Sphere, Plane, Polyline
>>> from compas.utilities import linspace
>>> from compas_cgal.slicer import slice_mesh
>>> sphere = Sphere(1.0, point=[0, 0, 1.0])
>>> mesh = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
>>> planes = [Plane([0, 0, z], [0, 0, 1.0]) for z in linspace(0.1, 1.9, 19)]
>>> result = slice_mesh(mesh, planes)
>>> polylines = [Polyline(points) for points in result]