Intersection


public static class Intersection


Contains functions for intersection of ink geometry classes. For Kotlin callers, these are available as extension functions on the geometry classes themselves.

Summary

Public fields

static @NonNull Intersection

Public methods

static final boolean
intersects(@NonNull Box receiver, @NonNull Box other)

Returns true when a Box intersects with other --- When it has at least one point in common with other's interior, edges, or vertices.

static final boolean
intersects(@NonNull Box receiver, @NonNull Parallelogram parallelogram)

Returns true when a Box intersects with a Parallelogram --- When it has at least one point in common with the Parallelogram's interior, edges, or vertices.

static final boolean
intersects(@NonNull Box receiver, @NonNull Vec point)

Returns true when the Box intersects with a point (a Vec).

static final boolean
intersects(@NonNull Box receiver, @NonNull Segment segment)

Returns true when a Box intersects with a Segment --- when the segment has at least one point in common with the Box's interior, edges, or vertices

static final boolean
intersects(@NonNull Box receiver, @NonNull Triangle triangle)

Returns true when a Box intersects with a Triangle --- When the triangle has at least one point in common with the Box's interior, edges, or vertices.

static final boolean

Returns true when a Parallelogram intersects with a Box --- When the box has at least one point in common with the Parallelogram's interior, edges, or vertices.

static final boolean

Returns true when a Parallelogram intersects with other --- When it has at least one point in common with other's interior, edges, or vertices.

static final boolean

Returns true when the Parallelogram intersects with a point (a Vec).

static final boolean

Returns true when a Parallelogram intersects with a Segment --- when the segment has at least one point in common with the Parallelogram's interior, edges, or vertices.

static final boolean

Returns true when a Parallelogram intersects with a Triangle --- When the triangle has at least one point in common with the Parallelogram's interior, edges, or vertices.

static final boolean
intersects(@NonNull Segment receiver, @NonNull Box box)

Returns true when a Segment intersects with a Box --- when this segment has at least one point in common with the Box's interior, edges, or vertices

static final boolean
intersects(@NonNull Segment receiver, @NonNull Segment other)

Returns true when a Segment intersects with another Segment --- when this segment has at least one point (including the start and end points) in common with another Segment.

static final boolean
intersects(@NonNull Segment receiver, @NonNull Parallelogram parallelogram)

Returns true when a Segment intersects with a Parallelogram --- when this segment has at least one point in common with the Parallelogram's interior, edges, or vertices.

static final boolean
intersects(@NonNull Segment receiver, @NonNull Vec point)

Returns true when the Segment intersects with a point (a Vec).

static final boolean
intersects(@NonNull Segment receiver, @NonNull Triangle triangle)

Returns true when a Segment intersects with a Triangle --- when this segment has at least one point in common with the Triangle's interior, edges, or vertices.

static final boolean
intersects(@NonNull Triangle receiver, @NonNull Box box)

Returns true when a Triangle intersects with a Box --- When this triangle has at least one point in common with the Box's interior, edges, or vertices.

static final boolean

Returns true when a Triangle intersects with other --- When this triangle has at least one point in common with other's interior, edges, or vertices.

static final boolean
intersects(
    @NonNull Triangle receiver,
    @NonNull Parallelogram parallelogram
)

Returns true when a Triangle intersects with a Parallelogram --- When this triangle has at least one point in common with the Parallelogram's interior, edges, or vertices.

static final boolean
intersects(@NonNull Triangle receiver, @NonNull Vec point)

Returns true when the Triangle intersects with a point (a Vec).

static final boolean
intersects(@NonNull Triangle receiver, @NonNull Segment segment)

Returns true when a Triangle intersects with a Segment --- when the segment has at least one point in common with the Triangle's interior, edges, or vertices.

static final boolean
intersects(@NonNull Vec receiver, @NonNull Box box)

Returns true when the point (a Vec) intersects with a Box.

static final boolean
intersects(@NonNull Vec receiver, @NonNull Vec other)

Returns true if the point (a Vec), intersects other; this only occurs when the two points are equal.

static final boolean
intersects(@NonNull Vec receiver, @NonNull Parallelogram parallelogram)

Returns true when the point (a Vec) intersects with a Parallelogram.

static final boolean
intersects(@NonNull Vec receiver, @NonNull Segment segment)

Returns true when the point (a Vec) intersects with a Segment.

static final boolean
intersects(@NonNull Vec receiver, @NonNull Triangle triangle)

Returns true when the point (a Vec) intersects with a Triangle.

