Categories
Stuff

Making a Tetratetraflexagon

Inspired by Kelli Anderson’s Recursive Card, I wanted to do something similarly interesting for my wedding last November. Rather than potentially confuse people receiving invitations, my wife suggested I do something with the wedding programs.

Kelli didn’t give instructions for her card, and I was in the process of figuring them out from the pictures and video, when I saw someone in the comments mention “flexagons”, similar folding structures that reveal new faces. After searching for a while, the most common from what I saw are various types of hexaflexagons, with six sides, and tetraflexagons, with four sides. For ease of construction, I settled on tetraflexagons. Although there are several types, I liked the one that I saw on Jill Britton’s Tetra-Tetra-Flexagon page (now offline, but you can find the pattern here), with the clear assembly instructions. I didn’t like how each face was so tall, however, so I cut off the bottom row of four boxes and adjusted the dimensions of each rectangle.

Side note: While I was preparing for the wedding, I hadn’t noticed that the inimitable Vi Hart had recently posted a few hexaflexagon videos. In fact, one of my wedding guests had made some hexaflexagons with his daughter shortly before the wedding.

Most flexagon instructions only give you numbers to tell you which face each panel is on, but I also needed to know the resulting position and orientation. After some trial and error, I ended up with a batch file of ImageMagick commands that will take four pictures and eventually give you two new ones, one for each side of a piece of letter-sized paper. The four pictures you use each have to be 5100 x 3300, unless you change the script. (I decided on 600dpi, and with 8.5″ x 11″ paper, you get 8.5 * 600 = 5100 and 5.5 * 600 = 3300)

The script breaks down the four pictures into top-left, top-right, bottom-left, and bottom-right with “convert”, rotates the necessary images with “mogrify”, then builds up the results with “montage”. NOTE: If saving it as a .bat file for the Windows Command Prompt, it already has a command called convert. If convert.exe is just in the path and not the current directory, it may call the wrong one.

Here’s everything you need to make some tetratetraflexagons:
tetra600dpi.txt – Script file for 5500×3300 pictures
tetra300dpi.txt – Script file for 2750×1650 pictures

Sample 5500×3300 input files: 1.png 2.png 3.png 4.png
1.png has assembly and usage instructions printed on it.

Final output: side1.png and side2.png
Get these if you just want to try folding and not bother with the script.

After you have your side1.png and side2.png, print them on opposite sides of the same piece of paper. Depending on your printer and settings, you may need to select centering or stretching options. The grids on each side should line up with each other. Be careful of the orientation when feeding it through again. 3tl should be going into the printer first, and when it’s done you should see 4tr on the other side right behind 3tl. My printer can’t print right to the edges, so trimming the edges, marked by the faint lines, from the top and bottom of the sheet is important for the paper to fold correctly. With text, trimming the left and right edges is less important, but you may wish to do it if you have pictures bordered by blank space. Then follow the cutting/folding/taping information on face 1.

So it’s not as fancy as Kelli’s recursive card, but I still thought it was neat.
Here’s the first tetratetraflexagon I made with pictures:
tetrapics
Happy folding!

Categories
Code

tasktimes / did

I don’t like tracking my time. Marking down the start and end times of a task and finding the difference is annoying. Although you can easily redirect the output of “date” to a file, you still have to calculate the difference. So I wrote something to do it for me. This sort of thing has been done before, but I didn’t know about the other solutions before making mine. I call it “tasktimes”. It’s written in C and you can get it on GitHub. If you’re on Windows and don’t have a C compiler, you might try the Tiny C Compiler.

From the command-line, you simply type:

task "TPS reports"

to start a task and later on type:

task off

to complete it. To get the report, type:

task times

and you’ll get something like:

--- Misc ---
2012/12/03 09:01:12 Mo ( 8:31:42) TPS reports
                 Total   8:31:42

After writing tasktimes, I thought I’d try making a simpler program to let you note whether you completed a certain task each day. Again, it’s easy to save dates to a file, but I wanted the analysis portion. It’s basically a “don’t break the chain“-style motivational program called “did”. It can also be found on GitHub and is also written in C.

From the command-line, you simply type:

did code

to log a task or

did code yest

to log a task done yesterday. Just typing “did” will give you the report.

      ########################################################################
 code #OOOO--OOOOO--OOOOO--OOOOO--OOOOO--OOOOO--OOOOO--OOOOO--OOOOO--OOOOO--O#
  exe #OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-OO-O#
write #-----------------------------------------------------------OOOOOOOOOOO#
      ########################################################################
 2013  0000000001111111111222222222233000000000111111111122222222200000000011
01-03  1234567890123456789012345678901123456789012345678901234567812345678901
       TWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSMTWTFSSM