A Cylinder3d consists of a cylindrical outer surface and two circular
end caps; it is defined by its center point, axial direction, radius and overall
length. This module contains functionality for:
Construct a cylinder that lies along the given axis, with the start and end points given as (signed) distances along that axis:
exampleCylinder =
Cylinder3d.along Axis3d.x
{ start = Length.meters -1
, end = Length.meters 3
, radius = Length.meters 1
}
Cylinder3d.startPoint exampleCylinder
--> Point3d.meters -1 0 0
Cylinder3d.endPoint exampleCylinder
--> Point3d.meters 3 0 0
Cylinder3d.length exampleCylinder
--> Length.meters 4Note that end may be less than start, but then the axial direction of the
returned cylinder will be the opposite of the axial direction of the given axis.
Construct a cylinder given its center point, axial direction, radius and length. Negative values for radius or length will be treated as positive (the absolute values will be used).
Construct a cylinder given its start point, axial direction, radius and length. Negative values for radius or length will be treated as positive (the absolute values will be used).
Attempt to construct a cylinder from the given start point, end point and
radius. If the start and end points are coincident (the same point), returns
Nothing.
Get the central axis of a cylinder. The origin point of the axis will be at the center point of the cylinder, and the direction of the axis will be from the cylinder's start point towards its end point.
Get the center point of a cylinder.
Get the axial direction of a cylinder.
Get the radius of a cylinder.
Get the diameter of a cylinder (twice its radius).
Get the overall length of a cylinder.
Get the start point of a cylinder. This is the center point of the circle that forms the start cap of the cylinder.
Get the end point of a cylinder. This is the center point of the circle that forms the end cap of the cylinder.
Get the circle at the start of a cylinder. The axial direction of this circle will be the reverse of the axial direction of the cylinder itself (the circle axial direction will point backwards/outwards).
Get the circle at the end of a cylinder. The axial direction of this circle will be the same as that of the cylinder itself.
Get the volume of a cylinder.
Get the minimal bounding box containing a given cylinder.
Check if a cylinder contains a given point.
Reverse a cylinder so that the start point becomes the end point and vice versa. This also means that the axial direction will be reversed.
The remaining transformations generally behave just like the ones in the
Point3d module.
Scale a cylinder about a given point by a given scale.
Rotate a cylinder around a given axis by a given angle.
Translate a cylinder by a given displacement.
Translate a cylinder in a given direction by a given distance.
Mirror a cylinder across a given plane.
Convert a cylinder from one units type to another, by providing a conversion factor given as a rate of change of destination units with respect to source units.
Convert a cylinder from one units type to another, by providing an 'inverse' conversion factor given as a rate of change of source units with respect to destination units.
Take a cylinder considered to be defined in local coordinates relative to a given reference frame, and return that cylinder expressed in global coordinates.
Take a cylinder defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.