static final boolean
intersects(
    @NonNull Box receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToBox
)

Returns true when a Box intersects with a PartitionedMesh.

static final boolean
intersects(
    @NonNull Parallelogram receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToParallelogram
)

RReturns true when a Parallelogram intersects with a PartitionedMesh.

static final boolean
intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Box box,
    @NonNull AffineTransform meshToBox
)

Returns true when a PartitionedMesh intersects with a Box.

static final boolean
intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Parallelogram parallelogram,
    @NonNull AffineTransform meshToParallelogram
)

Returns true when a PartitionedMesh intersects with a Parallelogram.

static final boolean
intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Vec point,
    @NonNull AffineTransform meshToPoint
)

Returns true when the PartitionedMesh intersects with point.

static final boolean
intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Segment segment,
    @NonNull AffineTransform meshToSegment
)

Returns true when a PartitionedMesh intersects with a Segment.

static final boolean
intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Triangle triangle,
    @NonNull AffineTransform meshToTriangle
)

Returns true when a PartitionedMesh intersects with a Triangle.

static final boolean
intersects(
    @NonNull Segment receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToSegment
)

Returns true when a Segment intersects with a PartitionedMesh.

static final boolean
intersects(
    @NonNull Triangle receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToTriangle
)

Returns true when a Triangle intersects with a PartitionedMesh.

static final boolean
intersects(
    @NonNull Vec receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToPoint
)

Returns true when the point (a Vec) intersects with mesh.

static final boolean
intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull PartitionedMesh other,
    @NonNull AffineTransform thisToCommonTransForm,
    @NonNull AffineTransform otherToCommonTransform
)

Returns true when a PartitionedMesh intersects with a PartitionedMesh.

Public fields

INSTANCE

Added in 1.0.0-alpha02
public static @NonNull Intersection INSTANCE

Public methods

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Box receiver, @NonNull Box other)

Returns true when a Box intersects with other --- When it has at least one point in common with other's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Box receiver, @NonNull Parallelogram parallelogram)

Returns true when a Box intersects with a Parallelogram --- When it has at least one point in common with the Parallelogram's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Box receiver, @NonNull Vec point)

Returns true when the Box intersects with a point (a Vec). All points on the boundary of the box (including its vertices) and in the interior of the box intersect with it.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Box receiver, @NonNull Segment segment)

Returns true when a Box intersects with a Segment --- when the segment has at least one point in common with the Box's interior, edges, or vertices

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Box receiver, @NonNull Triangle triangle)

Returns true when a Box intersects with a Triangle --- When the triangle has at least one point in common with the Box's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Parallelogram receiver, @NonNull Box box)

Returns true when a Parallelogram intersects with a Box --- When the box has at least one point in common with the Parallelogram's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Parallelogram receiver, @NonNull Parallelogram other)

Returns true when a Parallelogram intersects with other --- When it has at least one point in common with other's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Parallelogram receiver, @NonNull Vec point)

Returns true when the Parallelogram intersects with a point (a Vec). All points on the boundary of the parallelogram (including its vertices) and in the interior of the parallelogram intersect with it.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Parallelogram receiver, @NonNull Segment segment)

Returns true when a Parallelogram intersects with a Segment --- when the segment has at least one point in common with the Parallelogram's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Parallelogram receiver, @NonNull Triangle triangle)

Returns true when a Parallelogram intersects with a Triangle --- When the triangle has at least one point in common with the Parallelogram's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Segment receiver, @NonNull Box box)

Returns true when a Segment intersects with a Box --- when this segment has at least one point in common with the Box's interior, edges, or vertices

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Segment receiver, @NonNull Segment other)

Returns true when a Segment intersects with another Segment --- when this segment has at least one point (including the start and end points) in common with another Segment.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Segment receiver, @NonNull Parallelogram parallelogram)

Returns true when a Segment intersects with a Parallelogram --- when this segment has at least one point in common with the Parallelogram's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Segment receiver, @NonNull Vec point)

Returns true when the Segment intersects with a point (a Vec). All points on the segment, including endpoints, intersect with the segment.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Segment receiver, @NonNull Triangle triangle)

Returns true when a Segment intersects with a Triangle --- when this segment has at least one point in common with the Triangle's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Triangle receiver, @NonNull Box box)

Returns true when a Triangle intersects with a Box --- When this triangle has at least one point in common with the Box's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Triangle receiver, @NonNull Triangle other)

