shortestpath 0.10.0

Shortest Path is an experimental library finding the shortest path from A to B.
Documentation
// Copyright (C) 2025 Christian Mauduit <ufoot@ufoot.org>

//! True 3D mesh implementations for volumetric pathfinding.
//!
//! This module provides structures and traits for pathfinding in true 3D spaces with
//! full volumetric connectivity. Each cell can connect to all 26 neighboring cells:
//! - 8 neighbors in the current layer (4 orthogonal + 4 diagonal)
//! - 9 neighbors in the layer above (including diagonals)
//! - 9 neighbors in the layer below (including diagonals)
//!
//! This true 3D approach is ideal for:
//! - Flight simulators or space games
//! - Underwater/aerial navigation
//! - Mining/voxel games where you can move diagonally between layers
//! - Any scenario requiring full 3D movement with diagonal transitions
//!
//! For simpler layered movement (2D within layers + vertical transitions only),
//! see the [`mesh_25d`](crate::mesh_25d) module which provides 10-neighbor connectivity.
//!
//! # Main Types
//!
//! - [`Full3D`] - A fully connected rectangular volume where all cells are walkable.
//!   Each cell can connect to all 26 neighbors (8 in-layer + 9 above + 9 below).
//!
//! - [`Compact3D`] - An optimized 3D volume that supports walls/obstacles. It compresses
//!   walkable cells and pre-computes successors for memory efficiency.
//!
//! # Traits
//!
//! - [`Shape3D`] - Provides volume dimensions via `shape()` returning `(width, height, depth)`.
//!
//! - [`Index3D`] - Converts between 3D coordinates `(x, y, z)` and linear indices.
//!
//! # Utilities
//!
//! - `repr_3d` - Functions for visualizing 3D meshes and gradients as text.
//!
//! # Example
//!
//! ```
//! use shortestpath::{Gradient, Mesh, mesh_3d::Full3D};
//!
//! // Create a 10x10x10 volume
//! let mesh = Full3D::new(10, 10, 10);
//!
//! // Setup pathfinding with center as target
//! let mut gradient = Gradient::from_mesh(&mesh);
//! gradient.set_distance(555, 0.0); // Center of 10x10x10 volume
//! gradient.spread(&mesh);
//!
//! // Query distance from corner to center
//! let distance = gradient.get_distance(0);
//! println!("Distance from corner to center: {}", distance);
//! ```

mod compact_3d;
mod full_3d;
mod index_3d;
mod repr_3d;
mod shape_3d;

pub use compact_3d::*;
pub use full_3d::*;
pub use index_3d::*;
pub use repr_3d::*;
pub use shape_3d::*;