Kernel rig: flat DXF cases, outline, cut and bend line lengths, an ellipse exact and as arcs, and no sheet refused

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-29 16:52:54 -04:00
committed by Irakli Kourtis
parent fce8e4a262
commit c114e6c35b
8 changed files with 367 additions and 0 deletions
@@ -0,0 +1,23 @@
{
"sources": [],
"what": "sheet.export_dxf with curves: arcs of a 100 x 60 x 2 plate with a 20 x 12 elliptical cut-out: the ellipse becomes tangent arcs",
"source": "analytic",
"method": "curves: arcs writes the ellipse as tangent arcs and lines within 0.001 mm, for machines that read only those: on layer CUT no ELLIPSE and no SPLINE, and their length is the ellipse's perimeter 51.053998 (within 0.001 mm of the curve, the length to 1e-3 relative)",
"body_count": 1,
"files": [
{
"path": "flat.dxf",
"dxf": {
"CUT": {
"ELLIPSE": 0,
"SPLINE": 0,
"length_mm": 51.053997725577524
},
"OUTLINE": {
"LINE": 4,
"length_mm": 320.0
}
}
}
]
}
@@ -0,0 +1,86 @@
{
"commands": [
{
"command": "sheet.manage_rules",
"params": {
"name": "Steel 2",
"thickness": "2 mm",
"active": true,
"bend_radius": "2 mm",
"k_factor": 0.5
}
},
{
"command": "sketch.create",
"params": {
"plane": "XY",
"name": "Base"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
100,
60
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "sheet.flange",
"params": {
"type": "base",
"sketch": "Base"
}
},
{
"command": "sketch.create",
"params": {
"plane": "XY",
"name": "Ellipse"
}
},
{
"command": "sketch.ellipse",
"params": {
"center": [
50,
30
],
"major": [
60,
30
],
"minor_radius": 6
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "solid.extrude",
"params": {
"sketch": "Ellipse",
"through_all": true,
"direction": "symmetric",
"operation": "cut"
}
},
{
"command": "sheet.export_dxf",
"params": {
"path": "$OUT/flat.dxf",
"curves": "arcs"
}
}
]
}
@@ -0,0 +1,25 @@
{
"sources": [],
"what": "sheet.export_dxf of a 100 x 60 x 2 plate with a 20 x 12 elliptical cut-out, curves exact (the default): the cut-out is one ELLIPSE",
"source": "analytic",
"method": "the cut-out is an ellipse, semi-axes 10 and 6: written exactly, one ELLIPSE on layer CUT, no arcs or splines; its perimeter (Ramanujan's second formula, exact to 1e-9 here) 51.053998. OUTLINE: 4 lines, 320 long",
"body_count": 1,
"volume_mm3": 11623.008881569225,
"files": [
{
"path": "flat.dxf",
"dxf": {
"CUT": {
"ELLIPSE": 1,
"ARC": 0,
"SPLINE": 0,
"length_mm": 51.053997725577524
},
"OUTLINE": {
"LINE": 4,
"length_mm": 320.0
}
}
}
]
}
@@ -0,0 +1,85 @@
{
"commands": [
{
"command": "sheet.manage_rules",
"params": {
"name": "Steel 2",
"thickness": "2 mm",
"active": true,
"bend_radius": "2 mm",
"k_factor": 0.5
}
},
{
"command": "sketch.create",
"params": {
"plane": "XY",
"name": "Base"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
100,
60
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "sheet.flange",
"params": {
"type": "base",
"sketch": "Base"
}
},
{
"command": "sketch.create",
"params": {
"plane": "XY",
"name": "Ellipse"
}
},
{
"command": "sketch.ellipse",
"params": {
"center": [
50,
30
],
"major": [
60,
30
],
"minor_radius": 6
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "solid.extrude",
"params": {
"sketch": "Ellipse",
"through_all": true,
"direction": "symmetric",
"operation": "cut"
}
},
{
"command": "sheet.export_dxf",
"params": {
"path": "$OUT/flat.dxf"
}
}
]
}
@@ -0,0 +1,41 @@
{
"sources": [],
"what": "sheet.export_dxf of an 80 x 40 x 2 base with a 20 mm flange on its y = 0 edge and a 10 mm hole: outline, cut and bend line",
"source": "analytic",
"method": "T = 2, R = 2, K = 0.5: flat = base 80 x (40 - 4) + bend zone BA = (pi/2)(R + K*T) = 4.712389 + leg 20 - 4 = 16: 80 x 56.712389. OUTLINE: its 4 sides (each may be split where the zone meets the panels: 4 to 8 lines), length 2*(80 + 56.712389); CUT: the hole, 1 circle, length 10*pi; BEND_UP: the flange's bend line (it bends up), 80 long; no BEND_DOWN, no arcs",
"body_count": 1,
"results": [
{
"step": 8,
"json": {
"bends": 1
}
}
],
"files": [
{
"path": "flat.dxf",
"dxf": {
"OUTLINE": {
"LINE": [
4,
8
],
"ARC": 0,
"length_mm": 273.42477796076935
},
"CUT": {
"CIRCLE": 1,
"length_mm": 31.41592653589793
},
"BEND_UP": {
"length_mm": 80.0
},
"BEND_DOWN": {
"LINE": 0,
"LWPOLYLINE": 0
}
}
}
]
}
@@ -0,0 +1,81 @@
{
"commands": [
{
"command": "sheet.manage_rules",
"params": {
"name": "Steel 2",
"thickness": "2 mm",
"active": true,
"bend_radius": "2 mm",
"k_factor": 0.5
}
},
{
"command": "sketch.create",
"params": {
"plane": "XY",
"name": "Base"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
80,
40
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "sheet.flange",
"params": {
"type": "base",
"sketch": "Base"
}
},
{
"command": "sheet.flange",
"params": {
"type": "edge",
"edges": [
[
40,
0,
2
]
],
"height": 20
}
},
{
"command": "solid.hole",
"params": {
"position": [
40,
25,
0
],
"direction": [
0,
0,
1
],
"diameter": 10
}
},
{
"command": "sheet.export_dxf",
"params": {
"path": "$OUT/flat.dxf"
}
}
]
}
@@ -0,0 +1,8 @@
{
"sources": [],
"what": "sheet.export_dxf in a design with a box and no sheet metal body",
"source": "invariants",
"method": "there is no flat pattern to write: a clean refusal that says how to start a sheet",
"outcome": "refused",
"refusal": "there is no sheet metal body"
}
@@ -0,0 +1,18 @@
{
"commands": [
{
"command": "solid.box",
"params": {
"length": 20,
"width": 10,
"height": 2
}
},
{
"command": "sheet.export_dxf",
"params": {
"path": "$OUT/flat.dxf"
}
}
]
}