Returns true when a Triangle intersects with other --- When this triangle has at least one point in common with other's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull Triangle receiver,
    @NonNull Parallelogram parallelogram
)

Returns true when a Triangle intersects with a Parallelogram --- When this triangle has at least one point in common with the Parallelogram's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Triangle receiver, @NonNull Vec point)

Returns true when the Triangle intersects with a point (a Vec). All points on the boundary of the triangle (including its vertices) and in the interior of the triangle intersect with it.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Triangle receiver, @NonNull Segment segment)

Returns true when a Triangle intersects with a Segment --- when the segment has at least one point in common with the Triangle's interior, edges, or vertices.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Vec receiver, @NonNull Box box)

Returns true when the point (a Vec) intersects with a Box. All points on the boundary of the box (including its vertices) and in the interior of the box intersect with it.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Vec receiver, @NonNull Vec other)

Returns true if the point (a Vec), intersects other; this only occurs when the two points are equal.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Vec receiver, @NonNull Parallelogram parallelogram)

Returns true when the point (a Vec) intersects with a Parallelogram. All points on the boundary of the parallelogram (including its vertices) and in the interior of the parallelogram intersect with it.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Vec receiver, @NonNull Segment segment)

Returns true when the point (a Vec) intersects with a Segment. All points on the segment, including endpoints, intersect with the segment.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(@NonNull Vec receiver, @NonNull Triangle triangle)

Returns true when the point (a Vec) intersects with a Triangle. All points on the boundary of the triangle (including its vertices) and in the interior of the triangle intersect with it.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull Box receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToBox
)

Returns true when a Box intersects with a PartitionedMesh.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToBox transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull Parallelogram receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToParallelogram
)

RReturns true when a Parallelogram intersects with a PartitionedMesh.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToParallelogram transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Box box,
    @NonNull AffineTransform meshToBox
)

Returns true when a PartitionedMesh intersects with a Box.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToBox transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Parallelogram parallelogram,
    @NonNull AffineTransform meshToParallelogram
)

Returns true when a PartitionedMesh intersects with a Parallelogram.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToParallelogram transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Vec point,
    @NonNull AffineTransform meshToPoint
)

Returns true when the PartitionedMesh intersects with point. meshToPoint transforms the coordinate space of mesh to the coordinate space that the intersection should be checked in (that of the point). All points along the boundary of the mesh and the meshs interior are considered for intersection.

Performance note: it is expensive to apply a transform to a mesh. To avoid unnecessary calculations, the inverse of meshToPoint is used to perform the mathematically equivalent intersection of the point in mesh’s object coordinates.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Segment segment,
    @NonNull AffineTransform meshToSegment
)

Returns true when a PartitionedMesh intersects with a Segment.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToSegment transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull Triangle triangle,
    @NonNull AffineTransform meshToTriangle
)

Returns true when a PartitionedMesh intersects with a Triangle.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToTriangle transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull Segment receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToSegment
)

Returns true when a Segment intersects with a PartitionedMesh.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToSegment transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull Triangle receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToTriangle
)

Returns true when a Triangle intersects with a PartitionedMesh.

Note that, because it is expensive to apply a transform to a mesh, this method takes a meshToTriangle transform as an argument. This transform maps from the PartitionedMesh's coordinate space to the coordinate space that the intersection should be checked in.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull Vec receiver,
    @NonNull PartitionedMesh mesh,
    @NonNull AffineTransform meshToPoint
)

Returns true when the point (a Vec) intersects with mesh. meshToPoint transforms the coordinate space of mesh to the coordinate space that the intersection should be checked in (that of the point). All points along the boundary of the mesh and the meshs interior are considered for intersection.

Performance note: it is expensive to apply a transform to a mesh. To avoid unnecessary calculations, the inverse of meshToPoint is used to perform the mathematically equivalent intersection of the point in mesh’s object coordinates.

intersects

Added in 1.0.0-alpha02
public static final boolean intersects(
    @NonNull PartitionedMesh receiver,
    @NonNull PartitionedMesh other,
    @NonNull AffineTransform thisToCommonTransForm,
    @NonNull AffineTransform otherToCommonTransform
)

Returns true when a PartitionedMesh intersects with a PartitionedMesh.

Note that, because it is expensive to apply a transform to a mesh, this method takes two AffineTransform objects: thisToCommonTransForm and otherToCommonTransform. These transforms map from the respective PartitionedMeshs' coordinate spaces to the common coordinate space that the intersection should be checked in.