meta data for this page
  •  

Shape Transformations

The 'transforms' are accessed through the modeling API using the following:

const { translate, scale, rotateX } = require('@jscad/modeling').transforms
Transform Notes
const newshape = align({modes: ['min', 'center', 'none'], relativeTo: [10, null, 10], grouped: true}, oldshape) API
const newshape = center({axes: [true, true, false], center: [15, 10, 0]}, oldshape) API
const newshape = centerX(oldshape) API
const newshape = centerY(oldshape) API
const newshape = centerZ(oldshape) API
const newshape = mirror({origin: [5, 5, 5], normal: [0, 0, 10]}, oldshape)) API
const newshape = mirrorX(oldshape) API
const newshape = mirrorY(oldshape) API
const newshape = mirrorZ(oldshape) API
const newshape = rotate([Math.PI / 4, 0, 0], oldshape) API
const newshape = rotateX(oldshape) API
const newshape = rotateY(oldshape) API
const newshape = rotateZ(oldshape) API
const newshape = scale([5, 0, 10], oldshape) API
const newshape = scaleX(5, oldshape) API
const newshape = scaleY(0.5, oldshape) API
const newshape = scaleZ(5, oldshape) API
const newshape = transform(mat4.rotateX(Math.PI/4), oldshape) API
const newshape = translate([5, 0, 10], oldshape) API
const newshape = translateX(5, oldshape) API
const newshape = translateY(0.5, oldshape) API
const newshape = translateZ(5, oldshape) API