Intersection between shapes

Back to Shape generation

The intersection between two shapes and in is .

Practice

Pastel implements several algorithms for finding the intersection between a pair of shapes. Describing the possible intersection shape is slower than simply finding out if the shapes overlap. If this is the need, you should use the algorithms for overlap testing instead. The implemented algorithms are listed in the following table.

Shape/Shape AlignedBox Box Sphere Plane Segment Triangle Line Ray
AlignedBox nD
Box - -
Sphere - - -
Plane ? + nD +
Segment + + + - -
Triangle ? ? - ? - -1D,+2D,3D,-nD
Line nD nD nD nD - 2D, 3D, -nD -
Ray nD + nD nD - + - -

where

See also

Overlap testing

Shapes

Files

Intersection between a 2-flat and a plane

Intersection between a line and a box

Intersection between a line and a plane

Intersection between a line and a sphere

Intersection between a line and a triangle

Intersection between a line and an aligned box

Intersection between a line and an aligned plane

Intersection between a line segment and a half-space

Intersection between a plane and a sphere

Intersection between a ray and a plane

Intersection between a ray and a sphere

Intersection between a ray and an aligned box

Intersection between a ray and an aligned plane

Intersection between an aligned box and a line segment

Intersection between an aligned box and a plane

Intersection between two aligned boxes

Intersection between two triangles

Testing for alignedbox-alignedbox intersection

Testing for line-alignedbox intersection

Testing for line-triangle intersection