rustsim-geometry 0.0.1

2-D and 3-D geometric primitives and queries for rustsim (points, AABB, segments, rays, triangles, closest-point, raycast)
Documentation
//! Geometric primitives and queries for rustsim.
//!
//! This crate is intentionally tiny and dependency-free. It provides:
//!
//! - [`Vec2`] and [`Vec3`] type aliases over `[f64; 2]` and `[f64; 3]` with
//!   free-function arithmetic in the [`vec2`] and [`vec3`] modules.
//! - Axis-aligned bounding boxes [`Aabb2`], [`Aabb3`].
//! - Segments [`Segment2`], [`Segment3`] with closest-point queries.
//! - Rays [`Ray3`] and planes [`Plane3`] with ray-plane intersection.
//! - Triangles [`Triangle3`] with closest-point and ray-triangle
//!   intersection (Möller–Trumbore).
//! - Spheres [`Sphere3`] with sphere-vs-AABB / sphere-vs-triangle tests.
//!
//! All functions are `f64`. No `unsafe`. No external crates. No allocation
//! in hot paths.

#![deny(missing_docs)]

pub mod aabb;
pub mod ray;
pub mod segment;
pub mod sphere;
pub mod triangle;
pub mod vec2;
pub mod vec3;

pub use aabb::{Aabb2, Aabb3};
pub use ray::{Plane3, Ray3};
pub use segment::{Segment2, Segment3};
pub use sphere::Sphere3;
pub use triangle::Triangle3;
pub use vec2::Vec2;
pub use vec3::Vec3;

/// Convenience re-exports.
pub mod prelude {
    pub use crate::aabb::{Aabb2, Aabb3};
    pub use crate::ray::{Plane3, Ray3};
    pub use crate::segment::{Segment2, Segment3};
    pub use crate::sphere::Sphere3;
    pub use crate::triangle::Triangle3;
    pub use crate::vec2::Vec2;
    pub use crate::vec3::Vec3;
}