Kernel rig: thicken a sheet into a slab and a tube, trim by a plane and by a circle, and refuse a stray keep_with

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-29 17:03:27 -04:00
committed by Irakli Kourtis
parent 75353cb042
commit b8c6bb9214
11 changed files with 505 additions and 0 deletions
@@ -4,3 +4,4 @@
# line in the same pull request.
# Baseline: rig-cases-surfaces 45f69c0e5 with SMLib 60b1c6a, aarch64 Linux.
cov-fair-single-span-face-has-nothing-free-to-move surface.fair refuses a face of degree 1 one way ("a fairness term does not fit the net's degrees"): kernel/src/fair.rs checks its second-derivative terms against the net's degrees instead of fairing only the direction that has them
cov-thicken-cylinder-sheet-symmetric-tube the tube's two flat end rings come back as B-spline faces, not planes (surface_types bspline, cylinder): volume, faces and box are right; the exact plane is lost in SMLib's thicken or in its record conversion
@@ -0,0 +1,25 @@
{
"sources": [],
"what": "a cylinder wall r 10, 20 high, thickened 2 symmetric: a tube r 9..11",
"source": "analytic",
"method": "symmetric splits the thickness 1 each side: V = pi (11^2 - 9^2) 20 = 800 pi = 2513.27; faces: outer and inner cylinders and two flat rings, 4",
"body_count": 1,
"faces": 4,
"volume_mm3": 2513.2741228718346,
"surface_types": [
"cylinder",
"plane"
],
"bbox": {
"min": [
-11,
-11,
0
],
"max": [
11,
11,
20
]
}
}
@@ -0,0 +1,72 @@
{
"commands": [
{
"command": "sketch.create",
"params": {
"plane": {
"origin": [
0,
0,
0
],
"x_dir": [
1,
0,
0
],
"y_dir": [
0,
1,
0
]
},
"name": "Ring"
}
},
{
"command": "sketch.circle.center",
"params": {
"center": [
0,
0
],
"radius": 10
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "surface.extrude",
"params": {
"sketch": "Ring",
"curves": [
"c1"
],
"distance": 20,
"body_name": "Wall"
}
},
{
"command": "surface.thicken",
"params": {
"bodies": [
"Wall"
],
"thickness": 2,
"symmetric": true,
"operation": "new",
"body_name": "Tube"
}
},
{
"command": "solid.remove",
"params": {
"bodies": [
"Wall"
]
}
}
]
}
@@ -0,0 +1,22 @@
{
"sources": [],
"what": "a 10 x 10 sheet on XY thickened 2 along its normal: a slab",
"source": "analytic",
"method": "the box 10 x 10 x 2 at z 0..2 (the patch faces +z): V = 200, A = 280, 6 faces",
"body_count": 1,
"faces": 6,
"volume_mm3": 200.0,
"area_mm2": 280.0,
"bbox": {
"min": [
0,
0,
0
],
"max": [
10,
10,
2
]
}
}
@@ -0,0 +1,70 @@
{
"commands": [
{
"command": "sketch.create",
"params": {
"plane": {
"origin": [
0,
0,
0
],
"x_dir": [
1,
0,
0
],
"y_dir": [
0,
1,
0
]
},
"name": "Sheet sketch"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
10,
10
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "surface.patch",
"params": {
"sketch": "Sheet sketch",
"body_name": "Sheet"
}
},
{
"command": "surface.thicken",
"params": {
"bodies": [
"Sheet"
],
"thickness": 2,
"operation": "new",
"body_name": "Slab"
}
},
{
"command": "solid.remove",
"params": {
"bodies": [
"Sheet"
]
}
}
]
}
@@ -0,0 +1,8 @@
{
"sources": [],
"what": "a plane trim given keep_with, which only a mutual trim takes: refused",
"source": "invariants",
"method": "keep_with names what to keep of the other surface of a mutual trim; with no other surface it means nothing",
"outcome": "refused",
"refusal": "belong to a mutual trim"
}
@@ -0,0 +1,79 @@
{
"commands": [
{
"command": "sketch.create",
"params": {
"plane": {
"origin": [
0,
0,
0
],
"x_dir": [
1,
0,
0
],
"y_dir": [
0,
1,
0
]
},
"name": "Sheet sketch"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
20,
20
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "surface.patch",
"params": {
"sketch": "Sheet sketch",
"body_name": "Sheet"
}
},
{
"command": "surface.trim",
"params": {
"body": "Sheet",
"plane": {
"origin": [
10,
0,
0
],
"normal": [
1,
0,
0
]
},
"keep": [
5,
5,
0
],
"keep_with": [
1,
1,
0
]
}
}
]
}
@@ -0,0 +1,26 @@
{
"sources": [],
"what": "a 20 x 20 sheet trimmed by a circle r 4 drawn on it, keeping the outside: a sheet with a hole",
"source": "analytic",
"method": "A = 400 - 16 pi = 349.73, one plane face, free edges the 4 sides and the circle",
"valid": false,
"body_count": 1,
"faces": 1,
"boundary_edges": 5,
"area_mm2": 349.7345175425633,
"surface_types": [
"plane"
],
"bbox": {
"min": [
0,
0,
0
],
"max": [
20,
20,
0
]
}
}
@@ -0,0 +1,102 @@
{
"commands": [
{
"command": "sketch.create",
"params": {
"plane": {
"origin": [
0,
0,
0
],
"x_dir": [
1,
0,
0
],
"y_dir": [
0,
1,
0
]
},
"name": "Sheet sketch"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
20,
20
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "surface.patch",
"params": {
"sketch": "Sheet sketch",
"body_name": "Sheet"
}
},
{
"command": "sketch.create",
"params": {
"plane": {
"origin": [
0,
0,
0
],
"x_dir": [
1,
0,
0
],
"y_dir": [
0,
1,
0
]
},
"name": "Cut"
}
},
{
"command": "sketch.circle.center",
"params": {
"center": [
10,
10
],
"radius": 4
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "surface.trim",
"params": {
"body": "Sheet",
"curves": {
"sketch": "Cut"
},
"keep": [
1,
1,
0
]
}
}
]
}
@@ -0,0 +1,26 @@
{
"sources": [],
"what": "a 20 x 20 sheet trimmed by the plane x = 10, keeping x < 10",
"source": "analytic",
"method": "the half x 0..10: area 200, one plane face, 4 free edges",
"valid": false,
"body_count": 1,
"faces": 1,
"boundary_edges": 4,
"area_mm2": 200.0,
"surface_types": [
"plane"
],
"bbox": {
"min": [
0,
0,
0
],
"max": [
10,
20,
0
]
}
}
@@ -0,0 +1,74 @@
{
"commands": [
{
"command": "sketch.create",
"params": {
"plane": {
"origin": [
0,
0,
0
],
"x_dir": [
1,
0,
0
],
"y_dir": [
0,
1,
0
]
},
"name": "Sheet sketch"
}
},
{
"command": "sketch.rectangle.two_point",
"params": {
"p0": [
0,
0
],
"p1": [
20,
20
]
}
},
{
"command": "sketch.finish",
"params": {}
},
{
"command": "surface.patch",
"params": {
"sketch": "Sheet sketch",
"body_name": "Sheet"
}
},
{
"command": "surface.trim",
"params": {
"body": "Sheet",
"plane": {
"origin": [
10,
0,
0
],
"normal": [
1,
0,
0
]
},
"keep": [
5,
5,
0
]
}
}
]
}