Dragging sketch geometry snaps like Fusion: a dragged point (or a line dragged by its body, by its ends) snaps onto other points, line midpoints and curves, and letting go there adds the coincident, midpoint or point-on-curve constraint in the drag's undo step; it lines up horizontally and vertically with other points (dashed guides, no constraint). Snap distances in screen pixels; Ctrl or Alt held turns snapping off, also while drawing. Ring and Pt/Mid/On label on the snap. Scenario s42 (coincident and DOF, exact H alignment without a constraint, Ctrl-drag, undo, line body drag); ui.drag hold_end; synthetic drags keep their modifiers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-08 18:00:42 +00:00
1 parent b8d00aea13
commit 305c1c9a9b
8 files changed
+616 -7

No files matched your search

+2 -1
View File
@@ -56,7 +56,8 @@ scenarios!(
s36_sketch_palette_visible,
s32_cut_in_active_component,
s30_pattern_a_hole,
s41_type_value_after_picking
s41_type_value_after_picking,
s42_drag_snap
);
/// Scenarios written ahead of their fixes or features (the user's open bugs): run with
@@ -0,0 +1,282 @@
[
{
"note": "Dragging sketch geometry snaps like Fusion: onto a point (coincident on release), level with a point (a dashed guide, no constraint), not at all with Ctrl held; a line dragged by its body snaps by its ends."
},
{
"start": "SketchCreate"
},
{
"click": {
"plane": "XY"
}
},
{
"call": "engine.execute",
"params": {
"command": "DrawPolyline",
"params": {
"points": [
[
10,
10
],
[
30,
10
]
]
}
}
},
{
"call": "engine.execute",
"params": {
"command": "DrawPolyline",
"params": {
"points": [
[
10,
30
],
[
30,
40
]
]
}
}
},
{
"expect": {
"dof": 8
}
},
{
"note": "An end dropped near another end snaps onto it and becomes coincident."
},
{
"drag": [
{
"sketch": [
10,
30
]
},
{
"sketch": [
30.4,
10.3
]
}
],
"steps": 12
},
{
"expect": {
"dof": 6,
"query": {
"command": "sketch.inspect",
"path": [
"curves",
1,
"start_at"
],
"value": [
30.0,
10.0
]
}
}
},
{
"expect": {
"query": {
"command": "sketch.inspect",
"path": [
"constraints",
0,
"type"
],
"value": "coincident"
}
}
},
{
"note": "Level with l1's start: y snaps to 10 exactly, nothing is added."
},
{
"drag": [
{
"sketch": [
30,
40
]
},
{
"sketch": [
55,
10.4
]
}
],
"steps": 12
},
{
"expect": {
"dof": 6,
"query": {
"command": "sketch.inspect",
"path": [
"curves",
1,
"end_at",
1
],
"value": 10.0
}
}
},
{
"expect": {
"query": {
"command": "sketch.inspect",
"path": [
"constraints",
1
],
"value": null
}
}
},
{
"note": "Ctrl held: no snap (the end stays where it is let go)."
},
{
"drag": [
{
"sketch": [
55,
10
]
},
{
"sketch": [
10.3,
10.3
]
}
],
"steps": 12,
"ctrl": true
},
{
"expect": {
"dof": 6,
"query": {
"command": "sketch.inspect",
"path": [
"constraints",
1
],
"value": null
}
}
},
{
"key": "Z",
"cmd": true
},
{
"expect": {
"query": {
"command": "sketch.inspect",
"path": [
"curves",
1,
"end_at",
1
],
"value": 10.0
}
}
},
{
"note": "Undo takes the snap's constraint with the drag that made it."
},
{
"key": "Z",
"cmd": true
},
{
"key": "Z",
"cmd": true
},
{
"expect": {
"dof": 8,
"query": {
"command": "sketch.inspect",
"path": [
"constraints",
0
],
"value": null
}
}
},
{
"note": "A line dragged by its body: its start, brought near l1's start, snaps onto it (coincident)."
},
{
"call": "engine.execute",
"params": {
"command": "DrawPolyline",
"params": {
"points": [
[
40,
30
],
[
50,
30
]
]
}
}
},
{
"drag": [
{
"sketch": [
45,
30
]
},
{
"sketch": [
15.3,
10.3
]
}
],
"steps": 16
},
{
"expect": {
"dof": 10,
"query": {
"command": "sketch.inspect",
"path": [
"curves",
2,
"start_at"
],
"value": [
10.0,
10.0
]
}
}
}
]