From 428237563ace6dd27a49f512691cc0d107ee7fc5 Mon Sep 17 00:00:00 2001 From: bherbruck Date: Thu, 8 Oct 2026 00:55:53 +0000 Subject: [PATCH] Hole: depth arrow into the material (drag sets the depth; empty is through all) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL --- crates/ui-egui/src/canvas.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 582fd8ce..8039a8e4 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -37,7 +37,7 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option)> { _ => return None, }; Some(match d.kind { - Kind::Extrude { .. } | Kind::Fillet { .. } | Kind::Section { .. } => (at, normal), + Kind::Extrude { .. } | Kind::Fillet { .. } | Kind::Section { .. } | Kind::Hole { .. } => (at, normal), // Shell thickness grows into the body. Kind::Shell { .. } => (at, normal.map(|n| -n)), Kind::Move { .. } => (at, Some(Vec3::Z)), @@ -132,6 +132,14 @@ fn draw(app: &SolveApp, ui: &mut egui::Ui, painter: &egui::Painter, proj: &Proj, { drag_arrow(ui, painter, proj, base, bs, -n, l2, false, egui::Id::new("sc_manipulator2"), half_height, distance2); } + // Holes: the depth arrow points into the material (empty depth: through all); the + // diameter is typed in the box. + let mut dir = dir; + if let (Kind::Hole { depth, .. }, Some(n)) = (&mut d.kind, dir) { + let l = app.session.doc.eval(depth, ValueKind::Length).ok().filter(|v| v.is_finite()).unwrap_or(0.0); + drag_arrow(ui, painter, proj, base, bs, -n, l, false, egui::Id::new("sc_manipulator_depth"), half_height, depth); + dir = None; + } let Some((label, kind, value)) = d.primary() else { return }; let len = app.session.doc.eval(value, kind).ok().filter(|v| v.is_finite()); let mut box_at = bs + vec2(16.0, -30.0);