Sketch Blend Curve (tangent control-point spline between two curve ends) and the Centerline line type (sketch.centerline: left out of profiles, drawn as an axis)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-07 22:55:34 +00:00
1 parent 2491c40fef
commit 6e20038906
8 files changed
+116 -12

No files matched your search

+1 -1
View File
@@ -286,7 +286,7 @@ impl Sketch {
LCurve::Conic(a, b, x, rho) => (CurveKind::Conic { a: point(self, a)?, b: point(self, b)?, apex: point(self, x)?, rho }, "k"),
};
let cid = self.fresh(prefix);
self.curves.push(Curve { id: cid, kind, construction: false, reversed: false, link: Some(id.to_string()) });
self.curves.push(Curve { id: cid, kind, construction: false, reversed: false, link: Some(id.to_string()), centerline: false });
}
for li in &lay.lone {
point(self, *li)?;
+8 -4
View File
@@ -136,6 +136,10 @@ pub struct Curve {
/// points are fixed and a linked circle keeps its radius.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub link: Option<String>,
/// Centerline line type: like construction (not part of profiles), drawn dash-dot; marks
/// an axis (revolve, diameter dimensions).
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub centerline: bool,
}
/// Geometric constraints and dimensions. Indices refer to `Sketch::points` (`p`, `q`) or
@@ -484,7 +488,7 @@ impl Sketch {
return Err(SketchError::Invalid("line needs two distinct points".into()));
}
let id = self.curve_id(id, "l")?;
self.curves.push(Curve { id, kind: CurveKind::Line { a, b }, construction: false, reversed: false, link: None });
self.curves.push(Curve { id, kind: CurveKind::Line { a, b }, construction: false, reversed: false, link: None, centerline: false });
Ok(self.curves.len() - 1)
}
@@ -513,7 +517,7 @@ impl Sketch {
Some(i) if i < self.points.len() => i,
_ => self.own_point(&id, "center", center)?,
};
self.curves.push(Curve { id, kind: CurveKind::Circle { c, r }, construction: false, reversed: false, link: None });
self.curves.push(Curve { id, kind: CurveKind::Circle { c, r }, construction: false, reversed: false, link: None, centerline: false });
Ok(self.curves.len() - 1)
}
@@ -539,7 +543,7 @@ impl Sketch {
Some(i) if i < n && i != a => i,
_ => self.own_point(&id, "end", p1)?,
};
self.curves.push(Curve { id, kind: CurveKind::Arc { c, a, b }, construction: false, reversed: false, link: None });
self.curves.push(Curve { id, kind: CurveKind::Arc { c, a, b }, construction: false, reversed: false, link: None, centerline: false });
Ok(self.curves.len() - 1)
}
@@ -715,7 +719,7 @@ impl Sketch {
}
};
let id = self.curve_id(id, prefix)?;
self.curves.push(Curve { id, kind, construction: false, reversed: false, link: None });
self.curves.push(Curve { id, kind, construction: false, reversed: false, link: None, centerline: false });
Ok(self.curves.len() - 1)
}
+1 -1
View File
@@ -107,7 +107,7 @@ pub fn find_profiles(sk: &Sketch) -> Vec<Profile> {
// Analytic shapes of the profile curves.
let mut shapes: Vec<(usize, Shape)> = Vec::new();
for (ci, c) in sk.curves.iter().enumerate() {
if c.construction {
if c.construction || c.centerline {
continue;
}
match c.kind {