Class: Transformation
Transformation lets you move, rotate, scale, mirror, and shear geometry in 3D space. Transformations are chainable -- you can build up a compound transform step by step and then apply it to points, vectors, planes, curves, or surfaces.
When to use
- Positioning objects -- translate and rotate solids or surfaces into their final locations.
- Creating patterns -- apply repeated transformations to produce arrays, circular patterns, or mirrored copies.
- Building assemblies -- combine coordinate-system changes and transforms to place parts relative to each other.
Quick start
Key methods
| Method | Description |
|---|---|
translate(vector) | Move by a translation vector |
rotate(angle, position) | Rotate by an angle (degrees) around a position |
scale(center, factor) | Uniform scale around a center point |
scaleNU(center, fx, fy, fz) | Non-uniform scale with separate axis factors |
mirror(plane) | Mirror across a plane ('XY', 'YZ', 'XZ', or a custom plane) |
mirrorCurve(curve) | Mirror a curve |
mirrorSurface(geom, surface) | Mirror a surface |
shear(refPoint, targetPoint) | Apply a shear transformation |
coordSystemChange(from, to) | Change between coordinate systems |
transformPoint(point) | Apply the transformation to a point |
applyTransformToVector(vector) | Apply the transformation to a vector |
applyTransformToPlane(plane) | Apply the transformation to a plane |
Method: translate
Translates the transformation by the given vector.
Parameters
vector(Point): The vector representing the translation.
Returns
The updated Transformation object.
Example
Method: rotate
Rotates the transformation by the specified angle around the given position and direction.
Parameters
angle(number): The angle of rotation in degrees.position(Point = [0): The position around which the rotation will occur. Defaults to [0, 0, 0].
Returns
The updated Transformation object.
Example
Method: mirror
Mirrors the transformation along a specified plane or point.
Parameters
inputPlane(IPlane | PlaneName | Point = 'YZ'): The plane or plane name to mirror the transformation along. Defaults to 'YZ'.
Returns
The transformed object with the mirror applied.
Example
Method: mirrorCurve
Mirrors a curve.
Parameters
crv(ICurve): The curve to be mirrored.
Returns
The mirrored curve.
Example
Method: mirrorSurface
Mirrors a surface based on a given geometry.
Parameters
geom(IGeometry): The geometry to mirror.srf(ISurface): The surface to mirror.
Returns
The mirrored surface transformation.
Example
Method: scale
Scales the transformation around the specified center point.
Parameters
center(Point): The center point of the scaling operation.scale(number): The scaling factor.
Returns
The modified Transformation object.
Example
Method: scaleNU
Scales the transformation around a specified center point.
Parameters
center(IVector): The center point of the scaling operation.factorX(number): The scaling factor along the X-axis.factorY(number): The scaling factor along the Y-axis.factorZ(number): The scaling factor along the Z-axis.
Returns
The modified Transformation object.
Example
Method: shear
Applies a shear transformation to the current Transformation object.
Parameters
referencePoint(IVector): The reference point for the shear transformation.targetPoint(IVector): The target point for the shear transformation.
Returns
The updated Transformation object after applying the shear transformation.
Example
Method: coordSystemChange
Changes the coordinate system from fromSystem to toSystem.
Parameters
fromSystem(CoordSystem): No descriptiontoSystem(CoordSystem): No description
Returns
The instance of the Transformation class.
Example
Method: transformPoint
Transforms a given point using the specified transformation.
Parameters
point(Point): The point to be transformed.
Returns
The transformed point.
Example
Method: applyTransformToVector
Applies a transformation to the given vector.
Parameters
vector(IVector): The vector to apply the transformation to.
Example
Method: applyTransformToPlane
Applies a transformation to a plane.
Parameters
plane(IPlane): The plane to apply the transformation to.
Returns
The transformed plane.
Example
Method: delete
Deletes the transformation and cleans up associated resources.