Disk3

public struct Disk3<Vector> : GeometricType where Vector : Vector3FloatingPoint
extension Disk3: BoundableType
extension Disk3: PointProjectableType
extension Disk3: SignedDistanceMeasurableType
extension Disk3: LineIntersectablePlaneType
extension Disk3: Equatable where Vector: Equatable
extension Disk3: Hashable where Vector: Hashable

Represents a 3-dimensional flat disk as a center point, normal, and radius.

A disk can be interpreted as a clipped plane, where the only points contained within the plane are the ones <= radius distance from the center.

  • Convenience for Vector.Scalar.

    Declaration

    Swift

    public typealias Scalar = Vector.Scalar
  • The center point of the disk.

    Declaration

    Swift

    public var center: Vector
  • The normal of the disk’s surface.

    Declaration

    Swift

    @UnitVector
    public var normal: Vector { get set }
  • The radius of the disk.

    Declaration

    Swift

    public var radius: Scalar
  • Declaration

    Swift

    public init(center: Vector, normal: Vector, radius: Scalar)
  • Returns a PointNormalPlane3 with the same point and normal vectors as this Disk3.

    Declaration

    Swift

    var asPointNormalPlane: PointNormalPlane3<Vector> { get }
  • Declaration

    Swift

    @inlinable
    public var bounds: AABB<Vector> { get }
  • Declaration

    Swift

    @inlinable
    public func project(_ vector: Vector) -> Vector
  • Declaration

    Swift

    @inlinable
    public func signedDistance(to point: Vector) -> Vector.Scalar
  • Declaration

    Swift

    public var pointOnPlane: Vector { get }
  • Returns the normalized magnitude for a line’s intersection point on this disk.

    Result is nil if intersection is not within the line’s limits, the line is parallel to this disk, or the intersection point is not within this disk’s radius.

    Declaration

    Swift

    @inlinable
    public func unclampedNormalMagnitudeForIntersection<Line: LineFloatingPoint>(
        with line: Line
    ) -> Vector.Scalar? where Line.Vector == Vector
  • Returns the result of a line intersection on this disk.

    Result is nil if intersection is not within the line’s limits, the line is parallel to this disk, or the intersection point is not within this disk’s radius.

    Declaration

    Swift

    @inlinable
    public func intersection<Line: LineFloatingPoint>(
        with line: Line
    ) -> Vector? where Line.Vector == Vector