SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 412/509: Kernel rig: everyday rounds of a pocket and a boss
jyviko3afa2e874e60
diff --git a/tests/kernel-cases/fillets/KNOWN_FAILING b/tests/kernel-cases/fillets/KNOWN_FAILINGindex d5b04944d4..ec0178ed44 100644--- a/tests/kernel-cases/fillets/KNOWN_FAILING+++ b/tests/kernel-cases/fillets/KNOWN_FAILING@@ -7,3 +7,6 @@5158-fillet-round-just-past-a-10mm-face SMLib status 1001: a convex round 0.01 past its face is not yet built by subtraction (10.0001-10.04 open)9-fillet-corner-curvature-with-reduce-fit not supported yet: solid.fillet builds corner g2 with the exact fit only9-fillet-corner-curvature-with-taper-fit not supported yet: solid.fillet builds corner g2 with the exact fit only+every-pocket-floor-and-rim-edges-r2 a corner patch where two rim rounds meet at each concave pocket corner (23 faces, not 19) instead of the mitre the rounds make running into each other+every-pocket-rim-edges-r2 a corner patch where two rim rounds meet at each concave pocket corner (19 faces, not 15) instead of the mitre the rounds make running into each other+every-pocket-rim-edges-r5-as-deep-as-pocket a corner patch where two rim rounds meet at each concave pocket corner (15 faces, not 11) instead of the mitre the rounds make running into each otherdiff --git a/tests/kernel-cases/fillets/every-boss-root-round-r10-as-tall-as-boss/expected.json b/tests/kernel-cases/fillets/every-boss-root-round-r10-as-tall-as-boss/expected.jsonnew file mode 100644index 0000000000..0440922bdc--- /dev/null+++ b/tests/kernel-cases/fillets/every-boss-root-round-r10-as-tall-as-boss/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "the root circle of a 10 mm tall boss rounded r10: the round uses up the boss's wall and meets its top face at its rim",+ "source": "analytic",+ "method": "plate 60x40x10 with a boss R8 x 10 on its top at (30, 20): V0 = 24000 + 640 pi = 26010.6193. The concave root (rho = 8, z = 10) rounded r10 adds the spandrel (1-pi/4) r^2 = 21.460184 outside the boss, its first moment about the wall r^3 (5/6-pi/4) = 47.935170, revolved once (Pappus): 2 pi (8 A + M) = 1379.8920. V = 27390.5113. The round is tangent to the wall at z = 20, the boss's top rim: the wall is used up (a round may use up a face). Faces 8 - 1 + 1 = 8.",+ "body_count": 1,+ "volume_mm3": 27390.511339043704,+ "faces": 8,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 20+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-boss-root-round-r10-as-tall-as-boss/recipe.json b/tests/kernel-cases/fillets/every-boss-root-round-r10-as-tall-as-boss/recipe.jsonnew file mode 100644index 0000000000..68f0d04c01--- /dev/null+++ b/tests/kernel-cases/fillets/every-boss-root-round-r10-as-tall-as-boss/recipe.json@@ -0,0 +1,42 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 8,+ "height": 10,+ "base": [+ 30,+ 20,+ 10+ ],+ "operation": "join",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 38,+ 20,+ 10+ ]+ ],+ "radius": 10+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-boss-root-round-r2/expected.json b/tests/kernel-cases/fillets/every-boss-root-round-r2/expected.jsonnew file mode 100644index 0000000000..11c0bfcbce--- /dev/null+++ b/tests/kernel-cases/fillets/every-boss-root-round-r2/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "the root circle of a cylindrical boss on a plate rounded r2 (a concave torus)",+ "source": "analytic",+ "method": "plate 60x40x10 with a boss R8 x 10 on its top at (30, 20): V0 = 24000 + 640 pi = 26010.6193. The concave root (rho = 8, z = 10) rounded r2 adds the spandrel (1-pi/4) r^2 = 0.858407 outside the boss, its first moment about the wall r^3 (5/6-pi/4) = 0.383481, revolved once (Pappus): 2 pi (8 A + M) = 45.5577. V = 26056.1770. Faces 9.",+ "body_count": 1,+ "volume_mm3": 26056.177042153293,+ "faces": 9,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 20+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-boss-root-round-r2/recipe.json b/tests/kernel-cases/fillets/every-boss-root-round-r2/recipe.jsonnew file mode 100644index 0000000000..aea7ad5cbd--- /dev/null+++ b/tests/kernel-cases/fillets/every-boss-root-round-r2/recipe.json@@ -0,0 +1,42 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 8,+ "height": 10,+ "base": [+ 30,+ 20,+ 10+ ],+ "operation": "join",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 38,+ 20,+ 10+ ]+ ],+ "radius": 2+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-boss-top-rim-r2/expected.json b/tests/kernel-cases/fillets/every-boss-top-rim-r2/expected.jsonnew file mode 100644index 0000000000..515a1f1661--- /dev/null+++ b/tests/kernel-cases/fillets/every-boss-top-rim-r2/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "the top rim of a cylindrical boss on a plate rounded r2",+ "source": "analytic",+ "method": "plate 60x40x10 with a boss R8 x 10 on its top at (30, 20): V0 = 24000 + 640 pi = 26010.6193. The convex top rim (rho = 8, z = 20) rounded r2 removes the spandrel A = 0.858407, centroid inside the wall (first moment 0.383481), revolved once: 2 pi (8 A - M) = 40.7388. V = 25969.8805. Faces 9.",+ "body_count": 1,+ "volume_mm3": 25969.88052332866,+ "faces": 9,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 20+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-boss-top-rim-r2/recipe.json b/tests/kernel-cases/fillets/every-boss-top-rim-r2/recipe.jsonnew file mode 100644index 0000000000..d6105b56ba--- /dev/null+++ b/tests/kernel-cases/fillets/every-boss-top-rim-r2/recipe.json@@ -0,0 +1,42 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 8,+ "height": 10,+ "base": [+ 30,+ 20,+ 10+ ],+ "operation": "join",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 38,+ 20,+ 20+ ]+ ],+ "radius": 2+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-floor-and-rim-edges-r2/expected.json b/tests/kernel-cases/fillets/every-pocket-floor-and-rim-edges-r2/expected.jsonnew file mode 100644index 0000000000..2d4e12ccf7--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-floor-and-rim-edges-r2/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "a rectangular pocket's floor edges and rim edges rounded r2 in one fillet (5 mm walls: 1 mm of flat wall left between them)",+ "source": "analytic",+ "method": "plate 60x40x10 with the pocket 30x20x5 (x 15..45, y 10..30, floor z = 5, sharp vertical corners): V0 = 24000 - 3000 = 21000. The floor rounds and the rim rounds touch different parts of the walls (2 + 2 < 5), so they add up: + (100 A - 4 r^3 (5/3-pi/2)) = 82.7729 - (100 A + 4 r^3 (5/3-pi/2)) = 88.9086. V = 20993.8643. Faces 19.",+ "body_count": 1,+ "volume_mm3": 20993.864298248205,+ "faces": 19,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 10+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-floor-and-rim-edges-r2/recipe.json b/tests/kernel-cases/fillets/every-pocket-floor-and-rim-edges-r2/recipe.jsonnew file mode 100644index 0000000000..eefb336546--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-floor-and-rim-edges-r2/recipe.json@@ -0,0 +1,78 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 30,+ "width": 20,+ "height": 6,+ "corner": [+ 15,+ 10,+ 5+ ],+ "operation": "cut",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 30,+ 10,+ 5+ ],+ [+ 30,+ 30,+ 5+ ],+ [+ 15,+ 20,+ 5+ ],+ [+ 45,+ 20,+ 5+ ],+ [+ 30,+ 10,+ 10+ ],+ [+ 30,+ 30,+ 10+ ],+ [+ 15,+ 20,+ 10+ ],+ [+ 45,+ 20,+ 10+ ]+ ],+ "radius": 2+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-floor-edges-r2/expected.json b/tests/kernel-cases/fillets/every-pocket-floor-edges-r2/expected.jsonnew file mode 100644index 0000000000..97366c19c1--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-floor-edges-r2/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "the four floor edges of a rectangular pocket rounded r2 (concave), the pocket's vertical corners left sharp",+ "source": "analytic",+ "method": "plate 60x40x10 with the pocket 30x20x5 (x 15..45, y 10..30, floor z = 5, sharp vertical corners): V0 = 24000 - 3000 = 21000. Each concave floor edge gains the spandrel (1-pi/4) r^2 = 0.858407 along its whole length (30, 30, 20, 20: 100); at each sharp vertical corner the two rounds run into each other (a mitre), their spandrel prisms overlapping in int_0^r L(u)^2 du, L(u) = r - sqrt(r^2-(r-u)^2), = r^3 (5/3 - pi/2) = 0.766963. Added = 100 A - 4 overlap = 82.7729. V = 21082.7729. Faces 11 + 4 = 15.",+ "body_count": 1,+ "volume_mm3": 21082.772883765123,+ "faces": 15,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 10+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-floor-edges-r2/recipe.json b/tests/kernel-cases/fillets/every-pocket-floor-edges-r2/recipe.jsonnew file mode 100644index 0000000000..e50505d14d--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-floor-edges-r2/recipe.json@@ -0,0 +1,58 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 30,+ "width": 20,+ "height": 6,+ "corner": [+ 15,+ 10,+ 5+ ],+ "operation": "cut",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 30,+ 10,+ 5+ ],+ [+ 30,+ 30,+ 5+ ],+ [+ 15,+ 20,+ 5+ ],+ [+ 45,+ 20,+ 5+ ]+ ],+ "radius": 2+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-rim-edges-r2/expected.json b/tests/kernel-cases/fillets/every-pocket-rim-edges-r2/expected.jsonnew file mode 100644index 0000000000..e7d30c1f56--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-rim-edges-r2/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "the four rim edges of a rectangular pocket rounded r2 (convex edges meeting at the pocket's concave corners)",+ "source": "analytic",+ "method": "plate 60x40x10 with the pocket 30x20x5 (x 15..45, y 10..30, floor z = 5, sharp vertical corners): V0 = 24000 - 3000 = 21000. Each convex rim edge loses the spandrel A = 0.858407 along its length (100 in all); at each corner of the pocket the two rounds run on past the corner into the material beyond it and meet in a mitre, so the quadrant there loses what both remove: the overlap of their spandrel prisms, r^3 (5/3 - pi/2) = 0.766963. Removed = 100 A + 4 overlap = 88.9086. V = 20911.0914. Faces 15.",+ "body_count": 1,+ "volume_mm3": 20911.091414483082,+ "faces": 15,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 10+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-rim-edges-r2/recipe.json b/tests/kernel-cases/fillets/every-pocket-rim-edges-r2/recipe.jsonnew file mode 100644index 0000000000..33c01ec26a--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-rim-edges-r2/recipe.json@@ -0,0 +1,58 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 30,+ "width": 20,+ "height": 6,+ "corner": [+ 15,+ 10,+ 5+ ],+ "operation": "cut",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 30,+ 10,+ 10+ ],+ [+ 30,+ 30,+ 10+ ],+ [+ 15,+ 20,+ 10+ ],+ [+ 45,+ 20,+ 10+ ]+ ],+ "radius": 2+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-rim-edges-r5-as-deep-as-pocket/expected.json b/tests/kernel-cases/fillets/every-pocket-rim-edges-r5-as-deep-as-pocket/expected.jsonnew file mode 100644index 0000000000..6e36029283--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-rim-edges-r5-as-deep-as-pocket/expected.json@@ -0,0 +1,24 @@+{+ "sources": [],+ "what": "a 5 mm deep pocket's rim edges rounded r5: the rounds use up the walls and meet the floor where the walls met it",+ "source": "analytic",+ "method": "plate 60x40x10 with the pocket 30x20x5 (x 15..45, y 10..30, floor z = 5, sharp vertical corners): V0 = 24000 - 3000 = 21000. As every-pocket-rim-edges-r2 with r = 5, the wall's height: each round reaches the floor tangent to the wall exactly at the floor edge, so the walls are used up (a round may use up a face). Removed = 100 (1-pi/4) 25 + 4 * 125 (5/3-pi/2) = 584.4398. V = 20415.5602. Faces 11 - 4 walls + 4 rounds = 11.",+ "body_count": 1,+ "volume_mm3": 20415.560238557737,+ "faces": 11,+ "bbox": {+ "min": [+ 0,+ 0,+ 0+ ],+ "max": [+ 60,+ 40,+ 10+ ]+ },+ "continuity": {+ "order": "g1"+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/fillets/every-pocket-rim-edges-r5-as-deep-as-pocket/recipe.json b/tests/kernel-cases/fillets/every-pocket-rim-edges-r5-as-deep-as-pocket/recipe.jsonnew file mode 100644index 0000000000..4711cd5b8d--- /dev/null+++ b/tests/kernel-cases/fillets/every-pocket-rim-edges-r5-as-deep-as-pocket/recipe.json@@ -0,0 +1,58 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 60,+ "width": 40,+ "height": 10,+ "body_name": "Plate"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 30,+ "width": 20,+ "height": 6,+ "corner": [+ 15,+ 10,+ 5+ ],+ "operation": "cut",+ "targets": [+ "Plate"+ ]+ }+ },+ {+ "command": "solid.fillet",+ "params": {+ "edges": [+ [+ 30,+ 10,+ 10+ ],+ [+ 30,+ 30,+ 10+ ],+ [+ 15,+ 20,+ 10+ ],+ [+ 45,+ 20,+ 10+ ]+ ],+ "radius": 5+ }+ }+ ]+}\ No newline at end of file