brepkit-math
Vectors, matrices, NURBS, analytic curves and surfaces, and exact geometric predicates.
Part of brepkit, a solid modeling kernel for Rust and WebAssembly.
Layer L0. The foundation, with no workspace dependencies.
Full API reference on docs.rs, including the tolerance model, the exactness rules, and when tolerance bites.
Everything the rest of the kernel computes with:
- Linear algebra:
Point3/Vec3as distinct newtypes,Mat4affine transforms, planes, orthonormal frames. - NURBS: curve and surface evaluation, derivatives, knot insertion and removal, Bezier decomposition, fitting, projection, self-intersection.
- Analytic geometry:
Line3D,Circle3D,Ellipse3D,Parabola3D,Hyperbola3D, and cylinder, cone, sphere, torus surfaces, with closed-form intersections where a pair admits one. - Robustness: filtered exact predicates (
orient2d,orient3d), and theTolerancemodel every comparison goes through. - Spatial structures: AABB, OBB, BVH, constrained Delaunay triangulation, convex hull, ray-triangle intersection.
Example
use Circle3D;
use Tolerance;
use ;
let center = new;
let circle = new?;
let tol = new;
let quarter = circle.evaluate;
assert!;
Stability
Part of brepkit's consumer surface: this crate is meant to be named directly in
a downstream Cargo.toml. Breaking changes are possible but not routine, and
land with a CHANGELOG entry. See
STABILITY.md.
License
AGPL-3.0-only, or a commercial license for proprietary use.