Hexaflexa is a python program which makes hexaflexagon printouts, such that each face of the hexaflexagon shows a different picture.
If you don't know what a hexaflexagon is, I recommend this great series of youtube videos by Victoria Hart or this website by Alejandro Kapauan or this book by Martin Gardner.
To run hexaflexa you need pycairo.
Run
python hexaflexa.py --output 012345.pdf 0.png 1.png 2.png 3.png 4.png 5.png
You have to put in six different pictures or some faces will be empty. You can put in up to nine different pictures. The last three pictures should be watermark-images with given transparency values.
- The first three pictures will be printed on the common faces of the hexaflexagon,
- the next three pictures will be printed on the hidden faces,
- the (optional) last three pictures will be printed over the first three faces, but twisted and with a watermark/transparency effect. These twisted faces always appear (in their right orientation) after a hidden face, whereas the common faces will be twisted.
This is a Sunday project. The main feature is that it works - more or less.
So:
- It only works with png image files. Convert all images to png. (Use for instance the program convert)
- You have to make sure that the images are more or less square shaped. If they are wider or higher the program crops out a square.
- Depending on the size of your images the pdf file can become very big. It can take long to open / print it. If you print on A4/letter paper 600x600 pixels for each picture should give a decent quality for the printout.
- Some pdf viewers/printers have problems with transparency in the pdf files generated by cairo. Try different viewers. The adobe viewer worked for me.
Protip:
- Use the alpha channel/transparency feature of png-images to generate cool effects.
To actually fold the hexaflexagon use for instance these instructions for the hexahexaflexagon.
If you read German, you can also use these very detailed instructions.
At first you need to cut out the four different double strips of the print out. Next you fold the double strip in the middle and glue it together to get a single strip that can be used to fold a hexahexaflexagon with one of the instruction sets above. Every printout results in four hexaflexagon double strips to save paper and trees.
If you find a bug or a problem with the instructions, you can write me a mail: michael.borinsky@posteo.de