Making Paper Squircle Fold-ups with ImageMagick
Years ago I received some advertising from IBM, content now long forgotten. What intrigued me was the unusual, large, glossy, black, glue-less envelope it came in. I kept that envelope for many years.
Its shape, when opened out, was a square with a semi-circle on each edge.
Recently I set out to create the same shape for some kids' craft. I used Imagemagick, that wonderful, open-source, graphics manipulation suite.
Here is an example
To make, just download and print, cut around the outside, crease and fold on the four edges of the square.
Here is my BASH shell script.
#!/bin/sh # draw four circles overlapping at the centre of the canvas # this method specifies the centre of each, then any point at a distance # of the radius away from the centre # Background will be a gradient of two colours # When printed the squircle can be folded into a self-interlocking envelope. COLOUR1=$1 COLOUR2=$2 if [ "$COLOUR1" = "" ]; then echo USAGE: doCircleEnvelope.sh colour1 colour2 echo where colours are, eg, blue yellow echo Note: second colour is optional else # here comes the image creation using ImageMagick's convert command # we make it 600 pixels square, black outlines, radial gradient applied to # the colour filling # the "\" is a line-continuation character. # the draw statements create 4 overlapping circles and then a square. convert -size 600x600 xc: -stroke Black -strokewidth 1 -fill radial-gradient:$COLOUR1-$COLOUR2 \ -draw 'circle 300,450 300,300' \ -draw 'circle 300,150 300,300' \ -draw 'circle 150,300 300,300' \ -draw 'circle 450,300 300,300' \ -draw 'rectangle 150,450,450,150' \ sqircle4-$COLOUR1-$COLOUR2.png fi exit
You can see what colours ImageMagick knows using this command
convert -list colours | less
If you want to try this Microsoft Windows, install the free ImageMagick kit, and copy the script contents into a text file such as "doCircleEnvelope.cmd". I'm a bit rusty now on Windows batch and command files, so you may need to comment our everything but the "convert" line. The " \" at the end of lines needs to become " ^". The "if-then-else" can be dropped - it is only to give the usage.
If you only specify one colour, the other seems to default to white or black, depending on the specified colour's hue.
16 March 2016 - I've added some variants using triangles instead of semi-circles. Much faster to cut out if you have a lot to do!
and here are the bash scripts
This page http://tardus.net/squircle.html published: 28 Feb 2016