Eric Weeks - personal pages - software

QUASI.C

Program to make quasi-crystalline patterns

weeks@physics.emory.edu

Software

Click here to see the source code, for my software (works with unix C compilers).

To compile:

gcc -o quasi quasi.c -lm

Click here to download quasi_color.c, a modified version by S J King that includes colors. He's commented the code with his name to indicate where he made changes, and if you have questions you can contact him at zh84stephen(at)googlemail.com.

This program makes Penrose tesselation pictures using a method I learned in a class I took, taught by Mike Marder. I have made a web page which describes the algorithm used by this program. Using this program, you can make the following sorts of pictures (although actually, some of the coloring has been added afterwards by changing the greyscale output of the program with the graphics program "xv").

(above picture made with command "quasi -z -n 80 -m 0.3 > quasi4.ps")

(above picture made with command "quasi -z -m 0.6 -S 7 > quasi7.ps")

Also, there is a feature for drawing just the line drawings rather than filling the polygons. (Not pictured on this page, though.) By using the -M and -N options you can create additional effects. These options connect the midpoints of pairs of sides of the quasi-crystal. -M controls how the skinny tiles are treated, and -N the fat tiles.

There are several pairs of sides. -M1 (or -N1) connects pairs of sides that meet at an acute angle; the -M2 command does the same for pairs meeting at an obtuse angle. -M4 does both, to create small rectangles inside each tile. -M3 connects opposite sides to form crossing lines inside each tile. -M5 randomly alternates between type 1 and 2; -M6 randomly alternates between types 1, 2, and 3.

(above picture made with the command "quasi -M1 -N1 > qmid1.ps")

(above picture made with the command "quasi -M2 -N2 > qmid2.ps")

(above picture made with the command "quasi -M3 -N3 > qmid3.ps")

(above picture made with the command "quasi -M1 -N2 > qmid4.ps")

(above picture made with the command "quasi -M2 -N1 > qmid5.ps")

(above picture made with the command "quasi -M5 -N5 > qmid6.ps")

(above picture made with the command "quasi -M3 -N2 > qmid7.ps")

Options

-h: help message explaining options -s: size of output on page, in cm (width) -f: fill the polygons randomly -z: fill the polygons in a pattern (works best for S=5) -F: flip picture on page; probably no reason to use this -m: you can enter a magnification factor; doesn't change size of total picture on page, but does change size of the individual polygons -M: connect the midpoints of skinny diamonds internally; can be done 6 different ways (see above). -M: connect the midpoints of fat diamonds internally; can be done 6 different ways (see above). -S: degrees of symmetry; ought to be an odd number 5 or larger. -n: number of lines to use; "lines" is an internal artifact used to make the quasi crystal. Larger numbers mean more tiles are created.