diff --git a/crates/doc/src/eval.rs b/crates/doc/src/eval.rs
index e833e3322..3f04d342c 100644
--- a/crates/doc/src/eval.rs
+++ b/crates/doc/src/eval.rs
@@ -5700,12 +5700,13 @@ fn feature_tools_with_constructor(
Some(_) => Vec::new(),
None => path_segments(ps, path, start)?,
};
- let path_start = points.as_ref().and_then(|p| p.first().copied()).or_else(|| segs.first().map(kernel::PathSeg::start)).unwrap_or(start);
+ let path_start =
+ points.as_ref().and_then(|p| p.points().first().copied()).or_else(|| segs.first().map(kernel::PathSeg::start)).unwrap_or(start);
let rails = rail_polylines(doc, st, rails, f.component, path_start)?;
let ctl = sweep_control(vals, orientation, twist, scale, rails, *rail_fit)?;
- // A path through 3D sketch curves follows them as points.
- if let Some(pts) = points {
- return regions.iter().map(|r| Ok(tool(r, kernel::sweep_path_with(&ss.plane, r, &pts, &ctl)?))).collect();
+ // A path through 3D sketch curves: its drawn splines exactly, the rest as points.
+ if let Some(path) = points {
+ return regions.iter().map(|r| Ok(tool(r, kernel::sweep_point_path_with(&ss.plane, r, &path, &ctl)?))).collect();
}
regions.iter().map(|r| Ok(tool(r, kernel::sweep_with(&ss.plane, r, &segs, &ctl)?))).collect()
}
@@ -5718,11 +5719,17 @@ fn feature_tools_with_constructor(
if !(r > 1e-6) {
return Err(DocError::Invalid("pipe diameter must be positive".into()));
}
- if let Some(pts) = path_points(ps, path, Vec3::new(f64::NAN, f64::NAN, f64::NAN))? {
+ if let Some(along) = path_points(ps, path, Vec3::new(f64::NAN, f64::NAN, f64::NAN))? {
+ let pts = along.points();
let (Some(a), Some(b)) = (pts.first().copied(), pts.get(1).copied()) else { return Err(DocError::Invalid("empty path".into())) };
let t = (b - a).normalized().ok_or_else(|| DocError::Invalid("path direction".into()))?;
let plane = Plane::from_normal(a, t).ok_or_else(|| DocError::Invalid("pipe profile plane".into()))?;
- return Ok(unnamed(vec![kernel::sweep_path(&plane, &pipe_region(vals, r, wall)?, &pts)?]));
+ return Ok(unnamed(vec![kernel::sweep_point_path_with(
+ &plane,
+ &pipe_region(vals, r, wall)?,
+ &along,
+ &kernel::SweepControl::default(),
+ )?]));
}
let segs = path_segments(ps, path, Vec3::new(f64::NAN, f64::NAN, f64::NAN))?;
let first = segs.first().ok_or_else(|| DocError::Invalid("empty path".into()))?;
@@ -5814,7 +5821,7 @@ pub(crate) fn rail_polylines(doc: &Document, st: &ModelState, rails: &[crate::Sw
let mapped = path_in_frame(doc, rs, consumer)?;
let rs = mapped.as_ref();
match path_points(rs, &rail.curves, start)? {
- Some(pts) => Ok(pts),
+ Some(path) => Ok(path.points()),
None => Ok(kernel::path_polyline(&path_segments(rs, &rail.curves, start)?)?),
}
})
@@ -5900,20 +5907,24 @@ fn path_in_frame<'a>(doc: &Document, sketch: &'a SolvedSketch, consumer: u64) ->
Ok(Cow::Owned(mapped))
}
-/// A path that uses 3D sketch curves (wires), as one chain of world points from the end nearest
-/// `start` (no start: the first curve runs toward the second). `None` when the path is all
-/// planar curves.
-fn path_points(ps: &SolvedSketch, ids: &[String], start: Vec3) -> Result