Loading

A-Mazing Box

by wizard23, published

A-Mazing Box by wizard23 Dec 23, 2009

Featured Thing!

Description

A python script to generate OpenSCAD models to generate two parts of a box that screw together and snap fit if you find your way through the maze :)

UPDATE: because I got so many requests from people I now offer printed versions for sale at: hackerspaceshop.com/3dprinting/a-mazing-box.html
contact me for custom mazes :)

Recent Comments

view all
Awesome love it looks awesome thanks for making it.
In the end I just hacked the hack, I could get just one of the polysets to export as STL, then I managed to just model the base from there.
I got it! thanks for your help!

More from Interactive Art

view more

Liked By

view all

License

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

Instructions

Actually the maze pattern comes from the attached greyscale png :)

To regenerate the model adapt the png filename and the variable "part" in mazebox_clean2_stable.py (1 == bottom part, 2 == top part)

The png must be grayscale without an alpha channel.

The python script is a mess but I needed to get this done before xmas... Also sorry for the weird filenames, but thingiverse does not let me rename files...

The model was intended to have exact 1.5mm wall thickness when intersected with a plane parallel to the XY-plane (to get skeinforged into 2 layers) but the 3D inset operation is tricky so it sometimes is a little less but the repraped parts are still very stable after my makerbot printed for two hours :)
Awesome love it looks awesome thanks for making it.
You should make it so that there's no indent where the bump is so that its harder
that is quite easy to fix just look at the smaller openscad file and comment out the outher 3 sheres that get cut away (the last three)
I got it! thanks for your help!
maybe you could post that for me? thanks!
Which file?
what program did u use to make it
python and openscad the python program is attached
The source is really really broken in all the current tools.

If you can make a PNG that the python tools are happy with (the original got converted to a jpg by thingiverse BTW), it compiles with the maze too low on the model and renders to a thin flat disc.

One I hacked to have the maze in the right place on the compile renders better, but is clipped at about 15mm on the render.

:-( Any clues?
Yes the code is broken. The problem you describe happens because you have to adapt the number of pixels (height and width) that you want to use in the source code. It was a quick hack but the code is there and this is quite easy to fix just look at the first few python lines. maybe i'll find some time to do that during the holidays ;)
In the end I just hacked the hack, I could get just one of the polysets to export as STL, then I managed to just model the base from there.
These look like they would make great geocache containers :)
this is exactly what i was going to print these for :D more specifically this one thingiverse.com/thing:4098 :)
I love functional puzzles. I use mine to keep the pieces of my George Hart's 12 Stick Puzzle in. The lid goes about 2/3 of the way down and locks nicely. It's just a brilliant design and never easy to open.
Judging from the maze in your picture, you built my derivative Thing thingiverse.com/thing:6004 in which I had swapped the wrong-turns and right-turns as much as I could. (Compare the pictures carefully and you'll see the differences.)

I encourage you to build both versions and compare whether the derivative maze is harder, easier, or just different!
Anytime I try to compile the python generated model with openscad, even the sample, after an interminable compilation duration more appropriate for last century, openscad crashes with an obscure error.

terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: itl != it-
&
gt;second.end()

File: /usr/include/CGAL/Nef_3/SNC_external_structure.h

Line: 1088

Aborted

If you have gotten openscad to compile the python generated program, can you tell me what version of openscad you are using?

Thanks
oh sorry that happens when you have too sharp corners in the gray scale image and the inset algorithm screws up...either fix the inset code or add some gray scale gradient to avoid sharp cornered small lines that get inset weird...i still love this box idea and hope to find some time to fix the inset code to get rid of these excepion for real but its a little tricky maybe it would be better to uses some existing 2d library for the inset because basic inset is almost trivial (some 2d linear equations need to be solved) but the cornercases complicate everything and well I did not manage the first time I tried...maybe the community is faster than me? ;)
I intermittently encountered the same error, plus occasional winding errors, when I tried to repair my derivative. The errors go away if you * disable the second polyhedron, but I can't see anything wrong with the Python script that generates it.

Eventually I found a workaround by deleting the second polyhedron and replacing it with a copy of the first polyhedron prefixed with "translate([0,0,0.01]) scale([0.94,0.94,1.0]) " to cut out the hollow interior and offset it very slightly to avoid manifold errors. This gives approximately the sa
me 1.5mm wall thickness as the original Python output.

Another workaround is to delete the second polyhedron with "cylinder(h=80, r=23.4 );" to build a smooth interior wall. That gives a model whose walls vary from 1.5mm to 3.0mm in thickness due to the contours of the maze.
@VeryWetPaint these are two very good solutions. maybe I overcomplicated it by trying to inset it. My goal was back then to have a constant wall thickness so that it would always extrude exactly 2walls for the whole labyrinth. but now that the printing quality increased so much by using a stepper based extruder this workaround is no longer needed and a scaled version on the inside works just as well and should also speed up the openscad rendering time :)
Have you though about adding knurled ends?

I have trouble gripping the 2 ends!
excellent idea...you are right they ARE hard to grip and printed knurled things look amazingly beautiful. I was never really satisfied with the boring cylindrical surface.

I might actually do this next xmas...but maybe the community is faster than me ;)
Having some problems with getting the outer sleeve made as a more solid unit. Changing the infill property doesn't seem to affect it still being built as an inner and outer sleeve that's not very stiff. Any ideas please?
Set extra shells to 0 in the Fill module.
would it be really hard to connect all three of the mazes to make one big one that wraps all the way around the part?
no just adapt the pixel image you feed to the python script. it warps around 3 times the way the python code is now but this is a number you can modify just like the picture :)
hi Wizard!

thx allot for printing me this amazing showcase-Box 8-)

cya ;)
Awesome design. When I have time I'll try the scripts - printed out the example though!

Was a very tight fit - thank goodness I just installed twotime's z-axis wobble arrest or the path's would have been too bumpy to work smoothly.

I did sand off the z-axis ridges on the "knobs" on the top so it wouldn't have little ridges rubbing ridges.

Thanks for the excellent work!
on my makerbot it took about 50 minutes to print the larger and 40 minutes to print the smaller part...
how exactly do you use the script? i put all the files into 1 folder. after reading mazebox_clean2_stable.py i put the png in the playground folder but running mazebox_clean2_stable.py just opens a command window for a second then it closes.
run it in the command line like this (I think this should even work under windows although I only tested it under ubuntu):
python mazebox clean2 stable.py
&
gt; myBox.scad

You might want to adapt the variables (in the python code):
* "rn" (three times the x resolution of the image),
* "hn" (the y resolution of the image)
* "depth" (the image file)
* "part" (which part to generate)

It's a little bit messy because I had to finish this in time for xmas and did not clean it up afterwards...anyway if there are more questions please ask :)
Started printing this today on my school's starch and glue based printer, tomorrow I'll see if the thin walls are strong enough on this type of printer.
jon - in reply to jon
It worked alright. I'm guessing that the plastic parts shrink a little because my starch print didn't fit together until I sanded and filed it a little.
Printed on 0.25mm layer-height on a RepMan.
Had issues with missing png.py module. You can download here: code.google.com/p/pypng/
Wow, this is absolutely brilliant! :D
I want one! Must find a source of plastic in Ireland, I'm getting sick of being frugal with ABS..
Where do I get the missing testpng.py file?
I forgot it in the first place but II uploaded it now
Sweet! I knew something like this was on its way when saw your first lockbox :) Nice work!
thanks! in the xmas holidays i want to try out many new boxes with different patterns form other images...once it's programed it can be executed may times..the joy of parametric modeling ;)
OMG so awesome!
Top