Files
OneCAD/crates/ui-egui/tests/scenarios/s22_sheet_metal_fold.json
T
NOWN-DEVandClaude Opus 5.5 af0440aaab feat: sketches on a sheet metal face attach to its panel (#474)
A sketch on a flat face of a sheet metal body was refused ("this face has no exact planar
source"), so the only way was a plane frozen in space. When the sheet changes (a flange's
angle, the thickness), the frozen sketch stays behind: a cut from it fails on the slanted
flange or leaves a blind pocket in the thicker sheet.

`sketch.create` with a face of a sheet metal body now attaches the sketch to the panel the
face belongs to. It keeps the face's name, `sheet:<body>:<panel>:<top|bottom>` (the panel is
the base or a flange's feature tag), and takes the panel's exact plane from its flat region
and fold each time the model is evaluated, so the sketch follows the sheet through parameter
changes, unfold and refold. Its coordinates are the flat pattern's (the bottom face's y
mirrored). A face that is gone is reported as a lost attachment, never replaced by the
nearest face. The attachment follows a renamed or copied body, shows as `sheet_face` in the
command result and as its own status in Redefine Sketch Plane. `fixed: true` still freezes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:36:58 -04:00

166 lines
1.9 KiB
JSON

[
{
"note": "Target: sheet metal plate folded along a sketch line (sheet.fold, solidcraft-params; dialog by solidcraft-dialogs). Adjust the dialog steps when it lands."
},
{
"call": "ui.set",
"params": {
"tab": "SHEET METAL"
}
},
{
"start": "sketch.create"
},
{
"click": {
"plane": "XY"
}
},
{
"start": "sketch.rectangle.two_point"
},
{
"click": {
"sketch": [
0,
0
]
}
},
{
"click": {
"sketch": [
60,
40
]
}
},
{
"key": "Escape"
},
{
"start": "sketch.finish"
},
{
"call": "ui.view",
"params": {
"view": "iso"
}
},
{
"start": "sheet.flange"
},
{
"click": {
"world": [
30,
20,
0
]
}
},
{
"key": "Enter"
},
{
"expect": {
"bodies": 1,
"volume": 6000
}
},
{
"start": "sketch.create"
},
{
"click": {
"world": [
30,
20,
2.5
]
}
},
{
"note": "A flat face of a sheet attaches the sketch to its panel (by name), in the flat pattern's coordinates."
},
{
"expect": {
"sketching": true,
"query": {
"command": "sketch.inspect",
"path": ["plane", "origin", 2],
"value": 2.5
}
}
},
{
"start": "sketch.line"
},
{
"click": {
"sketch": [
40,
-5
]
}
},
{
"click": {
"sketch": [
40,
45
]
}
},
{
"key": "Escape"
},
{
"key": "Escape"
},
{
"start": "sketch.finish"
},
{
"start": "sheet.fold"
},
{
"click": {
"world": [
40,
20,
2.5
]
}
},
{
"key": "Enter"
},
{
"expect": {
"bodies": 1,
"errors": 0,
"dialog": null,
"volume": [
6023.5,
0.001
]
},
"note": "the bend keeps the neutral layer (K 0.44): the bend zone holds \u03b8\u00b7T\u00b7(T/2 \u2212 K\u00b7T)\u00b7w = 23.6 mm\u00b3 more than the flat strip it replaces"
},
{
"shot": "s22_folded"
},
{
"start": "sheet.flat_pattern"
},
{
"widget": "Export DXF\u2026"
},
{
"expect": {
"file": "Untitled-Body1.dxf"
}
}
]