3D/2D Maze Generator (Blender/Python Script) for 3D Printers and Laser Cutters
thingiverse
EDIT 1 (3/24/15): Added Dual Extrusion Support. EDIT 2 (3/24/2015): Included option for Closed Entrances and Exits, along with setting for generating 2D Vector Path instead of 3D Mesh. Fixed minor redundancy in code. EDIT 3 (3/25/15): Resolved Minor Settings Conflict, Added more comments for Clarity. I've had a long-standing passion for Maze Generation for a while now. While I created several games using HTML5/Javascript and C, I wanted to build something physically tangible. A search on Thingiverse led me to a Python script generating an OpenSCAD description of a maze. However, that seemed like too roundabout an approach. Moreover, I prefer the classic recursive-backtracker algorithm over others due to its simplicity. I enjoy generating mazes greatly! I initially intended to implement it in OpenSCAD but decided against it as it utilizes a functional language, making it seemingly impossible (apparently, I was entirely wrong!). I managed to get it working within Blender using a Python script. This took roughly a year of sparse tinkering. Initially, I tried to use booleans for adding and subtracting cuboids but encountered issues due to finicky normals. So, I ended up generating the maze as a 2D mesh (vertex by vertex, face by face) and then extruding it with added base later on. This is fully functional, yet there are still a few features I wish to add. One feature that would be amazing is marking the start and end of the maze. If you have any ideas on how to implement this, kindly leave a comment below! P.S. For fun, the 20x20_humanSize.stl is a suitable human-scaled maze for a stroll (62600 mm x 626000 mm total, about 98.6 acres). Settings used: width = 20 # how many cells wide length = 20 # how many cells long cellThickness = 2500 # width of passages [mm] wallThickness = 600 # width of walls [mm] wallHeight = 2500 # height of walls [mm] baseHeight = 300 # height of base [mm] Good luck printing at scale! Instructions To create your own maze, download Maze Generator.blend and open it in Blender. Read the script instructions within for clarity. When finished, select the object, navigate to File>Export>Stl (.stl). Enjoy your printed maze without supports needed! I recommend the wall width to be a multiple of your nozzle diameter so you can print walls solidly using only shells. For instance, with a 0.4 mm nozzle, you can print walls at 2 shell thickness (1mm total) if they're 0.4*2 mm thick. Alternatively, you could laser cut them! Support is limited for this, but set the wallHeight to zero and it will create paths instead of a mesh. Export it as an SVG using Blender's exporter to get creative with it! Files are provided within the project, such as the 15x15_ball_maze.ai file for ball mazes. Please credit me and add it as a remix if you make your own 3D or laser-cut designs from this project. Instead of using the .blend file, you could also load the blender_maze_gen.py in Blender but see little reason to do so.
With this file you will be able to print 3D/2D Maze Generator (Blender/Python Script) for 3D Printers and Laser Cutters with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on 3D/2D Maze Generator (Blender/Python Script) for 3D Printers and Laser Cutters.