Skip to main content

slice_tet

Function slice_tet 

Source
pub fn slice_tet(
    v0: Vec3,
    v1: Vec3,
    v2: Vec3,
    v3: Vec3,
    plane_origin: Vec3,
    plane_normal: Vec3,
) -> CellSliceResult
Expand description

Computes the intersection of a tetrahedron with a slice plane.

Returns the intersection polygon vertices and interpolation data for computing attribute values at intersection points.

§Arguments

  • v0, v1, v2, v3 - Tetrahedron vertex positions
  • plane_origin - A point on the plane
  • plane_normal - The plane normal (points toward kept geometry)

§Returns

A CellSliceResult containing 0, 3, or 4 vertices depending on the intersection.