Blender addon to generate maze
The generated maze is "perfect"1, all cell could be visited and there is a way to throught it!
Download ZIP archive for your blender version:
In Blender preferences:
- remove older version if needed
- install addon from Preferences > Add-ons > Install...
- activate the addon
- Choose X and Y cells number
- Set cell size
- Choose an orientation and this level of influence on the result
- Add wall, height and thickness
- Add corner, radius and number of segments
- Add exits, create random entry and exit
- Update maze after this creation, wall, corner and exits
- Save maze in plein text
- Resolve maze
In Object Mode NX_Labyrinthe is located in the Sidebar (N) > NX_Tools
For your first try start with a little number of cells (under 10 or 15).
Set a size of cell. The final length of the maze depends of this 2 options.
Set wall height and thickness or let empty to generate only edges.
To creae Entrance and Exit, select Exits
Press Create Labyrinthe to generate maze in your scene
Maze of 15x15 cells, with wall height and thickness:
Maze corner with Radius set to 0.05 and Segments to 4:
The maze must be recreated if you want to change the number of cells or the Orientation.
In this case, click on New maze to generate a new maze with these settings.
For the other options, Cell Size, Wall, Corner and Exits, you can update the current maze without changing it.
As the addon uses Geometry Node to remove the edges and create the final maze, there seems to be a limit beyond which it's really hard and extremely slow to go!
I guess it depends on the hardware capabilities of the PC.
The best result I can get with my laptop and its 16 GB of RAM (16 GB more with the Swap partition...) was a maze of 100x100 cells.
If your archieve a better result I will very happy to see that! ๐
The initial code was found on this site (https://allophysique.com), in this article : Python Labyrinthe
A big thank to this anonymous author!
Footnotes
-
"A perfect maze is a maze where any two cells can be joined by a unique path" (Labirinthe.pdf) โฉ