Skip to main content

make_faceted_solid

Function make_faceted_solid 

Source
pub fn make_faceted_solid(
    model: &mut Model,
    points: &[Point],
    rings: &[Vec<usize>],
    planes: &[Option<Plane>],
    tol: Tolerances,
) -> OgeomResult<(Built, Vec<Shape>)>
Expand description

A solid from planar rings over shared points, each ring already wound counter-clockwise seen from outside, and its faces in the rings’ order.

Unlike make_polyhedron the solid need not be convex: the winding is the caller’s, and is checked rather than judged. A ring given a plane in planes (by index; missing or None for none) is built on that plane where its normal faces the way the ring does, so a face rebuilt from one keeps its surface and its chart. Every edge lies on a line running on past its ends, so a later operation may carry it on. Every ring must be planar and name at least three distinct points, every edge (a pair of consecutive points on a ring) must be walked once each way by exactly two rings, and the rings must enclose a volume.

§Errors

OgeomError::Construction if a point is not finite, a ring is short, names a point out of range or repeats one in turn, a ring is not planar, an edge is not walked once each way, or the rings enclose no volume.