Torus3

public struct Torus3<Vector> : GeometricType where Vector : Vector3FloatingPoint
extension Torus3: BoundableType
extension Torus3: VolumetricType
extension Torus3: PointProjectableType
extension Torus3: Equatable where Vector: Equatable, Scalar: Equatable
extension Torus3: Hashable where Vector: Hashable, Scalar: Hashable
extension Torus3: SignedDistanceMeasurableType where Vector.Scalar: Real

Represents a three dimensional torus shape as a center point, an axis of rotation around that center point, and two radii describing the radius of a circle, and the radius of the axis of rotation of the circle around the center point of the torus.

  • Convenience for Vector.Scalar.

    Declaration

    Swift

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

    Declaration

    Swift

    public var center: Vector
  • The axis of revolution of the circle that composes the tube of the torus. The major radius of the torus expands from center, perpendicular to this axis by majorRadius, and sweeps around forming the tube of the torus.

    Declaration

    Swift

    @UnitVector
    public var axis: Vector { get set }
  • The radius from the center of the torus to the center of the tube.

    Declaration

    Swift

    public var majorRadius: Scalar
  • The radius of the tube of the torus.

    Declaration

    Swift

    public var minorRadius: Scalar
  • Undocumented

    Declaration

    Swift

    public init(center: Vector, axis: Vector, majorRadius: Scalar, minorRadius: Scalar)
  • Gets the minimal bounding box capable of fully containing all the points of this Torus3.

    Declaration

    Swift

    @inlinable
    public var bounds: AABB<Vector> { get }
  • Returns true if a given point vector is enclosed within the volume of this Torus3.

    Declaration

    Swift

    public func contains(_ vector: Vector) -> Bool
  • Declaration

    Swift

    public func project(_ vector: Vector) -> Vector

Available where Vector.Scalar: Real