Skip to main content

Module primitive

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
Cone3
3D Z-axis-aligned cone
Cylinder3
3D Z-axis-aligned cylinder
Hull2
2D convex hull
Hull3
3D convex hull
Interval
1D interval. Points are allowed to be equal.
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
Ray2
An infinitely extended ray in 2D space defined by a base point and normalized direction
Ray3
An infinitely extended ray in 3D space defined by a base point and normalized direction
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
Geometric primitives generic over dimension

Functions§

colinear_2d
Returns true when three points lie on the same line in 2D space.
colinear_2d_epsilon
colinear_3d
Returns true when three points lie on the same line in 3D space.
colinear_3d_epsilon
coplanar_3d
Returns true when four points lie on the same plane in 3D space.
coplanar_3d_epsilon
determinant_3d
Computes the determinant of a matrix formed by the three points as columns
orthonormal_basis
Create an orthonormal basis given the first basis component
plane_side_3d
Return a signum indicating which side of the triangle ABC that point D lies on, where +1 indicates that D lies on the side that the normal $(B - A) \times (C - A)$ points to, -1 if D lies on the opposite side, and 0 if D lies on the plane ABC, within tolerance
plane_side_3d_epsilon
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
project_3d_point_on_plane
Given a 3D point and a 3D plane, returns the nearest point on the plane to the given point
support2
Returns point furthest along given direction together with dot product with the direction vector
support3
Returns point furthest along given direction together with dot product with the direction vector
triangle_3d_area_squared
Square area of three points in 3D space.

Type Aliases§

Line2Point
A parameterized point on a 2D line
Line3Point
A parameterized point on a 3D line
Ray2Point
A parameterized point on a 2D ray
Ray3Point
A parameterized point on a 3D ray
Segment2Point
Parameterized point on a 2D segment
Segment3Point
Parameterized point on a 3D segment
Tetrahedron3Point
Parameterized point on a 3D tetrahedron
Triangle2Point
Parameterized point on a 2D triangle
Triangle3Point
Parameterized point on a 3D triangle