meta data for this page
This is an old revision of the document!
Mirror
Shapes can reflect about the X, Y, or Z axis.
Learn about reflection at MathIsFun.com
Defaults:
- axis : 0 or [0, 0, 0], set 1 to reflect about X, Y, or Z axis
let obj = cube([5, 20, 5]) obj = mirror([1, 0, 1], obj) // mirror about X and Z axis
The CSG library functions can also be used. NOTE: Deprecated in the V2 API
var cube = CSG.cube().translate([1,0,0]) var cube2 = cube.mirroredX() // mirrored about the X axis var cube3 = cube.mirroredY() // mirrored about the Y axis var cube4 = cube.mirroredZ() // mirrored about the Z axis // create a plane by specifying 3 points: var plane = CSG.Plane.fromPoints([5,0,0], [5, 1, 0], [3, 1, 7]); // and mirror in that plane: var cube5 = cube.mirrored(plane);