mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-04 11:05:56 +00:00
kernel: a 3D sketch spline path takes the SMLib sweep only
On kernel-smlib/no-truck: sweep_point_path_with goes straight to SMLib's sweep (no truck branch), and PathSeg::flattened (truck's polyline of a path) takes no Cubic arm (the wildcard keeps the segment). (not built: base in progress) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt
This commit is contained in:
@@ -2393,12 +2393,6 @@ impl PathSeg {
|
||||
PathSeg::Curve { plane, seg } => {
|
||||
seg.polyline(1e-2).windows(2).map(|q| PathSeg::Line { a: plane.to_world(q[0]), b: plane.to_world(q[1]) }).collect()
|
||||
}
|
||||
PathSeg::Cubic { p } => std::iter::once(p[0])
|
||||
.chain(crate::point_path::cubic_polyline(&p, 1e-2))
|
||||
.collect::<Vec<_>>()
|
||||
.windows(2)
|
||||
.map(|q| PathSeg::Line { a: q[0], b: q[1] })
|
||||
.collect(),
|
||||
_ => vec![*s],
|
||||
})
|
||||
.collect()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Sweep paths through 3D sketch curves ([`PointPath`]): polylines (linked, projected and
|
||||
//! included curves, which reach the kernel as their points) and drawn 3D splines, which it gets
|
||||
//! as their fit points and so exactly ([`solidcraft_geom::catmull_rom`]). Truck sweeps the
|
||||
//! path's polyline ([`PointPath::points`]: the splines' samples); SMLib follows the path's
|
||||
//! segments ([`PointPath::segs`]), each spline span exactly as a [`PathSeg::Cubic`].
|
||||
//! as their fit points and so exactly ([`solidcraft_geom::catmull_rom`]). SMLib follows the
|
||||
//! path's segments ([`PointPath::segs`]), each spline span exactly as a [`PathSeg::Cubic`];
|
||||
//! [`PointPath::points`] is its polyline, for what takes points (rails, curve networks).
|
||||
|
||||
use solidcraft_geom::bspline::{ArcLength, CurveN};
|
||||
use solidcraft_geom::catmull_rom;
|
||||
@@ -114,14 +114,11 @@ impl PointPath {
|
||||
}
|
||||
}
|
||||
|
||||
/// [`crate::sweep_path_with`] along a path through 3D sketch curves. Truck sweeps the path's
|
||||
/// polyline ([`PointPath::points`]); SMLib follows its splines exactly and its polylines as lines.
|
||||
/// Sweep a planar region along a path through 3D sketch curves: its splines exactly, its
|
||||
/// polylines as lines (through SMLib).
|
||||
pub fn sweep_point_path_with(plane: &Plane, region: &Region2, path: &PointPath, ctl: &SweepControl) -> Result<Body> {
|
||||
ctl.check()?;
|
||||
if crate::backend()? == crate::Backend::Smlib {
|
||||
return crate::sweep_path::smlib_sweep_points(plane, region, path, ctl);
|
||||
}
|
||||
crate::sweep_path_with(plane, region, &path.points(), ctl)
|
||||
crate::sweep_path::smlib_sweep_points(plane, region, path, ctl)
|
||||
}
|
||||
|
||||
/// A cubic Bézier in space (a [`PathSeg::Cubic`]): its point at `x` (0…1).
|
||||
|
||||
Reference in New Issue
Block a user