dijkstra3d-core 0.1.0

Voxel-grid Dijkstra and rolling-ball invalidation, ported from seung-lab/dijkstra3d and seung-lab/kimimaro
Documentation

dijkstra3d-core

dijkstra3d-core provides Rust implementations of voxel-grid shortest paths, distance fields, parental fields, Euclidean distance fields, and rolling-ball invalidation. It is the Rust engine used by the dijkstra3d-rs Python package.

Version 0.1.0 is the initial pre-1.0 release. The crate is versioned with the Python distribution but published separately; until the registry artifact exists, consume it from a pinned release commit or a path dependency. Public APIs may change in a future minor release.

The crate uses x-fastest linear indexing:

index = x + y * sx + z * sx * sy

Example

use dijkstra3d_core::dijkstra::dijkstra_unidirectional_slice_int;
use dijkstra3d_core::{Connectivity, VolumeShape};

let shape = VolumeShape::try_new(3, 3, 3)?;
let field = vec![1_u8; shape.total() as usize];
let source = shape.linear(0, 0, 0);
let target = shape.linear(2, 2, 2);

let path = dijkstra_unidirectional_slice_int(
    &field,
    shape,
    source,
    target,
    Connectivity::TwentySix,
    None,
)?;

assert_eq!(path.first(), Some(&source));
assert_eq!(path.last(), Some(&target));

# Ok::<(), dijkstra3d_core::Dijkstra3dError>(())

Input contract

  • Construct shapes with VolumeShape::try_new when dimensions are not already trusted. VolumeShape::new is a convenience constructor that panics for an empty or unrepresentable shape.
  • Slice lengths and source/target indices are checked by the public algorithms.
  • Unsigned-integer kernels reject accumulated-distance bounds that cannot be represented safely before allocating their queues.
  • Signed and floating-point cost fields must contain finite, non-negative values. Callers are responsible for validating this precondition.

The minimum supported Rust version is 1.85. The crate is licensed under GPL-3.0-or-later; see THIRD_PARTY_NOTICES.md for upstream provenance and attribution.

APIs hidden from rustdoc are diagnostic implementation hooks and are not part of the documented compatibility surface.