OpenSCAD Maze Generator
by dnewman, published
Liked ByView All
Give a Shout Out
If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.Print Thing Tag
Ever need a maze generated for OpenSCAD? If so, then this puppy is for you. It is a Python script which generates a random N x M maze and outputs a 3D description of it as an OpenSCAD program.
The number of maze cells as well as the maze's physical size can all be controlled with command line arguments when running the Python script. The Python code can even be modified to generated non-rectangular mazes. (Hint: just throw up non-removable walls in the initialized maze data.)
BTW, the Python code here is derived from the Eggbot Maze generator, Eggmazing, which is distributed with the Eggbot software and is an Inkscape extension. I wrote that extension for the Eggbot in the Fall of 2010 and want to again thank W. Craig Trader for the assistance he provided with that effort.
9 June 2012: Corrected invalid commenting style in line 1 of OpenSCAD output
9 June 2012: Added warning when wall thickness (-t) is explicitly set to be thicker than one-half the cell's width or length.
Download the maze.py Python script and run it,
% python maze.py maze.scad
where the last argument, maze.scad, is the name of the output file to generate. The output is an OpenSCAD program which you can then load into OpenSCAD and render. Use whatever file name suits your fancy. If no name is supplied, then the OpenSCAD program is written to standard output, stdout.
The command line arguments can be seen with the command
% python maze.py --help
Usage: maze.py [-cfhlrtw] [output-file]
Number of maze columns running the maze width (default = 8)
Physical thickness in millimeters of the maze floor (default = 2.000000)
Physical height in millimeters of the maze (default = 8.000000)
Physical length in millimeters of the maze (default = 30.000000)
Number of maze rows running the maze height (default = 8)
Physical maze wall thickness in millimeters (default = 1.000000)
Physical width in millimeters of the maze (default = 30.000000)
Name of the output file to generated; if not specified then
output will be written to standard output
The two attached .stl files, maze-8x8.stl and maze-10x10.stl, were both generated with this script.
Upgrade this Thing with Thingiverse AppsCustomization
Edit, personalize, or revise this ThingPrint Fulfilment
Order a print of this ThingTools and Utilities
Repair, slice, or enhance this Thing
OpenSCAD Maze Generator by dnewman is licensed under the Creative Commons - Attribution - Share Alike license.
What does this mean?
- You must attribute (give credit) to the creator of this Thing.
- You must distribute Remixes under the same license as the original.
- Remixing or Changing this Thing is allowed.
- Commercial use is allowed.
Show Some Love
Say thanks by giving dnewman a tip and help them continue to share amazing Things with the Thingiverse community.Tip Designer
We're sure dnewman would love to see what you've printed. Please document your print and share a Make with the community.
To post a Make simply visit this Thing again and click I Made One to start uploading your photo. It’s even easier to post a Make via the Thingiverse Mobile app (available via Google Play and Apple App Store).