Coil dialog; value box for curve-based dialogs (pipe, rib, path pattern) at the picked curve

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-08 02:05:07 +00:00
1 parent 83438eeaab
commit 950fa39b0f
2 files changed
+14

No files matched your search

+5
View File
@@ -29,6 +29,11 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {
Sel::Face { body, index, point } => (*point, crate::dialogs::planar_face(&app.session, body, *index).map(|(_, n)| n)),
Sel::Edge { body, index, point } => (*point, st.body(body).and_then(|b| edge_bisector(&b.mesh(), *index, *point))),
Sel::Vertex { point, .. } => (*point, None),
Sel::SketchCurve { id } => {
let ss = st.sketches.iter().rev().find(|ss| ss.sketch.curve_index(id).is_some())?;
let pts = ss.sketch.polyline(ss.sketch.curve_index(id)?);
(ss.plane.to_world(*pts.get(pts.len() / 2)?), None)
}
Sel::Body { name } => (st.body(name)?.mesh().bounds().center(), None),
Sel::Plane { name } => {
let pl = solvecraft_engine::geom::Plane::named(name).or_else(|| {
+9
View File
@@ -350,6 +350,14 @@ impl Dialog {
Kind::Primitive { cmd: "PrimitiveTorus", fields: vec![("major", "20".into()), ("minor", "5".into())], operation: 0 },
vec![],
),
"PrimitiveCoil" => Dialog::new(
Kind::Primitive {
cmd: "PrimitiveCoil",
fields: vec![("diameter", "40".into()), ("revolutions", "4".into()), ("pitch", "8".into()), ("section_size", "3".into())],
operation: 0,
},
vec![],
),
"FusionCombineCommand" => Dialog::new(
Kind::Combine { operation: 1, keep_tools: false },
vec![SelInput::new("Target body", BODIES, false), SelInput::new("Tool bodies", BODIES, true)],
@@ -647,6 +655,7 @@ fn title(k: &Kind) -> &'static str {
"PrimitiveBox" => "BOX",
"PrimitiveCylinder" => "CYLINDER",
"PrimitiveSphere" => "SPHERE",
"PrimitiveCoil" => "COIL",
_ => "TORUS",
},
Kind::Combine { .. } => "COMBINE",