SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 64/509: kernel-cases: sweeps sweep and pipe cases from #96-#3505 (end scale, rails, corners, closed paths)
Brennen Herbruck1fc1497af3c9
diff --git a/tests/kernel-cases/sweeps/1269-sweep-parallel-orientation-oblique-cylinder/expected.json b/tests/kernel-cases/sweeps/1269-sweep-parallel-orientation-oblique-cylinder/expected.jsonnew file mode 100644index 0000000000..a689b0c0e9--- /dev/null+++ b/tests/kernel-cases/sweeps/1269-sweep-parallel-orientation-oblique-cylinder/expected.json@@ -0,0 +1,24 @@+{+ "sources": [+ "tangency-labs/solidcraft#1269"+ ],+ "what": "a circle of radius 5 on XY swept with orientation parallel along a path rising 20 mm while leaning 20 mm in x (the profile does not turn: a sheared cylinder)",+ "source": "analytic",+ "method": "with the profile keeping its attitude the body is an oblique circular cylinder: Cavalieri, V = base area * vertical height = pi 25 * 20 = 1570.8. Area = two discs 2 pi 25 + lateral = perimeter of the right section (ellipse a 5, b 5 cos45) * slant 20 sqrt2 = 921.119 total; bbox x -5..25, y +-5, z 0..20; faces: oblique cylinder and two discs.",+ "body_count": 1,+ "volume_mm3": 1570.7963267948967,+ "area_mm2": 921.1191904850396,+ "faces": 3,+ "bbox": {+ "min": [+ -5,+ -5,+ 0+ ],+ "max": [+ 25,+ 5,+ 20+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/1269-sweep-parallel-orientation-oblique-cylinder/recipe.json b/tests/kernel-cases/sweeps/1269-sweep-parallel-orientation-oblique-cylinder/recipe.jsonnew file mode 100644index 0000000000..ccfed06f3f--- /dev/null+++ b/tests/kernel-cases/sweeps/1269-sweep-parallel-orientation-oblique-cylinder/recipe.json@@ -0,0 +1,99 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 20,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.circle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "radius": 5+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1"+ ],+ "orientation": "parallel",+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/1269-sweep-twisted-square-ninety-degrees/expected.json b/tests/kernel-cases/sweeps/1269-sweep-twisted-square-ninety-degrees/expected.jsonnew file mode 100644index 0000000000..eda569765d--- /dev/null+++ b/tests/kernel-cases/sweeps/1269-sweep-twisted-square-ninety-degrees/expected.json@@ -0,0 +1,22 @@+{+ "sources": [+ "tangency-labs/solidcraft#1269"+ ],+ "what": "a 10 x 10 square swept 40 mm along a straight path while turning 90 degrees about the path",+ "source": "analytic",+ "method": "twisting about the section centre does not change the section area, and the centre moves straight along the path: V = A L = 100 * 40 = 4000. Mid-path the square is turned 45 degrees, so the bbox reaches the corners at 5 sqrt(2) = 7.0711 in x and y.",+ "body_count": 1,+ "volume_mm3": 4000.0,+ "bbox": {+ "min": [+ -7.0710678,+ -7.0710678,+ 0+ ],+ "max": [+ 7.0710678,+ 7.0710678,+ 40+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/1269-sweep-twisted-square-ninety-degrees/recipe.json b/tests/kernel-cases/sweeps/1269-sweep-twisted-square-ninety-degrees/recipe.jsonnew file mode 100644index 0000000000..9596292bc5--- /dev/null+++ b/tests/kernel-cases/sweeps/1269-sweep-twisted-square-ninety-degrees/recipe.json@@ -0,0 +1,102 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 40+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.rectangle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "corner": [+ 5,+ 5+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1"+ ],+ "twist": "90 deg",+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/2820-pipe-cut-oblique-hole-through-a-block/expected.json b/tests/kernel-cases/sweeps/2820-pipe-cut-oblique-hole-through-a-block/expected.jsonnew file mode 100644index 0000000000..cb6498462c--- /dev/null+++ b/tests/kernel-cases/sweeps/2820-pipe-cut-oblique-hole-through-a-block/expected.json@@ -0,0 +1,11 @@+{+ "sources": [+ "tangency-labs/solidcraft#2820"+ ],+ "what": "a pipe of diameter 6 cut through a 40 x 40 x 20 block along a line leaning 30 degrees from the vertical",+ "source": "analytic",+ "method": "the cylinder between two parallel planes 20 apart, leaning 30 degrees from their normal, has volume pi r^2 h / cos(30) = pi 9 20 / 0.8660 = 653.0 (it crosses both faces well inside the block); V = 32000 - 653.0. Faces: 4 sides, top and bottom with an elliptical hole each, and the hole wall = 7.",+ "body_count": 1,+ "volume_mm3": 31347.032228875683,+ "faces": 7+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/2820-pipe-cut-oblique-hole-through-a-block/recipe.json b/tests/kernel-cases/sweeps/2820-pipe-cut-oblique-hole-through-a-block/recipe.jsonnew file mode 100644index 0000000000..60eeca8b2e--- /dev/null+++ b/tests/kernel-cases/sweeps/2820-pipe-cut-oblique-hole-through-a-block/recipe.json@@ -0,0 +1,75 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 40,+ "height": 20,+ "corner": [+ -20,+ -20,+ 0+ ],+ "body_name": "Block"+ }+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ -9.999999999999998,+ -7.320508075688775+ ],+ [+ 9.999999999999998,+ 27.320508075688775+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.pipe",+ "params": {+ "path_sketch": "Path",+ "path": [+ "p1"+ ],+ "diameter": 6,+ "operation": "cut"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/2820-pipe-hollow-with-a-wall-along-a-bend/expected.json b/tests/kernel-cases/sweeps/2820-pipe-hollow-with-a-wall-along-a-bend/expected.jsonnew file mode 100644index 0000000000..8b512d2b48--- /dev/null+++ b/tests/kernel-cases/sweeps/2820-pipe-hollow-with-a-wall-along-a-bend/expected.json@@ -0,0 +1,11 @@+{+ "sources": [+ "tangency-labs/solidcraft#2820"+ ],+ "what": "a hollow pipe (outer diameter 10, wall 2) along a path of two lines joined by a tangent R20 quarter arc",+ "source": "analytic",+ "method": "a tube of constant ring section along a path of length 30 + (pi/2) 20 + 30 = 91.416: V = pi (5^2 - 3^2) L (Pappus: the section centre follows the path; R 20 > 5). Faces: outer cylinder, torus, cylinder; inner cylinder, torus, cylinder; two annular ends = 8.",+ "body_count": 1,+ "volume_mm3": 4595.065651620499,+ "faces": 8+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/2820-pipe-hollow-with-a-wall-along-a-bend/recipe.json b/tests/kernel-cases/sweeps/2820-pipe-hollow-with-a-wall-along-a-bend/recipe.jsonnew file mode 100644index 0000000000..11637c5620--- /dev/null+++ b/tests/kernel-cases/sweeps/2820-pipe-hollow-with-a-wall-along-a-bend/recipe.json@@ -0,0 +1,101 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 30+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.arc.three_point",+ "params": {+ "start": [+ 0,+ 30+ ],+ "through": [+ 5.857864376269049,+ 44.14213562373095+ ],+ "end": [+ 20,+ 50+ ],+ "id": "p2"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 20,+ 50+ ],+ [+ 50,+ 50+ ]+ ],+ "infer": false,+ "ids": [+ "p3"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.pipe",+ "params": {+ "path_sketch": "Path",+ "path": [+ "p1",+ "p2",+ "p3"+ ],+ "diameter": 10,+ "wall": 2,+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/3006-second-sweep-from-a-plane-along-a-closed-path/expected.json b/tests/kernel-cases/sweeps/3006-second-sweep-from-a-plane-along-a-closed-path/expected.jsonnew file mode 100644index 0000000000..e51433665a--- /dev/null+++ b/tests/kernel-cases/sweeps/3006-second-sweep-from-a-plane-along-a-closed-path/expected.json@@ -0,0 +1,10 @@+{+ "sources": [+ "tangency-labs/solidcraft#3006"+ ],+ "what": "a circle of radius 3 on a plane at 0.5 of a closed circular path (R 30) swept round it, then a 5 x 5 square on a plane at 0.75 swept round the same path and joined (it did not follow the path)",+ "source": "analytic",+ "method": "both sections are centred on the path and square to it, so the union is a ring whose section is the union of the disc (r 3) and the square (half side 2.5): A = 25 + 9 pi - A(disc and square), A(disc and square) = integral over x in [-2.5, 2.5] of 2 min(2.5, sqrt(9 - x^2)) = 23.7719; V = A * 2 pi 30 (the same however the square is turned about the path).",+ "body_count": 1,+ "volume_mm3": 5561.078930711061+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/3006-second-sweep-from-a-plane-along-a-closed-path/recipe.json b/tests/kernel-cases/sweeps/3006-second-sweep-from-a-plane-along-a-closed-path/recipe.jsonnew file mode 100644index 0000000000..97300f6922--- /dev/null+++ b/tests/kernel-cases/sweeps/3006-second-sweep-from-a-plane-along-a-closed-path/recipe.json@@ -0,0 +1,134 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.circle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "radius": 30+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "construct.plane.along_path",+ "params": {+ "path": {+ "sketch": "Path",+ "curve": "c1"+ },+ "t": 0.5,+ "name": "P50"+ }+ },+ {+ "command": "construct.plane.along_path",+ "params": {+ "path": {+ "sketch": "Path",+ "curve": "c1"+ },+ "t": 0.75,+ "name": "P75"+ }+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": "P50",+ "name": "Round"+ }+ },+ {+ "command": "sketch.circle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "radius": 3.0+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": "P75",+ "name": "Square"+ }+ },+ {+ "command": "sketch.rectangle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "corner": [+ 2.5,+ 2.5+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Round",+ "path_sketch": "Path",+ "path": [+ "c1"+ ],+ "operation": "new",+ "body_name": "RoundBar"+ }+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Square",+ "path_sketch": "Path",+ "path": [+ "c1"+ ],+ "operation": "join",+ "targets": [+ "RoundBar"+ ]+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/3345-sweep-profile-mid-line-round-a-rounded-rectangle/expected.json b/tests/kernel-cases/sweeps/3345-sweep-profile-mid-line-round-a-rounded-rectangle/expected.jsonnew file mode 100644index 0000000000..013b58a6e7--- /dev/null+++ b/tests/kernel-cases/sweeps/3345-sweep-profile-mid-line-round-a-rounded-rectangle/expected.json@@ -0,0 +1,22 @@+{+ "sources": [+ "tangency-labs/solidcraft#3345"+ ],+ "what": "a 4 x 3 profile drawn at the middle of the bottom line of a closed 60 x 40 rounded-rectangle path (corner radius 8) and swept round the whole path (walls offset, fillets turned the wrong way)",+ "source": "analytic",+ "method": "the profile is centred on the path and square to it, so every part of the path keeps it centred: V = A L with A = 12 and L = 2 * 44 + 2 * 24 + 4 (pi/2) 8 = 186.27 (Pappus on the arcs), V = 2235.2. The tube stays within 2 mm of the path sideways and 1.5 mm up: bbox x +-32, y +-22, z +-1.5.",+ "body_count": 1,+ "volume_mm3": 2235.18578948924,+ "bbox": {+ "min": [+ -32,+ -22,+ -1.5+ ],+ "max": [+ 32,+ 22,+ 1.5+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/3345-sweep-profile-mid-line-round-a-rounded-rectangle/recipe.json b/tests/kernel-cases/sweeps/3345-sweep-profile-mid-line-round-a-rounded-rectangle/recipe.jsonnew file mode 100644index 0000000000..58db40cd0c--- /dev/null+++ b/tests/kernel-cases/sweeps/3345-sweep-profile-mid-line-round-a-rounded-rectangle/recipe.json@@ -0,0 +1,233 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ -22,+ -20+ ],+ [+ 22,+ -20+ ]+ ],+ "infer": false,+ "ids": [+ "l1"+ ]+ }+ },+ {+ "command": "sketch.arc.center_point",+ "params": {+ "center": [+ 22,+ -12+ ],+ "start": [+ 22,+ -20+ ],+ "end": [+ 30,+ -12+ ]+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 30,+ -12+ ],+ [+ 30,+ 12+ ]+ ],+ "infer": false,+ "ids": [+ "l2"+ ]+ }+ },+ {+ "command": "sketch.arc.center_point",+ "params": {+ "center": [+ 22,+ 12+ ],+ "start": [+ 30,+ 12+ ],+ "end": [+ 22,+ 20+ ]+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 22,+ 20+ ],+ [+ -22,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "l3"+ ]+ }+ },+ {+ "command": "sketch.arc.center_point",+ "params": {+ "center": [+ -22,+ 12+ ],+ "start": [+ -22,+ 20+ ],+ "end": [+ -30,+ 12+ ]+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ -30,+ 12+ ],+ [+ -30,+ -12+ ]+ ],+ "infer": false,+ "ids": [+ "l4"+ ]+ }+ },+ {+ "command": "sketch.arc.center_point",+ "params": {+ "center": [+ -22,+ -12+ ],+ "start": [+ -30,+ -12+ ],+ "end": [+ -22,+ -20+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ -20.0,+ 0.0+ ],+ "x_dir": [+ 0,+ 1,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Prof"+ }+ },+ {+ "command": "sketch.rectangle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "corner": [+ 2,+ 1.5+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Prof",+ "path_sketch": "Path",+ "path": [+ "l1",+ "a1",+ "l2",+ "a2",+ "l3",+ "a3",+ "l4",+ "a4"+ ],+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/3505-extrude-the-flat-wall-of-a-sweep-with-a-corner/expected.json b/tests/kernel-cases/sweeps/3505-extrude-the-flat-wall-of-a-sweep-with-a-corner/expected.jsonnew file mode 100644index 0000000000..3f3e8c6bb6--- /dev/null+++ b/tests/kernel-cases/sweeps/3505-extrude-the-flat-wall-of-a-sweep-with-a-corner/expected.json@@ -0,0 +1,10 @@+{+ "sources": [+ "tangency-labs/solidcraft#3505"+ ],+ "what": "the inner side wall of the vertical leg of a mitred swept bar extruded outward by 3 mm (the wall is a B-spline net in a plane, \"the selected planar face no longer exists\")",+ "source": "analytic",+ "method": "bar: 8 x 5 section, path 30 up then 40 across (mitred): V = 40 * 70 = 2800. The inner wall of the vertical leg is the plane x = 4, 5 wide and 26 high (it ends where the mitre meets the horizontal leg underside at z = 26): extruding it 3 mm outward adds 5 * 26 * 3 = 390, a block touching the horizontal leg along z = 26: V = 3190.",+ "body_count": 1,+ "volume_mm3": 3190+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/3505-extrude-the-flat-wall-of-a-sweep-with-a-corner/recipe.json b/tests/kernel-cases/sweeps/3505-extrude-the-flat-wall-of-a-sweep-with-a-corner/recipe.jsonnew file mode 100644index 0000000000..c4fdd20c30--- /dev/null+++ b/tests/kernel-cases/sweeps/3505-extrude-the-flat-wall-of-a-sweep-with-a-corner/recipe.json@@ -0,0 +1,134 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 30+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 30+ ],+ [+ 40,+ 30+ ]+ ],+ "infer": false,+ "ids": [+ "p2"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.rectangle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "corner": [+ 4,+ 2.5+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1",+ "p2"+ ],+ "operation": "new",+ "body_name": "Bar"+ }+ },+ {+ "command": "solid.extrude",+ "params": {+ "face": [+ 4,+ 0,+ 15+ ],+ "distance": 3,+ "operation": "join"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/771-sweep-end-scale-cone-frustum/expected.json b/tests/kernel-cases/sweeps/771-sweep-end-scale-cone-frustum/expected.jsonnew file mode 100644index 0000000000..e034ea62ab--- /dev/null+++ b/tests/kernel-cases/sweeps/771-sweep-end-scale-cone-frustum/expected.json@@ -0,0 +1,24 @@+{+ "sources": [+ "tangency-labs/solidcraft#771",+ "tangency-labs/solidcraft#1269"+ ],+ "what": "a circle of radius 5 swept 30 mm along a straight path with end scale 2",+ "source": "analytic",+ "method": "the section scales linearly with the path, so the solid is a cone frustum from r 5 to r 10 over 30 mm: V = h/3 (A1 + A2 + sqrt(A1 A2)) = 10 pi (25 + 100 + 50) = 5497.8; faces: cone and two disc caps.",+ "body_count": 1,+ "volume_mm3": 5497.787143782138,+ "faces": 3,+ "bbox": {+ "min": [+ -10,+ -10,+ 0+ ],+ "max": [+ 10,+ 10,+ 30+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/771-sweep-end-scale-cone-frustum/recipe.json b/tests/kernel-cases/sweeps/771-sweep-end-scale-cone-frustum/recipe.jsonnew file mode 100644index 0000000000..924a5c9070--- /dev/null+++ b/tests/kernel-cases/sweeps/771-sweep-end-scale-cone-frustum/recipe.json@@ -0,0 +1,99 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 30+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.circle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "radius": 5+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1"+ ],+ "scale": 2,+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/771-sweep-one-guide-rail-cone-frustum/expected.json b/tests/kernel-cases/sweeps/771-sweep-one-guide-rail-cone-frustum/expected.jsonnew file mode 100644index 0000000000..b68a9d7696--- /dev/null+++ b/tests/kernel-cases/sweeps/771-sweep-one-guide-rail-cone-frustum/expected.json@@ -0,0 +1,23 @@+{+ "sources": [+ "tangency-labs/solidcraft#771",+ "tangency-labs/solidcraft#1806"+ ],+ "what": "a circle of radius 5 swept 20 mm up a straight path with one guide rail from its point (5,0,0) to (10,0,20)",+ "source": "analytic",+ "method": "the profile is scaled by the rail distance from the path, 5 at the start and 10 at the end, linearly: a cone frustum, V = h/3 (A1 + A2 + sqrt(A1 A2)) = 20/3 pi (25 + 100 + 50) = 3665.2.",+ "body_count": 1,+ "volume_mm3": 3665.191429188092,+ "bbox": {+ "min": [+ -10,+ -10,+ 0+ ],+ "max": [+ 10,+ 10,+ 20+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/771-sweep-one-guide-rail-cone-frustum/recipe.json b/tests/kernel-cases/sweeps/771-sweep-one-guide-rail-cone-frustum/recipe.jsonnew file mode 100644index 0000000000..2a363c4c36--- /dev/null+++ b/tests/kernel-cases/sweeps/771-sweep-one-guide-rail-cone-frustum/recipe.json@@ -0,0 +1,152 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.circle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "radius": 5+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Rail"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 5,+ 0+ ],+ [+ 10,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "r1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1"+ ],+ "rails": [+ {+ "sketch": "Rail",+ "curves": [+ "r1"+ ]+ }+ ],+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/771-sweep-two-guide-rails-cone-frustum/expected.json b/tests/kernel-cases/sweeps/771-sweep-two-guide-rails-cone-frustum/expected.jsonnew file mode 100644index 0000000000..e9eeebead4--- /dev/null+++ b/tests/kernel-cases/sweeps/771-sweep-two-guide-rails-cone-frustum/expected.json@@ -0,0 +1,23 @@+{+ "sources": [+ "tangency-labs/solidcraft#771",+ "tangency-labs/solidcraft#1806"+ ],+ "what": "a circle of radius 5 swept 20 mm up a straight path between two guide rails from (5,0,0) to (10,0,20) and from (-5,0,0) to (-10,0,20)",+ "source": "analytic",+ "method": "the profile follows the rails (its points where they start stay on both) and is sized by their distance, 10 at the start and 20 at the end: the same cone frustum, V = 20/3 pi (25 + 100 + 50) = 3665.2.",+ "body_count": 1,+ "volume_mm3": 3665.191429188092,+ "bbox": {+ "min": [+ -10,+ -10,+ 0+ ],+ "max": [+ 10,+ 10,+ 20+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/771-sweep-two-guide-rails-cone-frustum/recipe.json b/tests/kernel-cases/sweeps/771-sweep-two-guide-rails-cone-frustum/recipe.jsonnew file mode 100644index 0000000000..d627792990--- /dev/null+++ b/tests/kernel-cases/sweeps/771-sweep-two-guide-rails-cone-frustum/recipe.json@@ -0,0 +1,177 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.circle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "radius": 5+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Rail"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 5,+ 0+ ],+ [+ 10,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "r1"+ ]+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ -5,+ 0+ ],+ [+ -10,+ 20+ ]+ ],+ "infer": false,+ "ids": [+ "r2"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1"+ ],+ "rails": [+ {+ "sketch": "Rail",+ "curves": [+ "r1"+ ]+ },+ {+ "sketch": "Rail",+ "curves": [+ "r2"+ ]+ }+ ],+ "operation": "new"+ }+ }+ ]+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/96-sweep-rectangle-round-a-mitred-corner/expected.json b/tests/kernel-cases/sweeps/96-sweep-rectangle-round-a-mitred-corner/expected.jsonnew file mode 100644index 0000000000..d1e68055e5--- /dev/null+++ b/tests/kernel-cases/sweeps/96-sweep-rectangle-round-a-mitred-corner/expected.json@@ -0,0 +1,22 @@+{+ "sources": [+ "tangency-labs/solidcraft#96"+ ],+ "what": "an 8 x 5 rectangle swept along a path of a 30 mm vertical line and a 40 mm horizontal line meeting at a sharp corner (walls mitred)",+ "source": "analytic",+ "method": "in the bend plane the mitred joint keeps the area w (l1 + l2): the outer side gains exactly what the inner side loses, so V = A (l1 + l2) = 40 * 70 = 2800. bbox: x -4..40, y +-2.5, z 0..34 (the mitred outer corner reaches 30 + 4).",+ "body_count": 1,+ "volume_mm3": 2800.0,+ "bbox": {+ "min": [+ -4,+ -2.5,+ 0+ ],+ "max": [+ 40,+ 2.5,+ 34+ ]+ }+}\ No newline at end of filediff --git a/tests/kernel-cases/sweeps/96-sweep-rectangle-round-a-mitred-corner/recipe.json b/tests/kernel-cases/sweeps/96-sweep-rectangle-round-a-mitred-corner/recipe.jsonnew file mode 100644index 0000000000..1d03a3211e--- /dev/null+++ b/tests/kernel-cases/sweeps/96-sweep-rectangle-round-a-mitred-corner/recipe.json@@ -0,0 +1,122 @@+{+ "commands": [+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 0,+ 1+ ]+ },+ "name": "Path"+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 0+ ],+ [+ 0,+ 30+ ]+ ],+ "infer": false,+ "ids": [+ "p1"+ ]+ }+ },+ {+ "command": "sketch.line",+ "params": {+ "points": [+ [+ 0,+ 30+ ],+ [+ 40,+ 30+ ]+ ],+ "infer": false,+ "ids": [+ "p2"+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "sketch.create",+ "params": {+ "plane": {+ "origin": [+ 0.0,+ 0.0,+ 0.0+ ],+ "x_dir": [+ 1,+ 0,+ 0+ ],+ "y_dir": [+ 0,+ 1,+ 0+ ]+ },+ "name": "Sec"+ }+ },+ {+ "command": "sketch.rectangle.center",+ "params": {+ "center": [+ 0,+ 0+ ],+ "corner": [+ 4,+ 2.5+ ]+ }+ },+ {+ "command": "sketch.finish",+ "params": {}+ },+ {+ "command": "solid.sweep",+ "params": {+ "sketch": "Sec",+ "path_sketch": "Path",+ "path": [+ "p1",+ "p2"+ ],+ "operation": "new",+ "body_name": "Bar"+ }+ }+ ]+}\ No newline at end of file