Cylinder3

public struct Cylinder3<Vector> : GeometricType where Vector : Vector3Type
extension Cylinder3: Equatable where Vector: Equatable, Scalar: Equatable
extension Cylinder3: Hashable where Vector: Hashable, Scalar: Hashable
extension Cylinder3: BoundableType where Vector: Vector3FloatingPoint
extension Cylinder3: VolumetricType where Vector: Vector3FloatingPoint
extension Cylinder3: PointProjectableType where Vector: Vector3FloatingPoint
extension Cylinder3: SignedDistanceMeasurableType where Vector: VectorFloatingPoint
extension Cylinder3: Convex3Type where Vector: Vector3Real

Represents a regular 3-dimensional Cylinder as a pair of end points and a radius.

  • Convenience for Vector.Scalar.

    Declaration

    Swift

    public typealias Scalar = Vector.Scalar
  • The starting point of this cylinder.

    Declaration

    Swift

    public var start: Vector
  • end

    The end point of this cylinder

    Declaration

    Swift

    public var end: Vector
  • The radius of this cylinder.

    Declaration

    Swift

    public var radius: Scalar
  • Undocumented

    Declaration

    Swift

    public init(start: Vector, end: Vector, radius: Scalar)
  • Returns a line segment with the same start and end points of this cylinder.

    Declaration

    Swift

    var asLineSegment: LineSegment<Vector> { get }
  • Returns a Capsule3 with the same start, end, and radius parameter sas this cylinder.

    Declaration

    Swift

    var asCapsule: Capsule3<Vector> { get }

Available where Vector: Equatable, Scalar: Comparable & AdditiveArithmetic

  • Returns whether this cylinder’s parameters produce a valid, non-empty cylinder.

    A cylinder is valid when start != end and radius is greater than zero.

    Declaration

    Swift

    var isValid: Bool { get }

Available where Vector: Vector3FloatingPoint

  • Declaration

    Swift

    @inlinable
    public var bounds: AABB<Vector> { get }
  • Returns the disk that represents the top- or start, section of this cylinder, centered around start with a radius of radius, and a normal pointing away from the center of the cylinder.

    Declaration

    Swift

    @inlinable
    public var startAsDisk: Disk3<Vector> { get }
  • Returns the disk that represents the bottom- or end, section of this cylinder, centered around end with a radius of radius, and a normal pointing away from the center of the cylinder.

    Declaration

    Swift

    @inlinable
    public var endAsDisk: Disk3<Vector> { get }
  • Returns true if a given vector is fully contained within this cylinder.

    Points at the perimeter of the cylinder are considered as contained within the cylinder (inclusive).

    Declaration

    Swift

    @inlinable
    public func contains(_ vector: Vector) -> Bool
  • Projects a given point onto this cylinder, returning the closest point on the outer surface of the cylinder to vector.

    Declaration

    Swift

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

Available where Vector: VectorFloatingPoint

Available where Vector: Vector3Real