oxigdal-noalloc 0.1.4

no_std, no_alloc fixed-size geometry primitives for OxiGDAL
Documentation
  • Coverage
  • 100%
    129 out of 129 items documented0 out of 99 items with examples
  • Size
  • Source code size: 101.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 42s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cool-japan

oxigdal-noalloc

no_std, zero-allocation geometry primitives for the OxiGDAL ecosystem. Designed for embedded and RISC-V environments where heap allocation is unavailable.

Features

  • Point2D / Point3D -- distance, midpoint, projection
  • BBox2D -- axis-aligned bounding box with containment and intersection tests
  • LineSegment2D -- parametric intersection detection
  • Triangle2D -- area (shoelace), containment (barycentric), centroid, perimeter
  • FixedPolygon<N> -- inline fixed-capacity polygon (no heap)
  • CoordTransform -- 2D affine transforms (scale, translate, rotate, compose)
  • GeoHashFixed -- geohash encoding stored as [u8; 12]
  • Software sqrt/sin/cos via Newton-Raphson and Taylor series (no libm dependency)
  • #![deny(unsafe_code)]

Usage

use oxigdal_noalloc::{Point2D, FixedPolygon, CoordTransform};

let a = Point2D::new(0.0, 0.0);
let b = Point2D::new(3.0, 4.0);
assert!((a.distance_to(&b) - 5.0).abs() < 1e-10);

let mut poly = FixedPolygon::<16>::new();
poly.try_push(Point2D::new(0.0, 0.0));
poly.try_push(Point2D::new(4.0, 0.0));
poly.try_push(Point2D::new(4.0, 3.0));
assert!((poly.area() - 6.0).abs() < 1e-10);

let transform = CoordTransform::translate(10.0, 20.0);
let moved = transform.apply(a);
assert!((moved.x - 10.0).abs() < 1e-10);

Status

  • 59 tests passing, 0 failures

License

See the top-level OxiGDAL repository for license details.