Long time lurker here but this is my first post.
I've been working for a while on a little toolkit, something I've mainly been using for roguelike map generation.
It's a library in pure lua 5.1 for the manipulation of shapes and patterns on a 2D grid.
You can see it on github: https://github.com/nhartland/forma.
With documentation at: https://nhartland.github.io/forma/.
It's a bit niche, but provides some handy stuff with (I hope) a reasonably natural API. Some examples of what it includes:
- A 'cell' class with normal (integer) vector operations
- A 'pattern' class which holds a set of cells
- A bunch of pattern primitives, for drawing circles, lines, squares etc
- A bunch of basic manipulating functions, for shifting, enlarging, reflecting patterns.
- Custom CA neighbourhoods and update rules
- Synchronous and asynchronous updates
- CA patterns can be 'nested' or generating inside the results of previous patterns
- Flood-filling to determine contiguous areas (according to custom definitions of contiguous)
- Voronoi tessellation
- Binary space partitioning
- Finding the largest contiguous rectangle in a pattern
- Finding points on the inner/outer surface of patterns
- [ASCII/Terminal] Golf course layout generation using nested CA.
- [ASCII/Terminal] Building layout generation.
- [Tiles/Love2D]] Building layout generation.