A cylinder is defined by its axis, radius, and height. The axis location is the center of the cylinder.
new Cylinder(
axis?,radius?,height?):Cylinder
Creates a cylinder from an axis, radius, and height.
The provided axis is copied, so later changes to the original object do not affect this cylinder. If radius or height is omitted, the corresponding value remains 0. Negative radius and height values are clamped to 0.
Axis of the cylinder.
number
Outer radius of the cylinder.
number
Height of the cylinder along the axis.
Cylinder
get axis():
Axis1d
Axis of the cylinder.
Assigning a new axis copies its values without replacing the existing object returned by this property.
set axis(
axis):void
Sets the axis of the cylinder.
The values of axis are copied without replacing the existing axis object.
Axis of the cylinder.
void
get center():
Point
Copy of the cylinder center point.
get height():
number
Height of the cylinder along its axis.
Negative values are stored as 0.
number
set height(
height):void
Sets the height of the cylinder along its axis.
Negative values are stored as 0.
number
Height of the cylinder along the axis.
void
get radius():
number
Outer radius of the cylinder.
Negative values are stored as 0.
number
set radius(
radius):void
Sets the outer radius of the cylinder.
Negative values are stored as 0.
number
Outer radius of the cylinder.
void
get surfaceArea():
number
Surface area of the cylinder.
number
get volume():
number
Volume of the cylinder.
number
clone():
Cylinder
Creates a new cylinder with the same axis, radius, and height as this cylinder.
Cylinder
copy(
other):this
Copies the axis, radius, and height of other to this cylinder.
The axis values are copied without replacing the existing axis object.
Cylinder
Cylinder to copy.
this
isContaining(
point):boolean
Returns true if the point lies inside the cylinder or on its boundary.
Checked point.
boolean
isInfinity():
boolean
Returns true if the cylinder has an unbounded radius or height.
This includes non-finite values and Number.MAX_VALUE.
boolean
multiplied(
scalar):Cylinder
Returns a new cylinder obtained by applying multiply() to this cylinder.
number
Scalar value.
Cylinder
multiply(
scalar):this
Scales the cylinder by a scalar value.
The radius and height are multiplied by Math.abs(scalar) so they remain non-negative. The axis is not changed.
number
Scalar value.
this
setAxis(
axis):this
Sets the cylinder axis.
The values of axis are copied without replacing the existing axis object.
Axis of the cylinder.
this
setHeight(
height):this
Sets the cylinder height.
Negative values are stored as 0.
number
Height of the cylinder along the axis.
this
setRadius(
radius):this
Sets the cylinder radius.
Negative values are stored as 0.
number
Outer radius of the cylinder.
this
transform(
transformation):this
Transforms the cylinder.
The axis is transformed by transformation. The radius and height are scaled by the absolute value of the transformation scale factor.
Transformation.
this
transformed(
transformation):Cylinder
Returns a new cylinder obtained by applying transform() to this cylinder.
Transformation.
Cylinder