diff --git a/tests/kernel-cases/assemblies/cov-joint-as-built-keeps-the-arm-where-it-is/expected.json b/tests/kernel-cases/assemblies/cov-joint-as-built-keeps-the-arm-where-it-is/expected.json new file mode 100644 index 000000000..203a8a558 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-as-built-keeps-the-arm-where-it-is/expected.json @@ -0,0 +1,44 @@ +{ + "sources": [], + "what": "an as-built revolute on an arm lifted 20 mm, then driven 90 degrees", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Arm moved by (0,0,20) first, then joint.as_built revolute about z through the origin: it stays at (20,0,25); a drive to 90 turns it to (0,20,25)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 20.0, + 0.0, + 25.0 + ] + } + } + }, + { + "step": 11, + "json": { + "values": [ + { + "value": 90.0 + } + ] + } + }, + { + "step": 12, + "json": { + "total": { + "center_of_mass": [ + 0.0, + 20.0, + 25.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-as-built-keeps-the-arm-where-it-is/recipe.json b/tests/kernel-cases/assemblies/cov-joint-as-built-keeps-the-arm-where-it-is/recipe.json new file mode 100644 index 000000000..732cb60b6 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-as-built-keeps-the-arm-where-it-is/recipe.json @@ -0,0 +1,129 @@ +{ + "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": "occurrence.move", + "params": { + "occurrence": "Arm:1", + "translate": [ + 0, + 0, + 20 + ] + } + }, + { + "command": "joint.as_built", + "params": { + "type": "revolute", + "a": "Base", + "b": "Arm", + "at": { + "occurrence": "Base", + "point": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ] + }, + "name": "Hinge", + "quiet": true + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Hinge", + "quiet": true, + "value": 90 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-as-built-slider-with-limits/expected.json b/tests/kernel-cases/assemblies/cov-joint-as-built-slider-with-limits/expected.json new file mode 100644 index 000000000..9d3e90215 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-as-built-slider-with-limits/expected.json @@ -0,0 +1,44 @@ +{ + "sources": [], + "what": "an as-built slider along +x with limits -5..5, driven to 20", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); joint.as_built keeps Arm at (20,0,5); 20 is clamped to 5: centre (25,0,5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "total": { + "center_of_mass": [ + 20.0, + 0.0, + 5.0 + ] + } + } + }, + { + "step": 10, + "json": { + "values": [ + { + "value": 5.0 + } + ] + } + }, + { + "step": 11, + "json": { + "total": { + "center_of_mass": [ + 25.0, + 0.0, + 5.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-as-built-slider-with-limits/recipe.json b/tests/kernel-cases/assemblies/cov-joint-as-built-slider-with-limits/recipe.json new file mode 100644 index 000000000..222524c9b --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-as-built-slider-with-limits/recipe.json @@ -0,0 +1,124 @@ +{ + "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.as_built", + "params": { + "type": "slider", + "a": "Base", + "b": "Arm", + "at": { + "occurrence": "Base", + "point": [ + 0, + 0, + 5 + ], + "z": [ + 1, + 0, + 0 + ] + }, + "name": "Slide", + "limits": [ + [ + -5, + 5 + ] + ], + "quiet": true + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Slide", + "quiet": true, + "value": 20 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-ball-yaw-and-pitch/expected.json b/tests/kernel-cases/assemblies/cov-joint-ball-yaw-and-pitch/expected.json new file mode 100644 index 000000000..f200da4e0 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-ball-yaw-and-pitch/expected.json @@ -0,0 +1,50 @@ +{ + "sources": [], + "what": "a ball joint driven to yaw 90 and pitch 90", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); ball with frame z = +z, x = +x: M = Rz(yaw)\u00b7Ry(pitch)\u00b7Rz(roll); Ry(90): (x,y,z) -> (z,y,-x), then Rz(90): (x,y) -> (-y,x): (20,0,5) -> (5,0,-20) -> (0,5,-20); box x -5..5, y 0..10, z -40..0", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 90.0 + }, + { + "value": 90.0 + }, + { + "value": 0.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 0.0, + 5.0, + -20.0 + ], + "bbox": { + "min": [ + -5.0, + 0.0, + -40.0 + ], + "max": [ + 5.0, + 10.0, + 0.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-ball-yaw-and-pitch/recipe.json b/tests/kernel-cases/assemblies/cov-joint-ball-yaw-and-pitch/recipe.json new file mode 100644 index 000000000..0399ddfe0 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-ball-yaw-and-pitch/recipe.json @@ -0,0 +1,142 @@ +{ + "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": "ball", + "name": "Socket", + "flip": true, + "a": { + "occurrence": "Base", + "frame": { + "origin": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ], + "x": [ + 1, + 0, + 0 + ] + } + }, + "b": { + "occurrence": "Arm", + "frame": { + "origin": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ], + "x": [ + 1, + 0, + 0 + ] + } + }, + "quiet": true + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Socket", + "quiet": true, + "values": [ + 90, + 90, + 0 + ] + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-cylindrical-turn-and-slide/expected.json b/tests/kernel-cases/assemblies/cov-joint-cylindrical-turn-and-slide/expected.json new file mode 100644 index 000000000..55da6233c --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-cylindrical-turn-and-slide/expected.json @@ -0,0 +1,47 @@ +{ + "sources": [], + "what": "a cylindrical joint about z driven to 90 degrees and 7 mm", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); cylindrical about z: M = Rz(90)\u00b7T(0,0,7): (20,0,5) -> (20,0,12) -> (0,20,12)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 90.0 + }, + { + "value": 7.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 0.0, + 20.0, + 12.0 + ], + "bbox": { + "min": [ + -5.0, + 0.0, + 7.0 + ], + "max": [ + 5.0, + 40.0, + 17.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-cylindrical-turn-and-slide/recipe.json b/tests/kernel-cases/assemblies/cov-joint-cylindrical-turn-and-slide/recipe.json new file mode 100644 index 000000000..39e495d88 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-cylindrical-turn-and-slide/recipe.json @@ -0,0 +1,127 @@ +{ + "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.drive", + "params": { + "joint": "Spindle", + "quiet": true, + "values": [ + 90, + 7 + ] + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-limits-new-joint-starts-at-the-nearer-limit/expected.json b/tests/kernel-cases/assemblies/cov-joint-limits-new-joint-starts-at-the-nearer-limit/expected.json new file mode 100644 index 000000000..7243d6e85 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-limits-new-joint-starts-at-the-nearer-limit/expected.json @@ -0,0 +1,22 @@ +{ + "sources": [], + "what": "a new revolute whose limits 10..60 leave out its start value 0", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); a new joint starts at 0; outside its limits it starts at the nearer one, 10: centre (20 cos10, 20 sin10, 5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "total": { + "center_of_mass": [ + 19.696155, + 3.472964, + 5.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-limits-new-joint-starts-at-the-nearer-limit/recipe.json b/tests/kernel-cases/assemblies/cov-joint-limits-new-joint-starts-at-the-nearer-limit/recipe.json new file mode 100644 index 000000000..3910ef14c --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-limits-new-joint-starts-at-the-nearer-limit/recipe.json @@ -0,0 +1,122 @@ +{ + "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": "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, + "limits": [ + [ + 10, + 60 + ] + ] + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-limits-set-then-drive-past/expected.json b/tests/kernel-cases/assemblies/cov-joint-limits-set-then-drive-past/expected.json new file mode 100644 index 000000000..96a43ccce --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-limits-set-then-drive-past/expected.json @@ -0,0 +1,32 @@ +{ + "sources": [], + "what": "joint.limits -10..45 on a revolute, then a drive to 90", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); limits set afterwards clamp the same way: 90 -> 45, centre (20 cos45, 20 sin45, 5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 10, + "json": { + "values": [ + { + "value": 45.0 + } + ] + } + }, + { + "step": 11, + "json": { + "total": { + "center_of_mass": [ + 14.142136, + 14.142136, + 5.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-limits-set-then-drive-past/recipe.json b/tests/kernel-cases/assemblies/cov-joint-limits-set-then-drive-past/recipe.json new file mode 100644 index 000000000..9598f4e00 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-limits-set-then-drive-past/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": "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.limits", + "params": { + "joint": "Hinge", + "min": -10, + "max": 45 + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Hinge", + "quiet": true, + "value": 90 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-pin-slot-turn-then-slide/expected.json b/tests/kernel-cases/assemblies/cov-joint-pin-slot-turn-then-slide/expected.json new file mode 100644 index 000000000..a370c5ccb --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-pin-slot-turn-then-slide/expected.json @@ -0,0 +1,47 @@ +{ + "sources": [], + "what": "a pin-slot joint driven to 90 degrees and a 7 mm slide", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); pin_slot with frame z = +z, x = +x at the origin: M = T(slide along x)\u00b7Rz(angle): (20,0,5) -> (0,20,5) -> (7,20,5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 90.0 + }, + { + "value": 7.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 7.0, + 20.0, + 5.0 + ], + "bbox": { + "min": [ + 2.0, + 0.0, + 0.0 + ], + "max": [ + 12.0, + 40.0, + 10.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-pin-slot-turn-then-slide/recipe.json b/tests/kernel-cases/assemblies/cov-joint-pin-slot-turn-then-slide/recipe.json new file mode 100644 index 000000000..ce04728a9 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-pin-slot-turn-then-slide/recipe.json @@ -0,0 +1,141 @@ +{ + "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": "pin_slot", + "name": "Slot", + "flip": true, + "a": { + "occurrence": "Base", + "frame": { + "origin": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ], + "x": [ + 1, + 0, + 0 + ] + } + }, + "b": { + "occurrence": "Arm", + "frame": { + "origin": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ], + "x": [ + 1, + 0, + 0 + ] + } + }, + "quiet": true + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Slot", + "quiet": true, + "values": [ + 90, + 7 + ] + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-planar-move-and-turn/expected.json b/tests/kernel-cases/assemblies/cov-joint-planar-move-and-turn/expected.json new file mode 100644 index 000000000..d21bf54f6 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-planar-move-and-turn/expected.json @@ -0,0 +1,50 @@ +{ + "sources": [], + "what": "a planar joint driven to x 3, y 4 and 90 degrees", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); planar with frame z = +z, x = +x: M = T(3,4,0)\u00b7Rz(90): (20,0,5) -> (0,20,5) -> (3,24,5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 3.0 + }, + { + "value": 4.0 + }, + { + "value": 90.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 3.0, + 24.0, + 5.0 + ], + "bbox": { + "min": [ + -2.0, + 4.0, + 0.0 + ], + "max": [ + 8.0, + 44.0, + 10.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-planar-move-and-turn/recipe.json b/tests/kernel-cases/assemblies/cov-joint-planar-move-and-turn/recipe.json new file mode 100644 index 000000000..d2874d2ee --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-planar-move-and-turn/recipe.json @@ -0,0 +1,142 @@ +{ + "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": "planar", + "name": "Table", + "flip": true, + "a": { + "occurrence": "Base", + "frame": { + "origin": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ], + "x": [ + 1, + 0, + 0 + ] + } + }, + "b": { + "occurrence": "Arm", + "frame": { + "origin": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ], + "x": [ + 1, + 0, + 0 + ] + } + }, + "quiet": true + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Table", + "quiet": true, + "values": [ + 3, + 4, + 90 + ] + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-revolute-drive-past-the-limit-is-clamped/expected.json b/tests/kernel-cases/assemblies/cov-joint-revolute-drive-past-the-limit-is-clamped/expected.json new file mode 100644 index 000000000..1724f013c --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-revolute-drive-past-the-limit-is-clamped/expected.json @@ -0,0 +1,32 @@ +{ + "sources": [], + "what": "a revolute with limits -30..30 driven to 90", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); a drive past a joint's limits is clamped to them: 90 -> 30, centre (20 cos30, 20 sin30, 5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 30.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 17.320508, + 10.0, + 5.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-revolute-drive-past-the-limit-is-clamped/recipe.json b/tests/kernel-cases/assemblies/cov-joint-revolute-drive-past-the-limit-is-clamped/recipe.json new file mode 100644 index 000000000..be381f207 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-revolute-drive-past-the-limit-is-clamped/recipe.json @@ -0,0 +1,130 @@ +{ + "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": "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, + "limits": [ + [ + -30, + 30 + ] + ] + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Hinge", + "quiet": true, + "value": 90 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-revolute-quarter-turn/expected.json b/tests/kernel-cases/assemblies/cov-joint-revolute-quarter-turn/expected.json new file mode 100644 index 000000000..97db92b84 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-revolute-quarter-turn/expected.json @@ -0,0 +1,44 @@ +{ + "sources": [], + "what": "a revolute joint driven 90 degrees", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); revolute about z through the origin, driven to 90: (x,y) -> (-y,x), Arm's box becomes x -5..5, y 0..40", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 90.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 0.0, + 20.0, + 5.0 + ], + "bbox": { + "min": [ + -5.0, + 0.0, + 0.0 + ], + "max": [ + 5.0, + 40.0, + 10.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-revolute-quarter-turn/recipe.json b/tests/kernel-cases/assemblies/cov-joint-revolute-quarter-turn/recipe.json new file mode 100644 index 000000000..24a638396 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-revolute-quarter-turn/recipe.json @@ -0,0 +1,124 @@ +{ + "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": "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.drive", + "params": { + "joint": "Hinge", + "quiet": true, + "value": 90 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-rigid-group-moves-together/expected.json b/tests/kernel-cases/assemblies/cov-joint-rigid-group-moves-together/expected.json new file mode 100644 index 000000000..d04c59a1c --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-rigid-group-moves-together/expected.json @@ -0,0 +1,34 @@ +{ + "sources": [], + "what": "Arm and Gear in a rigid group, the arm 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 from (60,-5,0), centre (65,0,5), rigid-grouped with Arm: both turn about z through the origin: Gear (65,0,5) -> (0,65,5)", + "body_count": 3, + "volume_mm3": 9000.0, + "results": [ + { + "step": 14, + "json": { + "total": { + "center_of_mass": [ + 0.0, + 65.0, + 5.0 + ] + } + } + }, + { + "step": 15, + "json": { + "total": { + "center_of_mass": [ + 0.0, + 20.0, + 5.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-rigid-group-moves-together/recipe.json b/tests/kernel-cases/assemblies/cov-joint-rigid-group-moves-together/recipe.json new file mode 100644 index 000000000..184d04727 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-rigid-group-moves-together/recipe.json @@ -0,0 +1,171 @@ +{ + "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.rigid_group", + "params": { + "occurrences": [ + "Arm:1", + "Gear:1" + ] + } + }, + { + "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.drive", + "params": { + "joint": "Hinge", + "quiet": true, + "value": 90 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Gear:1" + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-rigid-holds-the-arm-where-it-is/expected.json b/tests/kernel-cases/assemblies/cov-joint-rigid-holds-the-arm-where-it-is/expected.json new file mode 100644 index 000000000..1d09f6dca --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-rigid-holds-the-arm-where-it-is/expected.json @@ -0,0 +1,41 @@ +{ + "sources": [], + "what": "a rigid joint between two blocks made where they sit", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); rigid with equal origins and flip: B = F\u00b7I\u00b7F^-1 = I, so Arm stays at (20,0,5) with 0 degrees of freedom left", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "conflicts": [], + "errors": [] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 20.0, + 0.0, + 5.0 + ], + "bbox": { + "min": [ + 0.0, + -5.0, + 0.0 + ], + "max": [ + 40.0, + 5.0, + 10.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-rigid-holds-the-arm-where-it-is/recipe.json b/tests/kernel-cases/assemblies/cov-joint-rigid-holds-the-arm-where-it-is/recipe.json new file mode 100644 index 000000000..7c11c34c3 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-rigid-holds-the-arm-where-it-is/recipe.json @@ -0,0 +1,120 @@ +{ + "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": "rigid", + "name": "Glue", + "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.solve", + "params": {} + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-rigid-with-an-offset-lifts-the-arm/expected.json b/tests/kernel-cases/assemblies/cov-joint-rigid-with-an-offset-lifts-the-arm/expected.json new file mode 100644 index 000000000..93f30c0d6 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-rigid-with-an-offset-lifts-the-arm/expected.json @@ -0,0 +1,34 @@ +{ + "sources": [], + "what": "a rigid joint with an offset of 5 mm along its z", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); rigid, flip, offset 5: B's frame sits 5 mm up A's z, so Arm moves by (0,0,5): centre (20,0,10)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "total": { + "center_of_mass": [ + 20.0, + 0.0, + 10.0 + ], + "bbox": { + "min": [ + 0.0, + -5.0, + 5.0 + ], + "max": [ + 40.0, + 5.0, + 15.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-rigid-with-an-offset-lifts-the-arm/recipe.json b/tests/kernel-cases/assemblies/cov-joint-rigid-with-an-offset-lifts-the-arm/recipe.json new file mode 100644 index 000000000..8017c9946 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-rigid-with-an-offset-lifts-the-arm/recipe.json @@ -0,0 +1,117 @@ +{ + "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": "rigid", + "name": "Glue", + "flip": true, + "offset": 5, + "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": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-slider-along-x/expected.json b/tests/kernel-cases/assemblies/cov-joint-slider-along-x/expected.json new file mode 100644 index 000000000..4d3531911 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-slider-along-x/expected.json @@ -0,0 +1,44 @@ +{ + "sources": [], + "what": "a slider along +x driven 15 mm", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); slider with z = +x at (0,0,5), driven to 15: Arm moves by (15,0,0), centre (35,0,5)", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 15.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 35.0, + 0.0, + 5.0 + ], + "bbox": { + "min": [ + 15.0, + -5.0, + 0.0 + ], + "max": [ + 55.0, + 5.0, + 10.0 + ] + } + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-slider-along-x/recipe.json b/tests/kernel-cases/assemblies/cov-joint-slider-along-x/recipe.json new file mode 100644 index 000000000..ab9f637e9 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-slider-along-x/recipe.json @@ -0,0 +1,124 @@ +{ + "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": "slider", + "name": "Slide", + "flip": true, + "a": { + "occurrence": "Base", + "point": [ + 0, + 0, + 5 + ], + "z": [ + 1, + 0, + 0 + ] + }, + "b": { + "occurrence": "Arm", + "point": [ + 0, + 0, + 5 + ], + "z": [ + 1, + 0, + 0 + ] + }, + "quiet": true + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Slide", + "quiet": true, + "value": 15 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-slider-drive-past-the-limit-is-clamped/expected.json b/tests/kernel-cases/assemblies/cov-joint-slider-drive-past-the-limit-is-clamped/expected.json new file mode 100644 index 000000000..5c000fe74 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-slider-drive-past-the-limit-is-clamped/expected.json @@ -0,0 +1,54 @@ +{ + "sources": [], + "what": "a slider with limits 0..10 driven to 15 and to -4", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); slider along +x, limits [0,10]: 15 -> 10 (centre (30,0,5)), then -4 -> 0 (centre (20,0,5))", + "body_count": 2, + "volume_mm3": 8000.0, + "results": [ + { + "step": 9, + "json": { + "values": [ + { + "value": 10.0 + } + ] + } + }, + { + "step": 10, + "json": { + "total": { + "center_of_mass": [ + 30.0, + 0.0, + 5.0 + ] + } + } + }, + { + "step": 11, + "json": { + "values": [ + { + "value": 0.0 + } + ] + } + }, + { + "step": 12, + "json": { + "total": { + "center_of_mass": [ + 20.0, + 0.0, + 5.0 + ] + } + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-slider-drive-past-the-limit-is-clamped/recipe.json b/tests/kernel-cases/assemblies/cov-joint-slider-drive-past-the-limit-is-clamped/recipe.json new file mode 100644 index 000000000..05d3594d9 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-slider-drive-past-the-limit-is-clamped/recipe.json @@ -0,0 +1,144 @@ +{ + "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": "slider", + "name": "Slide", + "flip": true, + "limits": [ + [ + 0, + 10 + ] + ], + "a": { + "occurrence": "Base", + "point": [ + 0, + 0, + 5 + ], + "z": [ + 1, + 0, + 0 + ] + }, + "b": { + "occurrence": "Arm", + "point": [ + 0, + 0, + 5 + ], + "z": [ + 1, + 0, + 0 + ] + }, + "quiet": true + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Slide", + "quiet": true, + "value": 15 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + }, + { + "command": "joint.drive", + "params": { + "joint": "Slide", + "quiet": true, + "value": -4 + } + }, + { + "command": "occurrence.properties", + "params": { + "occurrence": "Arm:1" + } + } + ] +} diff --git a/tests/kernel-cases/assemblies/cov-joint-two-origins-on-one-part-refused/expected.json b/tests/kernel-cases/assemblies/cov-joint-two-origins-on-one-part-refused/expected.json new file mode 100644 index 000000000..bbc41b9d7 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-two-origins-on-one-part-refused/expected.json @@ -0,0 +1,8 @@ +{ + "sources": [], + "what": "a joint whose two origins are on the same occurrence", + "source": "analytic", + "method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); a joint needs two different occurrences: both origins on Arm is refused", + "outcome": "refused", + "refusal": "two different occurrences" +} diff --git a/tests/kernel-cases/assemblies/cov-joint-two-origins-on-one-part-refused/recipe.json b/tests/kernel-cases/assemblies/cov-joint-two-origins-on-one-part-refused/recipe.json new file mode 100644 index 000000000..f582f4139 --- /dev/null +++ b/tests/kernel-cases/assemblies/cov-joint-two-origins-on-one-part-refused/recipe.json @@ -0,0 +1,109 @@ +{ + "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": "revolute", + "name": "Self", + "flip": true, + "a": { + "occurrence": "Arm", + "point": [ + 0, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ] + }, + "b": { + "occurrence": "Arm", + "point": [ + 10, + 0, + 0 + ], + "z": [ + 0, + 0, + 1 + ] + } + } + } + ] +}