#2d-grid #dynamic #memory #expandable #size #ideal

expandable_grid

A simple, expandable, non-chunked 2d grid ideal for dynamic simulations

6 releases

0.1.5 Jul 12, 2024
0.1.4 Jun 30, 2024

#109 in Simulation

Download history 1/week @ 2024-07-16 2/week @ 2024-09-10 2/week @ 2024-09-17 17/week @ 2024-09-24 1/week @ 2024-10-01

315 downloads per month

GPL-3.0+

17KB
354 lines

This crate provides a simple, expandable 2d grid which can be accessed from arbitrary signed isize coordinates. It stores its data in a unified area in memory, and copies it to another allocation when changing size like a vec does. It always takes up the minimum amount of space for its accessible size, however, it also overexpands when resizing to fit an area to reduce allocations.


lib.rs:

Vectors are stored and modified via nalgebra::Vector2

See expandable_grid::ExpanableGrid for more information.

Dependencies

~3MB
~57K SLoC