meta data for this page
This is an old revision of the document!
Center
Shapes can be centered about the X, Y or Z axis.
Note: The center of a shape is calculated as the midpoint between minimal and maximum points.
Defaults:
- axes : [true, true, true]
- center : [0, 0, 0]
let myshape = sphere({radius: 5}) let newshape = center({}, myshape) // center the shape across all axes newshape = center({axes: [true, true, false]}, myshape) // center the object across only X and Y axis newshape = center({center: [5, 6, 7]}, myshape) // center the shape at the given center
There are also simple versions of this function to center about only one axis.
let myshape = sphere({radius: 5}) let newshape = centerX(myshape) newshape = centerY(newshape) newshape = centerZ(newshape)