Skip to main content

sweep_profile_along_path

Function sweep_profile_along_path 

Source
pub fn sweep_profile_along_path(
    profile: &[NurbsCurve],
    path: &NurbsCurve,
    name: Option<&str>,
) -> Result<BrepSolid, String>
Expand description

Sweep a CLOSED PLANAR profile loop along a path curve (§3.3/§5.7), TRANSPLANTING the profile onto the path — see SectionPlacement for the other reading, and for why the choice changes the solid.

Reuses the loft builder rather than a bespoke swept surface: the path is sampled at STATIONS uniform stations, a rotation-minimizing frame is propagated along it (double-reflection RMF, Wang et al. 2008 — the frame does NOT spin at inflections the way raw Frenet does), a rigidly transformed copy of the profile is placed at each station (identical degree/knots/weights, only the control points moved — which guarantees loft’s per-section compatibility), and the stations are lofted through to produce the tube plus planar end caps.

Guards return a clear Err on an open/non-planar profile, a degenerate path tangent, or a loft failure. A self-intersecting result (path curvature radius smaller than the profile extent) is OUT OF SCOPE — the caller is responsible for keeping the tube from folding onto itself.