#cellular-automata #cellular #automata #projection #map #globe

surface-grid

A crate providing data structures for square-tiled grids wrapped around the surface of certain objects

6 releases (3 breaking)

0.4.0 Aug 24, 2024
0.3.2 Jul 7, 2024
0.3.1 Jan 27, 2024
0.2.0 Jan 26, 2024
0.1.0 Jan 25, 2024

#542 in Data structures

Download history 167/week @ 2024-08-24 7/week @ 2024-08-31 2/week @ 2024-09-14 15/week @ 2024-09-21 21/week @ 2024-09-28

366 downloads per month

BSD-3-Clause

85KB
1.5K SLoC

Surface Grid

A crate providing data structures for square-tiled grids wrapped around the surface of certain objects. This create was intended to be used for the creation of cellular automata on non-flat grids. The crate provides a trait SurfaceGrid with an associated type Point which can be used to traverse the grid squares. Additionally, for grids that wrap a sphere the Point type implements the SpherePoint trait providing conversions between geographic and surface grid coordinates.

You can view examples in examples.

The documentation is available at https://docs.rs/surface-grid/.

Available Surfaces

Spheres

  • RectangleSphereGrid - Uses an equirectangular projection to wrap a rectangle around the sphere.
  • CubeSphereGrid - Projects a cube over the sphere with each face being a square grid.

lib.rs:

A crate providing data structures for square-tiled grids wrapped around the surface of certain objects. This create was intended to be used for the creation of cellular automata on non-flat grids. The crate provides a trait SurfaceGrid with an associated type Point which can be used to traverse the grid squares. Additionally, for grids that wrap a sphere the Point type implements the SpherePoint trait providing conversions between geographic and surface grid coordinates.

Available Surfaces

Spheres

  • RectangleSphereGrid - Uses an equirectangular projection to wrap a rectangle around the sphere.
  • CubeSphereGrid - Projects a cube over the sphere with each face being a square grid.

Dependencies

~1.5MB
~34K SLoC