Skip to main content

extrude

Function extrude 

Source
pub fn extrude(
    points: &[DVec2],
    triangles: &[[u32; 3]],
    loops: &[Range<usize>],
    direction: DVec3,
    depth: f64,
) -> Result<TriMesh, GeomError>
Expand description

Extrude a triangulated 2D profile along direction by depth.

The profile lies in the local z = 0 plane. Caps use the triangulation; sides are quads split into two triangles per boundary edge.

boundary lists the closed loops of the profile as index ranges into points: each loop is a contiguous run, matching profile::Rings layout.

An offset exactly in the profile plane (o.z == 0) bounds no volume and is refused as "extrusion direction in the profile plane"; with no tolerance here, a sliver just off the plane is built. extrude_profile refuses within its tolerance (see the module docs).