UI scenarios, batch 2: edit an early sketch from the timeline, components with a revolute joint driven to 90°, sheet metal base and edge flange to flat pattern and DXF, STEP export, new design and STEP insert with a hole on the imported face, parameters table drives the model, sketch constraints workflow (dimensions, delete and undo, fix, construction), rectangular pattern. Harness: widgets found by their text through the accessibility tree, file pickers answered from the scenario's folder, model renders at shot steps (SOLVECRAFT_SCENARIO_SHOTS), query/file checks; ui.at takes a dimension. Fix: a click on a sketch point under a dimension line (a diameter through the centre) selects the point; only the dimension's text takes precedence
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
717b181082
commit
187e9a97b9
13 files changed
+1115
-6
No files matched your search
@@ -65,6 +65,11 @@ fn seg_dist(p: Pos2, a: Pos2, b: Pos2) -> f32 {
|
||||
p.distance(a + ab * t)
|
||||
}
|
||||
|
||||
/// The dimension whose value text is under a screen position (its id).
|
||||
pub fn hit_text(pos: Pos2) -> Option<String> {
|
||||
DRAWN.with(|d| d.borrow().iter().find(|x| x.text.expand(2.0).contains(pos)).map(|x| x.id.clone()))
|
||||
}
|
||||
|
||||
/// The dimension under a screen position (its id).
|
||||
pub fn hit(pos: Pos2) -> Option<String> {
|
||||
DRAWN.with(|d| {
|
||||
@@ -88,6 +93,12 @@ pub fn selected(app: &SolveApp) -> Vec<String> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Where the dimension driven by parameter `param` (or with constraint id `param`) shows its
|
||||
/// value (screen), as drawn last frame.
|
||||
pub fn text_at(param: &str) -> Option<Pos2> {
|
||||
DRAWN.with(|d| d.borrow().iter().find(|x| x.param.as_deref() == Some(param) || x.id == param).map(|x| x.text.center()))
|
||||
}
|
||||
|
||||
/// Dimension text boxes drawn last frame (for box selection).
|
||||
pub fn text_rects() -> Vec<(String, Rect)> {
|
||||
DRAWN.with(|d| d.borrow().iter().map(|x| (x.id.clone(), x.text)).collect())
|
||||
|
||||
Reference in new issue
Block a user