Defines an axis as a combination of point and direction.
new Axis1d(
location?,direction?):Axis1d
Creates an axis.
If no arguments are provided, the axis is created at `Point.origin()` (that is, (0, 0, 0)) with `Direction.zDir()` (that is, (0, 0, 1)). The provided point and direction are copied, so later changes to the original objects do not affect this axis.
Point = ...
Location point of the axis.
Direction = ...
Direction of the axis.
Axis1d
readonlydirection:Direction
Direction of the axis.
readonlylocation:Point
Location point of the axis.
clone():
Axis1d
Creates a new axis with the same location and direction as this axis.
Axis1d
copy(
other):this
Copies the location and direction of other to this axis.
The values of the point and direction are copied without replacing the existing location and direction objects of this axis.
Axis1d
Axis to copy.
this
isCoaxial(
other,angularTolerance?,distanceTolerance?,allowOpposite?):boolean
Returns true if other axis is coaxial to this axis.
Axis1d
Other axis.
number = Axis1d.angularTolerance
Angular tolerance. Defaults to 1e-5.
number = Axis1d.coincidenceTolerance
Distance tolerance. Defaults to 1e-7.
boolean = false
Whether opposite directions are allowed to be considered coaxial. Defaults to false.
boolean
mirror(
point):this
Mirrors this axis relative to a point.
Other point.
this
mirror(
axis):this
Mirrors this axis relative to an axis.
Axis1d
Axis.
this
mirror(
axis):this
Mirrors this axis relative to an axis.
Axis.
this
mirrored(
point):Axis1d
Returns a new axis obtained by applying mirror() to this axis.
Point.
Axis1d
mirrored(
axis):Axis1d
Returns a new axis obtained by applying mirror() to this axis.
Axis1d
Axis.
Axis1d
mirrored(
axis):Axis1d
Returns a new axis obtained by applying mirror() to this axis.
Axis.
Axis1d
staticox():Axis1d
Returns an OX axis.
The returned axis has location at `Point.origin()` (that is, (0, 0, 0)) and direction equal to `Direction.xDir()` (that is, (1, 0, 0)).
Axis1d
staticoy():Axis1d
Returns an OY axis.
The returned axis has location at `Point.origin()` (that is, (0, 0, 0)) and direction equal to `Direction.yDir()` (that is, (0, 1, 0)).
Axis1d
staticoz():Axis1d
Returns an OZ axis.
The returned axis has location at `Point.origin()` (that is, (0, 0, 0)) and direction equal to `Direction.zDir()` (that is, (0, 0, 1)).
Axis1d
reverse():
this
Reverses the direction of this axis.
this
reversed():
Axis1d
Returns a new axis with the direction obtained by applying reverse() to this axis.
Axis1d
rotate(
axis,angle):this
Rotates this axis around axis by angle.
Axis1d
Rotation axis.
number
Rotation angle.
this
rotated(
axis,angle):Axis1d
Returns a new axis obtained by applying rotate() to this axis.
Axis1d
Rotation axis.
number
Rotation angle.
Axis1d
scale(
point,scale):this
Scales the location of this axis.
If scale is negative, the direction of the axis is reversed.
Other point.
number
Scale value.
this
scaled(
point,scale):Axis1d
Returns a new axis with the location obtained by applying scale() to this axis.
Other point.
number
Scale value.
Axis1d
transform(
transformation):this
Transforms this axis according to transformation.
Transformation.
this
transformed(
transformation):Axis1d
Returns a new axis obtained by applying transform() to this axis.
Transformation.
Axis1d
translate(
vector):this
Translates this axis.
Translation vector.
this
translated(
vector):Axis1d
Returns a new axis obtained by applying translate() to this axis.
Translation vector.
Axis1d