This makes a customised puzzle box with random maze. Use OpenSCAD to render to an STL for 3D printing.
See https://www.thingiverse.com/thing:2410748 for examples.
Do click like on thingiverse. Gifts accepted (just because people have asked how they can do this).
Some parameters are subject to sanity checks, e.g. nubs set to helix if greater than 1, etc. See comments at top of output for parameters actually used.
Source code at https://github.com/revk/PuzzleBox