Business

Class: Transformation

Class represents a transformation in 3D space.

Example

const instance = new Transformation();
instance.constructor();

Method: translate

Translates the transformation by the given vector.

Parameters

  • vector (Point): The vector representing the translation.

Returns

The updated Transformation object.

Example

const vector = /* specify a vector */;
const instance = new Transformation();
instance.translate(vector);

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

const angle = 0.5;
const position = new Vector(0, 0, 0);
const instance = new Transformation();
instance.rotate(angle, position);

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

const inputPlane = /* specify a inputPlane */;
const instance = new Transformation();
instance.mirror(inputPlane);

Method: mirrorCurve

Mirrors a curve.

Parameters

  • crv (ICurve): The curve to be mirrored.

Returns

The mirrored curve.

Example

const crv = CurveBuilder.line(new Vector(0, 0, 0), new Vector(1, 1, 1));
const instance = new Transformation();
instance.mirrorCurve(crv);

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

const geom = /* specify a geom */;
const srf = /* specify a srf */;
const instance = new Transformation();
instance.mirrorSurface(geom, srf);

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

const center = new Vector(0, 0, 0);
const scale = 0.5;
const instance = new Transformation();
instance.scale(center, scale);

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

const center = new Vector(1, 1, 1);
const factorX = 0.5;
const factorY = 0.5;
const factorZ = 0.5;
const instance = new Transformation();
instance.scaleNU(center, factorX, factorY, factorZ);

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

const referencePoint = new Vector(1, 1, 1);
const targetPoint = new Vector(1, 1, 1);
const instance = new Transformation();
instance.shear(referencePoint, targetPoint);

Method: coordSystemChange

Changes the coordinate system from fromSystem to toSystem.

Parameters

  • fromSystem (CoordSystem): No description
  • toSystem (CoordSystem): No description

Returns

The instance of the Transformation class.

Example

const fromSystem = /* specify a fromSystem */;
const toSystem = /* specify a toSystem */;
const instance = new Transformation();
instance.coordSystemChange(fromSystem, toSystem);

Method: transformPoint

Transforms a given point using the specified transformation.

Parameters

  • point (Point): The point to be transformed.

Returns

The transformed point.

Example

const point = new Vector(0, 0, 0);
const instance = new Transformation();
instance.transformPoint(point);

Method: applyTransformToVector

Applies a transformation to the given vector.

Parameters

  • vector (IVector): The vector to apply the transformation to.

Example

const vector = new Vector(1, 1, 1);
const instance = new Transformation();
instance.applyTransformToVector(vector);

Method: applyTransformToPlane

Applies a transformation to a plane.

Parameters

  • plane (IPlane): The plane to apply the transformation to.

Returns

The transformed plane.

Example

const plane = /* specify a plane */;
const instance = new Transformation();
instance.applyTransformToPlane(plane);

Method: delete

Deletes the transformation and cleans up associated resources.

Example

const instance = new Transformation();
instance.delete();