Skip to content

7. Transform shapes

raydeleu edited this page Jun 22, 2024 · 3 revisions

The transform functions require a 3D shape or face. As explained in Section 3, sketches can not be transformed. If you want to transform a sketch, use the draw() function.

transformedShape = shape."transformCommand"

.translate([dx,dy,dz])

Translate a part over distance dx,dy,dz along the respective axis

.translateX(dx)

Translate a part along the x-axis only

.translateY(dy)

Translate a part along the y-axis only

.translateZ(dz)

Translate a part along the z-axis only

.rotate(angleDeg,axisOrigin[x,y,z],axisEnd[x,y,z])

Rotate a part over the indicated degrees along an axis defined by two points

.scale(number)

Scale the part equally in all directions

.mirror("YZ",[-10,0])

Mirror the part in a given plane