SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Wave 379/509: Kernel rig: gears turn by their radii, a rack travels r per radian, a screw its lead per turn, a disc cam lifts 2e
jyviko43a8e92a1244
diff --git a/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-half-turn/expected.json b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-half-turn/expected.jsonnew file mode 100644index 0000000000..b45f6281cc--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-half-turn/expected.json@@ -0,0 +1,30 @@+{+ "sources": [],+ "what": "a knife follower on an eccentric disc cam, the cam turned 180 degrees",+ "source": "analytic",+ "method": "an eccentric disc cam (radius 10, centre 5 off its shaft on z through the origin) with a knife follower on a slider along +x through the shaft, touching at x = 15; the knife's distance at cam turn \u03c6 is s(\u03c6) = e cos \u03c6 + \u221a(R\u00b2 - e\u00b2 sin\u00b2 \u03c6) (e 5, R 10): rise s(0) - s(180) = 15 - 5 = 10; at 180 the knife is at s = 5, 10 mm in: the tappet's centre (20,0,2.5) -> (10,0,2.5)",+ "body_count": 3,+ "volume_mm3": 5770.796,+ "results": [+ {+ "step": 13,+ "json": {+ "lift": {+ "rise": 10.0+ }+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 10.0,+ 0.0,+ 2.5+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-half-turn/recipe.json b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-half-turn/recipe.jsonnew file mode 100644index 0000000000..4ac5cfaf34--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-half-turn/recipe.json@@ -0,0 +1,212 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 10,+ "height": 5,+ "base": [+ 5,+ 0,+ 0+ ],+ "axis": [+ 0,+ 0,+ 1+ ],+ "operation": "new",+ "body_name": "Disc"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 4,+ "height": 5,+ "corner": [+ 15,+ -2,+ 0+ ],+ "operation": "new",+ "body_name": "Tappet"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Cam",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "Disc"+ ],+ "component": "Cam"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Follower",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "Tappet"+ ],+ "component": "Follower"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Shaft",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Cam",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "slider",+ "name": "Lift",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 15,+ 0,+ 2.5+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "b": {+ "occurrence": "Follower",+ "point": [+ 15,+ 0,+ 2.5+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.cam",+ "params": {+ "a": "Shaft",+ "b": "Lift",+ "profile": {+ "edges": [+ [+ 15,+ 0,+ 0+ ]+ ],+ "occurrence": "Cam"+ }+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Shaft",+ "quiet": true,+ "value": 180+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Follower:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-quarter-turn/expected.json b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-quarter-turn/expected.jsonnew file mode 100644index 0000000000..dfaee0cf55--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-quarter-turn/expected.json@@ -0,0 +1,30 @@+{+ "sources": [],+ "what": "a knife follower on an eccentric disc cam, the cam turned 90 degrees",+ "source": "analytic",+ "method": "an eccentric disc cam (radius 10, centre 5 off its shaft on z through the origin) with a knife follower on a slider along +x through the shaft, touching at x = 15; the knife's distance at cam turn \u03c6 is s(\u03c6) = e cos \u03c6 + \u221a(R\u00b2 - e\u00b2 sin\u00b2 \u03c6) (e 5, R 10): rise s(0) - s(180) = 15 - 5 = 10; at 90 the knife meets the disc where \u03c6 = -90 in the cam's frame: s = \u221a(100 - 25) = 8.66025: tappet centre x 20 + (8.66025 - 15)",+ "body_count": 3,+ "volume_mm3": 5770.796,+ "results": [+ {+ "step": 13,+ "json": {+ "lift": {+ "rise": 10.0+ }+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 13.660254,+ 0.0,+ 2.5+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-quarter-turn/recipe.json b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-quarter-turn/recipe.jsonnew file mode 100644index 0000000000..97135540ed--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-cam-eccentric-disc-quarter-turn/recipe.json@@ -0,0 +1,212 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.cylinder",+ "params": {+ "radius": 10,+ "height": 5,+ "base": [+ 5,+ 0,+ 0+ ],+ "axis": [+ 0,+ 0,+ 1+ ],+ "operation": "new",+ "body_name": "Disc"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 4,+ "height": 5,+ "corner": [+ 15,+ -2,+ 0+ ],+ "operation": "new",+ "body_name": "Tappet"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Cam",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "Disc"+ ],+ "component": "Cam"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Follower",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "Tappet"+ ],+ "component": "Follower"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Shaft",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Cam",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "slider",+ "name": "Lift",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 15,+ 0,+ 2.5+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "b": {+ "occurrence": "Follower",+ "point": [+ 15,+ 0,+ 2.5+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.cam",+ "params": {+ "a": "Shaft",+ "b": "Lift",+ "profile": {+ "edges": [+ [+ 15,+ 0,+ 0+ ]+ ],+ "occurrence": "Cam"+ }+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Shaft",+ "quiet": true,+ "value": 90+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Follower:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-gear-internal-turns-the-same-way/expected.json b/tests/kernel-cases/assemblies/cov-joint-gear-internal-turns-the-same-way/expected.jsonnew file mode 100644index 0000000000..ce32b7bdbf--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-gear-internal-turns-the-same-way/expected.json@@ -0,0 +1,28 @@+{+ "sources": [],+ "what": "an internal gear pair (a ring gear), radii 10 and 20",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0); internal: ratio +ra/rb = +0.5, Hinge 60 turns G2 +30: Gear centre (50 + 15 cos30, 15 sin30, 5)",+ "body_count": 3,+ "volume_mm3": 9000.0,+ "results": [+ {+ "step": 13,+ "json": {+ "ratio": 0.5+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 62.990381,+ 7.5,+ 5.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-gear-internal-turns-the-same-way/recipe.json b/tests/kernel-cases/assemblies/cov-joint-gear-internal-turns-the-same-way/recipe.jsonnew file mode 100644index 0000000000..b08ed2d198--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-gear-internal-turns-the-same-way/recipe.json@@ -0,0 +1,201 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 10,+ "height": 10,+ "corner": [+ 60,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "GearBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Gear",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "GearBox"+ ],+ "component": "Gear"+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Hinge",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "G2",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Gear",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.gear",+ "params": {+ "a": "Hinge",+ "b": "G2",+ "ra": 10,+ "rb": 20,+ "internal": true+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Hinge",+ "quiet": true,+ "value": 60+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Gear:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-gear-ratio-turns-the-other-way/expected.json b/tests/kernel-cases/assemblies/cov-joint-gear-ratio-turns-the-other-way/expected.jsonnew file mode 100644index 0000000000..1fbc48771a--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-gear-ratio-turns-the-other-way/expected.json@@ -0,0 +1,40 @@+{+ "sources": [],+ "what": "a gear pair of pitch radii 10 and 20, the driver turned 60 degrees",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0); joint.gear Hinge -> G2, ra 10, rb 20: ratio -ra/rb = -0.5, so Hinge 60 turns G2 -30: Gear centre (50 + 15 cos(-30), 15 sin(-30), 5)",+ "body_count": 3,+ "volume_mm3": 9000.0,+ "results": [+ {+ "step": 13,+ "json": {+ "ratio": -0.5+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 62.990381,+ -7.5,+ 5.0+ ]+ }+ }+ },+ {+ "step": 16,+ "json": {+ "total": {+ "center_of_mass": [+ 10.0,+ 17.320508,+ 5.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-gear-ratio-turns-the-other-way/recipe.json b/tests/kernel-cases/assemblies/cov-joint-gear-ratio-turns-the-other-way/recipe.jsonnew file mode 100644index 0000000000..d4eaa38c0d--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-gear-ratio-turns-the-other-way/recipe.json@@ -0,0 +1,206 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 10,+ "height": 10,+ "corner": [+ 60,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "GearBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Gear",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "GearBox"+ ],+ "component": "Gear"+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Hinge",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "G2",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Gear",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.gear",+ "params": {+ "a": "Hinge",+ "b": "G2",+ "ra": 10,+ "rb": 20+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Hinge",+ "quiet": true,+ "value": 60+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Gear:1"+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Arm:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-rack-pinion-reversed/expected.json b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-reversed/expected.jsonnew file mode 100644index 0000000000..73ff6d0241--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-reversed/expected.json@@ -0,0 +1,28 @@+{+ "sources": [],+ "what": "a reversed rack and pinion, the pinion turned 90 degrees",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); as the rack case with reverse: the rack travels -10\u00b7\u03c0/2: Gear centre (65 - 15.70796, 0, 5)",+ "body_count": 3,+ "volume_mm3": 9000.0,+ "results": [+ {+ "step": 13,+ "json": {+ "ratio": -0.174533+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 49.292037,+ 0.0,+ 5.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-rack-pinion-reversed/recipe.json b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-reversed/recipe.jsonnew file mode 100644index 0000000000..1c9397d0c7--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-reversed/recipe.json@@ -0,0 +1,200 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 10,+ "height": 10,+ "corner": [+ 60,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "GearBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Gear",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "GearBox"+ ],+ "component": "Gear"+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Hinge",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "slider",+ "name": "Rack",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "b": {+ "occurrence": "Gear",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.rack_pinion",+ "params": {+ "a": "Hinge",+ "b": "Rack",+ "radius": 10,+ "reverse": true+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Hinge",+ "quiet": true,+ "value": 90+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Gear:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-rack-pinion-travel-per-turn/expected.json b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-travel-per-turn/expected.jsonnew file mode 100644index 0000000000..27a35d5067--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-travel-per-turn/expected.json@@ -0,0 +1,28 @@+{+ "sources": [],+ "what": "a rack on a pinion of pitch radius 10, the pinion turned 90 degrees",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear block on a slider along +x at (50,0,0); joint.rack_pinion radius 10: the rack travels r\u00b7\u03b8 = 10\u00b7\u03c0/2 = 15.70796 mm (\u03c0\u00b7d = 62.83 mm a turn), ratio 10\u03c0/180 mm per degree; Gear centre (65 + 15.70796, 0, 5)",+ "body_count": 3,+ "volume_mm3": 9000.0,+ "results": [+ {+ "step": 13,+ "json": {+ "ratio": 0.174533+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 80.707963,+ 0.0,+ 5.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-rack-pinion-travel-per-turn/recipe.json b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-travel-per-turn/recipe.jsonnew file mode 100644index 0000000000..60ae4ab93f--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-rack-pinion-travel-per-turn/recipe.json@@ -0,0 +1,199 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 10,+ "height": 10,+ "corner": [+ 60,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "GearBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Gear",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "GearBox"+ ],+ "component": "Gear"+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Hinge",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "slider",+ "name": "Rack",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "b": {+ "occurrence": "Gear",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.rack_pinion",+ "params": {+ "a": "Hinge",+ "b": "Rack",+ "radius": 10+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Hinge",+ "quiet": true,+ "value": 90+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Gear:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-screw-lead-per-turn/expected.json b/tests/kernel-cases/assemblies/cov-joint-screw-lead-per-turn/expected.jsonnew file mode 100644index 0000000000..ac36de4ff4--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-screw-lead-per-turn/expected.json@@ -0,0 +1,41 @@+{+ "sources": [],+ "what": "a screw of lead 2 mm on a cylindrical joint, turned half a turn",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); joint.screw on cylindrical Spindle, pitch 2: ratio 2/360 mm per degree, so 180 degrees advance 1 mm: M = Rz(180)\u00b7T(0,0,1): (20,0,5) -> (-20,0,6)",+ "body_count": 2,+ "volume_mm3": 8000.0,+ "results": [+ {+ "step": 9,+ "json": {+ "ratio": 0.005556+ }+ },+ {+ "step": 10,+ "json": {+ "values": [+ {+ "value": 180.0+ },+ {+ "value": 1.0+ }+ ]+ }+ },+ {+ "step": 11,+ "json": {+ "total": {+ "center_of_mass": [+ -20.0,+ 0.0,+ 6.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-screw-lead-per-turn/recipe.json b/tests/kernel-cases/assemblies/cov-joint-screw-lead-per-turn/recipe.jsonnew file mode 100644index 0000000000..7cf91e944c--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-screw-lead-per-turn/recipe.json@@ -0,0 +1,131 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "cylindrical",+ "name": "Spindle",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.screw",+ "params": {+ "joint": "Spindle",+ "pitch": 2+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Spindle",+ "quiet": true,+ "value": 180+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Arm:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-screw-left-hand/expected.json b/tests/kernel-cases/assemblies/cov-joint-screw-left-hand/expected.jsonnew file mode 100644index 0000000000..152934c7c0--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-screw-left-hand/expected.json@@ -0,0 +1,41 @@+{+ "sources": [],+ "what": "a left-hand screw of lead 2 mm, turned half a turn",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); reverse: -2/360 mm per degree, 180 degrees retract 1 mm: (20,0,5) -> (-20,0,4)",+ "body_count": 2,+ "volume_mm3": 8000.0,+ "results": [+ {+ "step": 9,+ "json": {+ "ratio": -0.005556+ }+ },+ {+ "step": 10,+ "json": {+ "values": [+ {+ "value": 180.0+ },+ {+ "value": -1.0+ }+ ]+ }+ },+ {+ "step": 11,+ "json": {+ "total": {+ "center_of_mass": [+ -20.0,+ 0.0,+ 4.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-screw-left-hand/recipe.json b/tests/kernel-cases/assemblies/cov-joint-screw-left-hand/recipe.jsonnew file mode 100644index 0000000000..8079ed4648--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-screw-left-hand/recipe.json@@ -0,0 +1,132 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "cylindrical",+ "name": "Spindle",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.screw",+ "params": {+ "joint": "Spindle",+ "pitch": 2,+ "reverse": true+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Spindle",+ "quiet": true,+ "value": 180+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Arm:1"+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-screw-revolute-drives-slider/expected.json b/tests/kernel-cases/assemblies/cov-joint-screw-revolute-drives-slider/expected.jsonnew file mode 100644index 0000000000..0dac1cc867--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-screw-revolute-drives-slider/expected.json@@ -0,0 +1,28 @@+{+ "sources": [],+ "what": "a screw of lead 4 mm between a revolute and a slider",+ "source": "analytic",+ "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0), here on a slider along +x at (50,0,0); joint.screw a Hinge, b Rack, pitch 4: 90 degrees advance 4/4 = 1 mm: Gear centre (66,0,5)",+ "body_count": 3,+ "volume_mm3": 9000.0,+ "results": [+ {+ "step": 13,+ "json": {+ "ratio": 0.011111+ }+ },+ {+ "step": 15,+ "json": {+ "total": {+ "center_of_mass": [+ 66.0,+ 0.0,+ 5.0+ ]+ }+ }+ }+ ]+}diff --git a/tests/kernel-cases/assemblies/cov-joint-screw-revolute-drives-slider/recipe.json b/tests/kernel-cases/assemblies/cov-joint-screw-revolute-drives-slider/recipe.jsonnew file mode 100644index 0000000000..0e1c665504--- /dev/null+++ b/tests/kernel-cases/assemblies/cov-joint-screw-revolute-drives-slider/recipe.json@@ -0,0 +1,199 @@+{+ "commands": [+ {+ "command": "solid.box",+ "params": {+ "length": 20,+ "width": 20,+ "height": 10,+ "corner": [+ -10,+ -10,+ -10+ ],+ "operation": "new",+ "body_name": "BaseBox"+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 40,+ "width": 10,+ "height": 10,+ "corner": [+ 0,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "ArmBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Base",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "BaseBox"+ ],+ "component": "Base"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Arm",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "ArmBox"+ ],+ "component": "Arm"+ }+ },+ {+ "command": "occurrence.ground",+ "params": {+ "occurrence": "Base:1",+ "grounded": true+ }+ },+ {+ "command": "solid.box",+ "params": {+ "length": 10,+ "width": 10,+ "height": 10,+ "corner": [+ 60,+ -5,+ 0+ ],+ "operation": "new",+ "body_name": "GearBox"+ }+ },+ {+ "command": "component.create",+ "params": {+ "name": "Gear",+ "parent": "root",+ "activate": false+ }+ },+ {+ "command": "component.move_bodies",+ "params": {+ "bodies": [+ "GearBox"+ ],+ "component": "Gear"+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "revolute",+ "name": "Hinge",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "b": {+ "occurrence": "Arm",+ "point": [+ 0,+ 0,+ 0+ ],+ "z": [+ 0,+ 0,+ 1+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.create",+ "params": {+ "type": "slider",+ "name": "Rack",+ "flip": true,+ "a": {+ "occurrence": "Base",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "b": {+ "occurrence": "Gear",+ "point": [+ 50,+ 0,+ 0+ ],+ "z": [+ 1,+ 0,+ 0+ ]+ },+ "quiet": true+ }+ },+ {+ "command": "joint.screw",+ "params": {+ "a": "Hinge",+ "b": "Rack",+ "pitch": 4+ }+ },+ {+ "command": "joint.drive",+ "params": {+ "joint": "Hinge",+ "quiet": true,+ "value": 90+ }+ },+ {+ "command": "occurrence.properties",+ "params": {+ "occurrence": "Gear:1"+ }+ }+ ]+}