Class represents a transformation in 3D space.
Constructors
new Transformation()
new Transformation(
transform
?):Transformation
Constructs a new instance of the Transformation class.
Parameters
• transform?: gp_Trsf
Optional transformation object.
Returns
Properties
_g_transform?
protected
optional
_g_transform:gp_GTrsf
_transform
protected
_transform:gp_Trsf
oc
protected
oc:OpenCascadeInstance
Methods
coordSystemChange()
coordSystemChange(
fromSystem
,toSystem
):this
Changes the coordinate system from fromSystem
to toSystem
.
Parameters
• fromSystem: CoordSystem
The source coordinate system.
• toSystem: CoordSystem
The target coordinate system.
Returns
this
The instance of the Transformation class.
delete()
delete():
void
Deletes the transformation and cleans up associated resources.
Returns
void
mirror()
mirror(
inputPlane
,inputOrigin
?):this
Mirrors the transformation along a specified plane or point.
Parameters
• inputPlane: Point
| PlaneName
| Plane
= 'YZ'
The plane or plane name to mirror the transformation along. Defaults to 'YZ'.
• inputOrigin?: Point
The origin point of the mirror plane. Defaults to [0, 0, 0].
Returns
this
The transformed object with the mirror applied.
mirrorCurve()
mirrorCurve(
crv
):Transformation
Mirrors a curve.
Parameters
• crv: Curve
The curve to be mirrored.
Returns
The mirrored curve.
mirrorSurface()
mirrorSurface(
geom
,srf
):Transformation
Mirrors a surface based on a given geometry.
Parameters
• geom: Geometry
The geometry to mirror.
• srf: Surface
The surface to mirror.
Returns
The mirrored surface transformation.
rotate()
rotate(
angle
,position
,direction
):Transformation
Rotates the transformation by the specified angle around the given position and direction.
Parameters
• angle: number
The angle of rotation in degrees.
• position: Point
= ...
The position around which the rotation will occur. Defaults to [0, 0, 0].
• direction: Point
= ...
The direction of the rotation axis. Defaults to [0, 0, 1].
Returns
The updated Transformation object.
scale()
scale(
center
,scale
):this
Scales the transformation around the specified center point.
Parameters
• center: Point
The center point of the scaling operation.
• scale: number
The scaling factor.
Returns
this
The modified Transformation object.
scaleNU()
scaleNU(
center
,factorX
,factorY
,factorZ
):this
Scales the transformation around a specified center point.
Parameters
• center: Vector
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
this
The modified Transformation object.
shear()
shear(
referencePoint
,targetPoint
):this
Applies a shear transformation to the current Transformation object.
Parameters
• referencePoint: Vector
The reference point for the shear transformation.
• targetPoint: Vector
The target point for the shear transformation.
Returns
this
The updated Transformation object after applying the shear transformation.
transform()
transform<
T
>(geometry
):T
Applies a transformation to the given geometry.
Type Parameters
• T extends Vector
| Plane
| Geometry
The type of the geometry.
Parameters
• geometry: T
The geometry to be transformed.
Returns
T
- The transformed geometry.
transformPoint()
transformPoint(
point
):gp_Pnt
Transforms a given point using the specified transformation.
Parameters
• point: Point
The point to be transformed.
Returns
gp_Pnt
The transformed point.
translate()
translate(
vector
):Transformation
Translates the transformation by the given vector.
Parameters
• vector: Point
The vector representing the translation.
Returns
The updated Transformation object.