Skip to main content

vitem_normal_from_points

Function vitem_normal_from_points 

Source
pub fn vitem_normal_from_points(points: &[Vec4]) -> Vec3
Available on crate feature render only.
Expand description

Compute a normal vector from the ordered VPoints of a RenderVItem.

The primary path uses the 3D equivalent of the shoelace formula on anchor points. If the accumulated area is degenerate (for example, a single curved segment), all VPoints are scanned for a non-collinear triple. A collinear item uses a deterministic plane containing its line, while an item whose points all coincide falls back to the Z axis.