Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Sketch on a face: Look At centres on the picked point instead of the plane's origin (a corner of the face), which left the face filling the view off-centre like a big grey square

bherbruck288bdf7f0f25
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index 1328465725..d986273db4 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -1671,6 +1671,14 @@ pub fn start_sketch(app: &mut SolveApp, sel: &Sel) {
if app.run("SketchCreate", json!({ "plane": plane })).is_ok() {
app.pre_sketch_cam = Some(before);
look_at_sketch(app);
+ // On a face: look at the picked point, not the plane's origin (a corner of the face),
+ // which left the face filling the view off-centre like a big square.
+ if let Sel::Face { point, .. } = sel
+ && let Some(mut to) = app.cam_anim.as_ref().map(|a| a.to)
+ {
+ to.target = *point;
+ app.animate_to(to);
+ }
}
}