1 unstable release
Uses new Rust 2024
| 0.4.0 | Jun 13, 2025 |
|---|
#630 in Graphics APIs
42KB
934 lines
mesh-geometry
High-performance, no_std-compatible geometry utilities for spatially discrete meshes.
Features
- 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.
Installation
cargo add mesh-geometry
Quickstart
use mesh_geometry::Point2;
let p = Point2::new(0.0, 1.0);
Examples
Compute the volume of a tetrahedron:
cargo run --example compute_cell_volumes
use 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/.
Documentation
CI & Contributing
- CI: GitHub Actions
- Issues and PRs welcome!
License
MIT OR Apache-2.0
Dependencies
~0–660KB
~14K SLoC