High-performance, no_std-compatible geometry utilities for spatially discrete meshes.
- Core types:
Point2,Point3,Vec2,Vec3with arithmetic, dot/cross, and conversion utilities. - Cell metrics: triangle/quad area, centroids, tetrahedron/hexahedron volume, face normals, projected area.
- Geometry queries: point-in-polygon, ray-triangle intersection, point-to-cell distance.
- Advanced utilities: Jacobians, AABB, 3D affine transforms.
no_stdcompatible (default:stdenabled).- Comprehensive documentation and examples.
cargo add mesh-geometryuse mesh_geometry::Point2;
let p = Point2::new(0.0, 1.0);Compute the volume of a tetrahedron:
cargo run --example compute_cell_volumesuse mesh_geometry::{Point3, metrics::volume::tetrahedron_volume};
let a = Point3::new(0.0, 0.0, 0.0);
let b = Point3::new(1.0, 0.0, 0.0);
let c = Point3::new(0.0, 1.0, 0.0);
let d = Point3::new(0.0, 0.0, 1.0);
let vol = tetrahedron_volume(a, b, c, d);
assert!((vol - 1.0/6.0).abs() < 1e-12);See more in examples/.
- CI: GitHub Actions
- Issues and PRs welcome!
MIT OR Apache-2.0