forked from 1b-agent/opencadstudio-upstream
feat(spline): improve fit and CV editing
Keep planar conversions kernel-backed and leave unsupported 3D, CV-to-fit, and closed rebuilds unavailable instead of changing curve data.\n\nRefs #815
This commit is contained in:
commit
1c408e3a73
16 files changed
+929
-355
No files matched your search
@@ -96,15 +96,18 @@ fn spline_to_nurbs_with(
|
||||
let flat = vector(v);
|
||||
(flat[0] * flat[0] + flat[1] * flat[1] > 1e-18).then_some(flat)
|
||||
};
|
||||
let start_tangent = tangent(&spl.begin_tangent);
|
||||
let end_tangent = tangent(&spl.end_tangent);
|
||||
let parameterization = match spl.knot_parameterization {
|
||||
2 => Parameterization::Uniform,
|
||||
1 => Parameterization::Centripetal,
|
||||
_ => Parameterization::Chord,
|
||||
};
|
||||
NurbsCurve::interpolate(
|
||||
&fit,
|
||||
tangent(&spl.begin_tangent),
|
||||
tangent(&spl.end_tangent),
|
||||
match spl.knot_parameterization {
|
||||
2 => Parameterization::Uniform,
|
||||
1 => Parameterization::Centripetal,
|
||||
_ => Parameterization::Chord,
|
||||
},
|
||||
start_tangent,
|
||||
end_tangent,
|
||||
parameterization,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user