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

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

#100 in Simulation

Download history 247/week @ 2024-06-27 50/week @ 2024-07-04 115/week @ 2024-07-11

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