Sketch drawing: clicking a model vertex projects it into the sketch (linked point) and draws from it, as Fusion does ("vertex:x,y,z" point arguments)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
8c88fb8d2d
commit
13b72bb011
3 files changed
+19
-2
No files matched your search
@@ -40,6 +40,13 @@ pub fn refine_snap(
|
||||
let (a, b) = (proj.to_screen(plane.to_world(lp))?, proj.to_screen(plane.to_world(lp + Vec2::X))?);
|
||||
let px = 1.0 / (a.distance(b) as f64).max(1e-9);
|
||||
let tol = 7.0 * px;
|
||||
// A model vertex under the cursor: drawing on it projects it into the sketch.
|
||||
for h in pick(app, proj, a) {
|
||||
if let Hit::Vertex { point, .. } = h {
|
||||
SNAP.with(|s| *s.borrow_mut() = Some(("Pt", plane.to_local(point))));
|
||||
return Some((plane.to_local(point), Some(format!("vertex:{},{},{}", point.x, point.y, point.z))));
|
||||
}
|
||||
}
|
||||
let mut best: Option<(f64, &'static str, Vec2)> = None;
|
||||
let mut mid_of: Option<String> = None;
|
||||
for (i, c) in sk.curves.iter().enumerate() {
|
||||
|
||||
Reference in new issue
Block a user