This repo contains mostly ports and implementations of open source libraries and algorithms that I've used in my exploration of procedural 2d map generation for Love2d games. Most of this research stemmed from stumbling on Amit Patel's (Red Blob Games) fantastic and presumably influential article Polygonal Map Generation for Games, as well as their other illuminating writings on related topics like Data structure for triangle meshes, Alternatives to Voronoi diagrams and Jittered grid vs Poisson disc. Even their Appendices are a treasure trove of interesting rabbit holes!
The above articles pointed me to the world-class Delaunator for "incredibly fast and robust" Delaunay triangulation of 2d points, which I've ported to Lua in delanaunator.lua. Delaunator uses robust-predicates for producing valid output "even on highly degenerate input". I started porting this code as well, but my use hasn't required handling these degenerate cases, so I've kept just the standard cross-product approach for triangle orientation in orient2d.lua.
Amit's discussion of jittered grids vs Poisson discs led me to Poisson disc generation methods such as those documented in Fil's overview on Observable. I've ported one such method, Martin Roberts's improvement to Bridson's Algorithm for Poisson Disc sampling, in poisson-disc-sampler.lua.
I wrote mesh.lua based on Amit's Delaunator Guide, which discusses how to interact with the triangles and Voronoi cells produced by Delanuator, and their implementation of these ideas in their dual-mesh repository.
Lastly, list.lua and class.lua are taken from existing open source Lua libraries. The former is a slight modification of table_list.lua from the awesome TheAlgorithms/Lua repository. (It was simpler for me to a use a library for lists that support pushing and popping, rather than implementing something similar myself.) The latter is from the popular and largely useful HUMP library for Love2d. I've used most of the library during my Love2d learnings, and I just didn't stop using class.lua when working on this geometry stuff.