|Starbeamrainbowlabs 0e6b16dd55||1 day ago|
|blender||2 weeks ago|
|utils||3 days ago|
|.gitattributes||5 months ago|
|.gitignore||4 days ago|
|LICENSE||5 months ago|
|README.md||1 day ago|
|main.lua||1 day ago|
|maze||2 weeks ago|
|maze.lua||3 days ago|
|maze3d.lua||1 day ago|
|openscad.lua||5 months ago|
A collection of maze generation programs
Ported back in 2015 (and since adapted) from an algorithm of my own design that was originally implemented in Python.
Now has a 3d mode!
Current blog posts about this project:
Clone this repository:
git clone https://git.starbeamrainbowlabs.com/sbrl/multimaze.git cd multimaze.lua
See the usage information for the program by calling
main.lua like so:
lua main.lua help
||Displays the help text|
||Generates 2D mazes and writes them to stdout|
||Generates 3D mazes and writes them in layers to stdout|
||Generates 3D mazes and writes an OpenSCAD file to the specified location|
To render a 2D maze as ASCII, do this:
lua main.lua maze --width 25 --height 25 # Alternatively, in shorthand: lua main.lua maze -w 25 -h 25
To render a 3D maze as a .STL file, do this:
# Generate the OpenSCAD file lua main.lua maze3d_openscad -w 15 -h 15 -d 17 -f 15x15x17.scad # Convert the OpenSCAD file to an STL openscad -o 15x15x17.stl 15x15x17.scad
Users who have sh (Bash works too) installed can use the
maze wrapper script instead:
./maze maze3d_openscad -w 15 -h 15 -d 17 -f 15x15x17.scad ./maze maze -w 25 -h 25
./maze maze_svg --scale 40 -w 31 -h 31 -f maze.svg inkscape -o maze.png maze.svg convert maze.png -crop 1080x1080+80+80 extract.png
The formula here for the crop is:
Higher values reduce the number of attention switches the engine executes, leading to fewer branching paths in the resulting maze - this is implemented with a 1-in-N chance to shift the attention of the engine.
The value here that works best really depends on your maze. Larger mazes tend to benefit from higher branching factors than the default. 3D mazes tend to look better with slightly lower branching factors, but this is an area of ongoing observation (get in touch if you have anything to add here).
Contributions are very welcome - both issues and patches! Please mention in your pull request that you release your work under the MPL-2.0 (see below).
This guide looks good for how to create patch in git: How To Create and Apply Git Patch Files
If you find a bug, there are a number of different ways you can get in touch.
If this becomes a thing that people want to contribute to regularly, I will move it to GitHub to make that an easier process.
If you’re feeling that way inclined, I have a Liberapay profile if you’d like to donate to say an extra thank you :-)
The contents of this repository is released under the Mozilla Public License 2.0. The full license text is included in the
LICENSE file in this repository. Tldr legal have a great summary of the license if you’re interested.