Module primitive

Source
Expand description

Affine, convex, and combinatorial spaces

Modules§

integer
Primitives over signed integers Integer Interval and Aabb primitives.
simplex2
2D simplex types
simplex3
3D simplex types

Structs§

Aabb2
2D axis-aligned bounding box.
Aabb3
3D axis-aligned bounding box.
Capsule3
3D Z-axis-aligned capsule
Cylinder3
3D Z-axis-aligned cylinder
Hull2
2D convex hull
Hull3
3D convex hull
Interval
1D interval
Line2
An infinitely extended line in 2D space defined by a base point and normalized direction
Line3
An infinitely extended line in 3D space defined by a base point and normalized direction
Obb2
2D oriented bounding box
Obb3
3D oriented bounding box
Plane3
A plane in 3D space defined by a base point and (unit) normal vector
Segment2
A 1-simplex or line segment in 2D space.
Segment3
A 1-simplex or line segment in 3D space.
Sphere2
Sphere in 2D space (a circle)
Sphere3
Sphere in 3D space
Tetrahedron3
A 3-simplex or tetrahedron in 3D space
Triangle2
A 2-simplex or triangle in 2D space
Triangle3
A 2-simplex or triangle in 3D space

Enums§

Simplex2
A $n<3$-simplex in 2-dimensional space.
Simplex3
A $n<4$-simplex in 3-dimensional space.

Traits§

Primitive

Functions§

colinear_2d
Returns true when three points lie on the same line in 2D space.
colinear_3d
Returns true when three points lie on the same line in 3D space.
coplanar_3d
Returns true when four points lie on the same plane in 3D space.
determinant_3d
Computes the determinant of a matrix formed by the three points as columns
point2_max
Coordinate-wise max
point2_min
Coordinate-wise min
point3_max
Coordinate-wise max
point3_min
Coordinate-wise min
project_2d_point_on_line
Given a 2D point and a 2D line, returns the nearest point on the line to the given point
project_3d_point_on_line
Given a 3D point and a 3D line, returns the nearest point on the line to the given point
triangle_3d_area2
Square area of three points in 3D space.