multimaze/README.md

94 lines
3.4 KiB
Markdown
Raw Normal View History

2020-04-29 11:36:41 +00:00
# multimaze
2020-04-30 18:10:32 +00:00
> A collection of maze generation programs
2020-08-27 21:37:15 +00:00
Ported back in 2015 (and since adapted) from an algorithm of my own design that was originally implemented in Python.
2020-04-30 18:10:32 +00:00
Now has a 3d mode!
2020-08-27 21:37:15 +00:00
Current blog posts about this project:
- [Language Review: Lua](https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html) (2D maze generator)
2020-09-12 23:43:13 +00:00
- [3D mazes with Lua, OpenSCAD, and Blender](#coming-soon) (https://starbeamrainbowlabs.com/blog/article.php?article=posts/429-lua-blender-mazes.html)
2020-08-27 21:37:15 +00:00
2020-08-27 22:13:04 +00:00
![Some renders in Blender with cycles of the output of the 3D maze generator](https://starbeamrainbowlabs.com/blog/images/20200831-mazes/mazes-small.png)
2020-08-27 22:12:21 +00:00
2020-08-27 21:37:15 +00:00
## Installation
### System Requirements
- **Required**
- [Lua](https://lua.org/)
- **Optional**
- [OpenSCAD](http://www.openscad.org/): for creating STL files and viewing generated .scad files
- [Blender](https://www.blender.org/): a great tool for importing generated STL files and having some fun rendering them
### Setup
Clone this repository:
```bash
git clone https://git.starbeamrainbowlabs.com/sbrl/multimaze.git
cd multimaze.lua
```
## Usage
See the usage information for the program by calling `main.lua` like so:
```
lua main.lua help
```
Operating modes:
Mode | Description
--------------------|----------------------
`help` | Displays the help text
`maze` | Generates 2D mazes and writes them to stdout
`maze3d` | Generates 3D mazes and writes them in layers to stdout
`maze3d_openscad` | Generates 3D mazes and writes an OpenSCAD file to the specified location
To render a 2D maze as ASCII, do this:
```bash
lua main.lua maze --width 25 --height 25
# Alternatively, in shorthand:
lua main.lua maze -w 25 -h 25
```
2020-04-30 18:10:32 +00:00
To render a 3D maze as a .STL file, do this:
```bash
2020-08-27 21:37:15 +00:00
# Generate the OpenSCAD file
lua main.lua maze3d_openscad -w 15 -h 15 -d 17 -f 15x15x17.scad
2020-08-27 21:37:15 +00:00
# Convert the OpenSCAD file to an STL
openscad -o 15x15x17.stl 15x15x17.scad
2020-04-30 18:10:32 +00:00
```
2020-08-27 21:37:15 +00:00
2020-09-12 23:43:13 +00:00
Users who have sh (Bash works too) installed can use the `maze` wrapper script instead:
```bash
./maze maze3d_openscad -w 15 -h 15 -d 17 -f 15x15x17.scad
./maze maze -w 25 -h 25
```
2020-08-27 22:41:31 +00:00
![(Horizontal line)](https://starbeamrainbowlabs.com/blog/images/20200831-mazes/hr.png)
2020-08-27 21:37:15 +00:00
## Contributing
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](https://devconnected.com/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.
1. By commenting on any of the blog posts (see links above)
2. By getting in touch through any of the methods mentioned on [my main website](https://starbeamrainbowlabs.com/)
3. If you know me IRL, that works too
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](https://liberapay.com/sbrl) if you'd like to donate to say an extra thank you :-)
## License
2020-08-27 21:39:04 +00:00
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](https://git.starbeamrainbowlabs.com/sbrl/multimaze/src/branch/master/LICENSE). Tldr legal have a [great summary](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)) of the license if you're interested.