pub fn rib_from_profile(
solid: &BrepSolid,
profile: &[NurbsCurve],
thickness: f64,
extrude_dir: Vec3,
plane_normal: Option<Vec3>,
extrusion: RibExtrusion,
name: Option<&str>,
) -> Result<BrepSolid, String>Expand description
Rib / stiffener (§6.6) — SolidWorks’ Rib, both extrusion directions, with its Up To Next end condition.
The chain is thickened by thickness and grown along extrude_dir until it
LANDS ON THE PART. Which axis carries which is RibExtrusion’s whole
purpose: ParallelToSketch offsets ±thickness/2 along the plane NORMAL and
sweeps the chain IN the plane; NormalToSketch offsets ±thickness/2 INSIDE
the plane (miter-joined, straight caps across the open ends) and sweeps that
ribbon along the plane normal.
§Up To Next
There is no depth. SolidWorks’ rib has exactly one end condition — the rib
develops until it meets the next faces and the feature FAILS if any part of it
meets nothing — and this reproduces it exactly rather than approximating it:
the chain is swept a generous reach (twice the part’s bounding diagonal, so
it certainly crosses the part), the sweep is CUT BY THE PART
(slab − solid), and the piece that grew out of the sketch is kept. Its
termination surface is therefore the part’s own faces, whatever shape they are.
A piece still running at reach never landed, and that is the documented
failure — not a silently truncated rib.
plane_normal is the profile’s own plane when the caller knows it (a sketch
publishes the plane it was drawn on). None falls back to deriving the plane
from the chain’s bends, which no single straight segment can supply.
V1 SCOPE: POLYLINE profiles only — arcs/curves return a clear Err.