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:
Hakan Seven committed 2026-08-20 00:18:45 +03:00
commit 1c408e3a73
16 files changed
+929 -355

No files matched your search

+6 -6
View File
@@ -287,12 +287,12 @@ pub fn polyline2d_curve(polyline: &Polyline2D) -> Option<PlanarCurve> {
/// plane the normal describes. A spline that genuinely wanders in space gets
/// `None`, which is honest: flattening it to XY would move it.
pub fn spline_curve(spline: &SplineEnt) -> Option<PlanarCurve> {
let points: Vec<Vector3> = spline
.control_points
.iter()
.chain(spline.fit_points.iter())
.copied()
.collect();
let source = if crate::entities::spline::uses_fit_method(spline) {
&spline.fit_points
} else {
&spline.control_points
};
let points: Vec<Vector3> = source.to_vec();
let first = points.first()?;
let normal = normalized(spline.normal);
let elevation = Vec3::from(xyz(*first)).dot(Vec3::from(xyz(normal)));