Skip to main content

Module slicing

Module slicing 

Source
Expand description

Slicing triangle meshes with planes into contours.

Each triangle crossing the plane contributes one segment (triangle_plane); the segments are then chained end to end into polylines, closed where the cut goes all the way round. This is the core of layer-by-layer slicing for 3D printing and of cross-section views.

See the book entry Triangle meshes: smoothing, decimation and slicing.

Structs§

Contour
A chain of points where a plane cuts a mesh.

Functions§

slice_mesh
Slices the triangle mesh with the plane through plane_point with normal, returning the cut as contours. tol is the distance within which vertices count as on the plane and cut endpoints count as coincident; choose it relative to the mesh size (e.g. 1e-9 * extent).
slice_mesh_levels
Slices the mesh at each of levels along a coordinate axis (0 = x, 1 = y, 2 = z), returning (level, contours) for every level, in the order given.