PairLineIntersection
public enum PairLineIntersection<Vector> where Vector : VectorFloatingPoint
extension PairLineIntersection: Equatable where Vector: Equatable
extension PairLineIntersection: Hashable where Vector: Hashable
The result of an intersection test between an arbitrary open shape and a line, specialized for storing at most two intersection points at a time.
-
Represents the case where the line crosses the bounds of the shape on a single point.
Declaration
Swift
case singlePoint(LineIntersectionPointNormal<Vector>)
-
Represents cases where the line crosses the shape twice.
Declaration
Swift
case twoPoint(LineIntersectionPointNormal<Vector>, LineIntersectionPointNormal<Vector>)
-
Represents the case where no intersection occurs at any point.
Declaration
Swift
case noIntersection
-
Returns the list of line intersection point normals referenced by this intersection instance.
Declaration
Swift
public var lineIntersectionPointNormals: [LineIntersectionPointNormal<Vector>] { get }
-
Returns the list of point normals referenced by this intersection instance.
Declaration
Swift
public var pointNormals: [PointNormal<Vector>] { get }
-
Returns a new
PairLineIntersection
where anyLineIntersectionPointNormal
value is mapped by a provided closure before being stored back into the same enum case and returned.Declaration
Swift
public func mappingPointNormals( _ mapper: (LineIntersectionPointNormal<Vector>, LineIntersectionPointNormalKind) -> LineIntersectionPointNormal<Vector> ) -> PairLineIntersection<Vector>
-
Returns a new
PairLineIntersection
where anyLineIntersectionPointNormal
value is replaced by a provided closure before being stored back into the same enum case and returned.Declaration
Swift
public func replacingPointNormals<NewVector: VectorType>( _ mapper: (LineIntersectionPointNormal<Vector>, LineIntersectionPointNormalKind) -> LineIntersectionPointNormal<NewVector> ) -> PairLineIntersection<NewVector>
-
Parameter passed along point normals in
See moremappingPointNormals(_:)
andreplacingPointNormals(_:)
to specify to the closure which kind of point normal was provided.Declaration
Swift
public enum LineIntersectionPointNormalKind