User Tools


Reflect

Shapes can reflect about the X, Y, or Z axis.

Learn about reflection at MathIsFun.com

Defaults:

  • degree : 0 or [0,0,0]
let obj = cube([5, 20, 5])
obj = mirror([10, 20, 90], obj)

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 in the x=0 plane
var cube3 = cube.mirroredY() // mirrored in the y=0 plane
var cube4 = cube.mirroredZ() // mirrored in the z=0 plane
 
// 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);