move_faces
Changing a solid · api.md § move_faces · all operations
definition
move_faces(s: Solid, faces: list<Point3>, matrix: Placement) -> Solid
Moves the faces that the points lie on rigidly by p ↦ R·p + t. The rows of matrix are [R | t], where R is a rotation. The faces round the moved faces are extended or trimmed to meet them, as a direct edit. Moving a hole's face across a plate moves the hole. Moving a notch's faces along a side moves the notch. Turning a side about its bottom edge leans the side. A plane moved along itself is the same plane.
faces must name one face or more, R must be a rotation, and the faces round the moved faces must reach them.
Example. Solid 1 is a 10 × 20 × 30 mm box with one corner at the origin.
> {"cmd": "move_faces", "s": 1, "faces": [[5, 10, 30]], "matrix": [[1, 0, 0, 0], [0, 1, 0, 0],
[0, 0, 1, 3]]}
< {"ok": 2}common to changing a solid
A face is named in the same way as an edge: each point names the face of s that the point lies on, within 10·ε.
| Function | Fields | Returns |
|---|---|---|
offset | s, distance | Solid |
offset_faces | s, faces, distance | Solid |
delete_faces | s, faces | Solid |
move_faces | s, faces, matrix | Solid |
thicken | s, faces, thickness | Solid |
shell | s, open, thickness | Solid |
draft | s, faces, origin, pull, angle | Solid |