Hide menu
Loading...
Searching...
No Matches
Axis3d

Defines a right-handed or left-handed axis in 3D.

An axis is defined by a location point and three perpendicular directions. axis defines the Z direction of the axis.

Constructors

Constructor

new Axis3d(location?, axis?, xReferenceDirection?): Axis3d

Creates an axis.

By default, creates an axis with location `Point.origin()` (0, 0, 0), xDirection `Direction.xDir()` (1, 0, 0), yDirection `Direction.yDir()` (0, 1, 0), and axis `Direction.zDir()` (0, 0, 1).

The provided location point and directions are copied.

Parameters

location?

Point = ...

Location point of the axis.

axis?

Direction = ...

Z direction of the axis.

xReferenceDirection?

Direction

Reference direction used to compute xDirection and yDirection. If omitted, a perpendicular X direction is computed automatically.

Returns

Axis3d

Properties

location

readonly location: Point

Location point of the axis.

Accessors

axis

Get Signature

get axis(): Direction

Z direction of the axis.

Returns

Direction


xDirection

Get Signature

get xDirection(): Direction

X direction of the axis.

Returns

Direction


yDirection

Get Signature

get yDirection(): Direction

Y direction of the axis.

Returns

Direction

Methods

clone()

clone(): Axis3d

Creates a new axis with the same location, xDirection, yDirection, and axis as this axis.

Returns

Axis3d


copy()

copy(other): this

Copies the location, xDirection, yDirection, and axis of other to this axis.

The values of the point and directions are copied without replacing the existing point and direction objects of this axis.

Parameters

other

Axis3d

Axis to copy.

Returns

this


isRightHanded()

isRightHanded(): boolean

Returns true if the axis is right-handed, false otherwise.

Returns

boolean


mirror()

Call Signature

mirror(point): this

Mirrors the axis about a point.

Parameters

point

Point

Other point.

Returns

this

Call Signature

mirror(axis): this

Mirrors the axis about an axis.

Parameters

axis

Axis1d

Axis.

Returns

this

Call Signature

mirror(axis): this

Mirrors the axis about another axis placement.

Parameters

axis

Axis3d

Axis.

Returns

this


mirrored()

Call Signature

mirrored(point): Axis3d

Creates a mirrored copy of the axis.

Parameters

point

Point

Point.

Returns

Axis3d

Call Signature

mirrored(axis): Axis3d

Creates a mirrored copy of the axis.

Parameters

axis

Axis1d

Axis.

Returns

Axis3d

Call Signature

mirrored(axis): Axis3d

Creates a mirrored copy of the axis.

Parameters

axis

Axis3d

Axis.

Returns

Axis3d


reverse()

reverse(): this

Reverses the directions of the axis.

Returns

this


reversed()

reversed(): Axis3d

Creates a copy of the axis with reversed directions.

Returns

Axis3d


rotate()

rotate(axis, angle): this

Rotates the axis around another axis.

Parameters

axis

Axis1d

Rotation axis.

angle

number

Rotation angle.

Returns

this


rotated()

rotated(axis, angle): Axis3d

Creates a rotated copy of the axis.

Parameters

axis

Axis1d

Rotation axis.

angle

number

Rotation angle.

Returns

Axis3d


scale()

scale(point, scale): this

Scales the location point of the axis.

If scale is negative, the axis directions are reversed.

Parameters

point

Point

Other point.

scale

number

Scale value.

Returns

this


scaled()

scaled(point, scale): Axis3d

Creates a copy of the axis and scales its location point.

If scale is negative, the axis directions of the returned object are reversed.

Parameters

point

Point

Other point.

scale

number

Scale value.

Returns

Axis3d


transform()

transform(transformation): this

Transforms the axis.

Parameters

transformation

Transformation

Transformation.

Returns

this


transformed()

transformed(transformation): Axis3d

Creates a transformed copy of the axis.

Parameters

transformation

Transformation

Transformation.

Returns

Axis3d


translate()

translate(vector): this

Translates the axis.

Parameters

vector

Vector

Translation vector.

Returns

this


translated()

translated(vector): Axis3d

Creates a translated copy of the axis.

Parameters

vector

Vector

Translation vector.

Returns

Axis3d