Kernel rig: bend table cases, JSON and CSV rows with angles, radii and K-factor allowances, and an unknown format 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 c114e6c35b
commit 67dd8892f1
6 changed files with 292 additions and 0 deletions
@@ -0,0 +1,40 @@
{
"sources": [],
"what": "sheet.export_bend_table as CSV of an 80 x 40 x 2 base with a 60 degree flange on one long edge and a hem on the other",
"source": "analytic",
"method": "T = 2, K = 0.5. Bend 1, the flange: 60 degrees up (included 120), R 2, BA = (pi/3)(2 + 1) = 3.141592654, 80 long. Bend 2, the hem on the top edge: 180 degrees down (included 0), its radius the rule's hem gap 0.01, BA = pi(0.01 + 1) = 3.173008580, 80 long",
"body_count": 1,
"files": [
{
"path": "bends.csv",
"csv": [
{
"body": "Body1",
"rule": "Steel 2",
"thickness_mm": 2.0,
"k_factor": 0.5,
"bend": 1,
"angle_deg": 60.0,
"direction": "up",
"radius_mm": 2.0,
"allowance_mm": 3.141592653589793,
"length_mm": 80.0,
"included_angle_deg": 120.0
},
{
"body": "Body1",
"rule": "Steel 2",
"thickness_mm": 2.0,
"k_factor": 0.5,
"bend": 2,
"angle_deg": 180.0,
"direction": "down",
"radius_mm": 0.01,
"allowance_mm": 3.173008580125691,
"length_mm": 80.0,
"included_angle_deg": 0.0
}
]
}
]
}
@@ -0,0 +1,79 @@
{
"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,
"angle": "60 deg"
}
},
{
"command": "sheet.hem",
"params": {
"edges": [
[
40,
40,
2
]
],
"length": 8
}
},
{
"command": "sheet.export_bend_table",
"params": {
"path": "$OUT/bends.csv"
}
}
]
}
@@ -0,0 +1,33 @@
{
"sources": [],
"what": "sheet.export_bend_table as JSON of an 80 x 40 x 2 base with one 90 degree flange 20 high",
"source": "analytic",
"method": "the rule: T = 2, K = 0.5, R = 2. One bend: 90 degrees (included 180 - 90 = 90), up, radius 2, allowance BA = theta(R + K*T) = (pi/2)(2 + 1) = 4.712388980, as long as the edge, 80; flat 80 x 56.712389 x 2",
"body_count": 1,
"files": [
{
"path": "bends.json",
"json": {
"rule": "Steel 2",
"thickness": 2.0,
"k_factor": 0.5,
"flat_size_mm": [
80.0,
56.71238898038469,
2.0
],
"bends": [
{
"bend": 1,
"angle_deg": 90.0,
"included_angle_deg": 90.0,
"radius": 2.0,
"direction": "up",
"allowance": 4.71238898038469,
"length": 80.0
}
]
}
}
]
}
@@ -0,0 +1,66 @@
{
"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": "sheet.export_bend_table",
"params": {
"format": "json",
"path": "$OUT/bends.json"
}
}
]
}
@@ -0,0 +1,8 @@
{
"sources": [],
"what": "sheet.export_bend_table asked for a format it does not write (xlsx)",
"source": "invariants",
"method": "the table is written as csv or json only: any other format is refused, naming the two",
"outcome": "refused",
"refusal": "`format` must be csv or json"
}
@@ -0,0 +1,66 @@
{
"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": "sheet.export_bend_table",
"params": {
"format": "xlsx",
"path": "$OUT/bends.xlsx"
}
}
]
}