Skip to content

tmathis720/mesh-geometry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mesh-geometry

crates.io docs.rs CI

High-performance, no_std-compatible geometry utilities for spatially discrete meshes.

Features

  • Core types: Point2, Point3, Vec2, Vec3 with 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_std compatible (default: std enabled).
  • 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

License

MIT OR Apache-2.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages