Skip to main content

extrude_profile_brep_draft

Function extrude_profile_brep_draft 

Source
pub fn extrude_profile_brep_draft(
    profile: &[NurbsCurve],
    direction: Vec3,
    distance: f64,
    draft_angle_rad: f64,
    name: Option<&str>,
) -> Result<BrepSolid, String>
Expand description

Straight extrude of a LINE/ARC profile loop with a draft (taper) angle, built DIRECTLY as a BREP: every wall is the EXACT drafted surface of its segment — a tilted plane for a line, a cone patch (rational ruled surface between the source arc and its concentric offset, over one shared angular window) for a circular arc — and every junction edge is the EXACT intersection curve of the two adjacent walls. Because all drafted walls shrink linearly at the same rate, any two of them intersect in a straight line (plane∧plane, or a tangent-junction ruling) or a CONIC (plane∧cone and cone∧cone both reduce to a plane section of a cone — the z² terms of the squared implicits cancel), so the junction edges are exact rational quadratics: no lofted approximation anywhere.

Positive draft_angle_rad tapers the section INWARD with height (smaller far cap); negative widens it; 0 reproduces a straight prism. The far section is the exact in-plane miter offset of the profile by d = distance·tan(draft): line segments re-intersect at their offset corners, arcs shrink/grow concentrically, and mixed junctions re-join at the offset primitives’ intersection. An offset that exceeds the local feature size (a collapsed arc, offsets that no longer meet) is a clear Err. Face order: [walls in INPUT curve order…, START cap (profile plane), END cap (offset section at +distance)] — the naming contract callers stamp on.