fix(spline): honour end tangents on a two-fit-point spline
fit_spline_polyline bailed to a straight chord below three fit points, ignoring the stored begin/end tangents — a short tangent-clamped spline rendered as a line. The C² solver handles n=2 as-is (both end rows are clamp or natural conditions), so only the guard drops to n<2; tangentless two-point splines still solve to the straight chord. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
22a7c4490c
commit
48e8988528
1 changed files with 1 additions and 2 deletions
|
|
@ -200,8 +200,7 @@ fn catmull_rom_polyline(pts: &[acadrust::types::Vector3], closed: bool) -> Vec<[
|
|||
fn fit_spline_polyline(spl: &Spline) -> Vec<[f64; 3]> {
|
||||
let p: Vec<[f64; 3]> = spl.fit_points.iter().map(|q| [q.x, q.y, q.z]).collect();
|
||||
let n = p.len();
|
||||
if n < 3 {
|
||||
// A single segment can't be C²-fit; a straight chord is the honest draw.
|
||||
if n < 2 {
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue