Header menu logo Euclid

LineIntersectionTypes Module

A module for the result types of 2D and 3D line-line-intersections.

Types

Type Description

IntersectionKind

For finite 2D or 3D lines. An enumeration of all possible results from computing the intersection. For finite lines there are more cases than for infinite lines. General Cases: | Intersecting | IntersectingEndsBoth | IntersectingEndsFirst | IntersectingEndsSecond | Skew | Apart Parallel Cases: | Parallel | Overlapping | CoincidentApart | Continuation | ContinuationFlipped| Identical| IdenticalFlipped Error Cases : TooShortA | TooShortB | TooShortBoth

IntersectionParam

For infinite 2D or 3D lines. The result line parameters from computing the intersection.

IntersectionPoints2D

For infinite 2D lines. The result from computing the intersection of two infinite 2D lines.

IntersectionPoints3D

For infinite 3D lines. The result from computing the intersection of two infinite 3D lines.

ZeroToOne

A type to represent the result of testing if a float is close to zero, close to one or in between. A number is close to 1.0 by maximum 6 steps of float increment or decrement. So between 0.99999964 and 1.000000715. Same step size for zero. This can be used for clamping the domain on a line.

Functions and values

Function or value Description

isIntersectionOnePoint k

Full Usage: isIntersectionOnePoint k

Parameters:
Returns: bool

Returns true if the IntersectionKind is represented by one point. Not two points like in skew or no point like in parallel. Also returns false for the special cases of too short lines.

k : IntersectionKind
Returns: bool

isZeroOneOrBetween x

Full Usage: isZeroOneOrBetween x

Parameters:
    x : float

Returns: ZeroToOne
Modifiers: inline

Tests if a float is close to 0.0, close to 1.0 in between or outside. The tolerance is approximately 1e-6 for each side. That is 6 steps of float increment from 1.0. So between 0.99999964 and 1.000000715. Same step size for zero.

x : float
Returns: ZeroToOne

Type something to start searching.