A Circle3d is defined by its center point, axial direction and radius. The
axial direction is the direction of the axis through the center of the circle
that all points on the circle are equidistant from, or equivalently the normal
direction of the plane defined by the circle. This module contains functionality
for:
Construct a circle from its radius, axial direction and center point:
exampleCircle =
Circle3d.withRadius (Length.meters 3)
Direction3d.z
(Point3d.meters 2 0 1)If you pass a negative radius, the absolute value will be used.
Construct a circle by sweeping the given point around the given axis.
Circle3d.sweptAround Axis3d.z
(Point3d.meters 3 0 2)
--> Circle3d.withRadius (Length.meters 3)
--> Direction3d.z
--> (Point3d.meters 0 0 2)Construct a 3D circle lying on a sketch plane by providing a 2D circle specified in XY coordinates within the sketch plane.
Circle3d.on SketchPlane3d.yz <|
Circle2d.withRadius (Length.meters 3)
(Point2d.meters 1 2)
--> Circle3d.withRadius (Length.meters 3)
--> Direction3d.x
--> (Point3d.meters 0 1 2)Attempt to construct a circle that passes through the three given points.
The axial direction of the returned circle will be such that the three points
are in counterclockwise order around it, according to the right-hand rule. If
the three given points are collinear, returns Nothing.
Circle3d.throughPoints
(Point3d.meters 1 0 0)
(Point3d.meters 0 1 0)
(Point3d.meters 0 0 1)
--> Just <|
--> Circle3d.withRadius (Length.meters 0.8165)
--> (Direction3d.xyZ
--> (Angle.degrees 45)
--> (Angle.degrees 35.26)
--> )
--> (Point3d.meters 0.333 0.333 0.333)Get the center point of a circle.
Circle3d.centerPoint exampleCircle
--> Point3d.meters 2 0 1Get the axial direction of a circle.
Circle3d.axialDirection exampleCircle
--> Direction3d.zGet the radius of a circle.
Circle3d.radius exampleCircle
--> Length.meters 3Get the diameter of a circle.
Circl3d.diameter exampleCircle
--> Length.meters 6Get the central axis of a circle, perpendicular to its plane.
The origin point of the returned axis will be the center point of the circle.
Circle3d.axis exampleCircle
--> Axis3d.withDirection Direction3d.z
--> (Point3d.meters 2 0 1)Get the plane that a circle lies in. The origin point of the returned plane will be the center point of the circle, and its normal direction will be the axial direction of the circle.
Circle3d.plane exampleCircle
--> Plane3d.withNormalDirection Direction3d.z
--> (Point3d.meters 2 0 1)Get the area of a circle.
Circle3d.area exampleCircle
--> Area.squareMeters 28.2743Get the circumference of a circle.
Circle3d.circumference exampleCircle
--> Length.meters 18.8496Get the minimal bounding box containing a given circle.
Circle3d.boundingBox exampleCircle
--> BoundingBox3d.fromExtrema
--> { minX = Length.meters -1
--> , maxX = Length.meters 5
--> , minY = Length.meters -3
--> , maxY = Length.meters 3
--> , minZ = Length.meters 1
--> , maxZ = Length.meters 1
--> }Convert a circle 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 circle 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.
These transformations generally behave just like the ones in the Point3d
module.
Scale a circle around a given point by a given scale.
Rotate a circle around a given axis by a given angle.
Translate a circle by a given displacement.
Translate a circle in a given direction by a given distance.
Mirror a circle across a given plane.
Project a circle into a sketch plane. Note that the result is an ellipse, not a circle!
inclinedCircle : Circle3d
inclinedCircle =
Circle3d.withRadius (Length.meters 1)
(Direction3d.xz (Angle.degrees 45))
(Point3d.meters 1 2 3)
Circle3d.projectInto SketchPlane3d.xy inclinedCircle
--> Ellipse2d.with
--> { centerPoint =
--> Point2d.meters 1 2
--> , xDirection = Direction2d.negativeY
--> , xRadius = 1
--> , yRadius = 0.7071
--> }Take a circle defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.
Take a circle considered to be defined in local coordinates relative to a given reference frame, and return that circle expressed in global coordinates.