Skip to main content

sweep_profile_twisted_scaled

Function sweep_profile_twisted_scaled 

Source
pub fn sweep_profile_twisted_scaled(
    profile: &[NurbsCurve],
    path: &NurbsCurve,
    twist_angle: f64,
    end_scale: f64,
    name: Option<&str>,
) -> Result<BrepSolid, KernelRefusal>
Expand description

Twisted path sweep with a SCALING LAW: sweep_profile_twisted, with the section also scaled about its anchor origin (the profile’s centroid, which the sweep lands on the path) linearly in the same sampled arc-length fraction as the twist, from 1 at the start to end_scale at the end.

So a square drawn at the foot of a straight path, swept with twist_angle and end_scale, is the column whose section at fraction f of the way is that square scaled by 1 + (end_scale − 1)·f and turned by twist_angle·f: its corners run along conical spirals and each wall is the twisted RULED surface its side sweeps. Like every station sweep the wall is lofted through sampled sections, at TWICE the twisted builder’s station density (32 per quarter turn, floored at 64, so at most 8 turns under the 1024 cap): the tapering column of the brep-bench case (half a turn, a third the size at the top) read 1.2e-7 relative in volume at 32 stations and holds 1e-7 with margin at 64, the Δφ⁴ law of the cubic interpolation.

With end_scale == 1.0 it places the same sections sweep_profile_twisted does (each axis multiplied by exactly 1). A non-positive or non-finite scale is refused, and so is every twist the twisted sweep refuses.