transform
Moving a solid · api.md § transform · all operations
definition
transform(s: Solid, matrix: Number[3][4]) -> Solid
Moves the solid by p ↦ M·p + t, where the rows of matrix are [M | t].
M must be a similarity: an orthogonal matrix (a rotation or a mirror) times a nonzero scale c. The result's volume is |c|³ times the solid's volume, and its area is c² times the solid's area. A mirror keeps the result a valid solid, with its faces still facing outward. A part is joined to its own mirror image by a transform and a union. Where the part has a face on the mirror plane, the part and its image meet face to face.
Example. Solid 1 is a 10 × 20 × 30 mm box with one corner at the origin.
> {"cmd": "transform", "s": 1, "matrix": [[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0]]}
< {"ok": 2}