The c2m3octa directory contains
They do not use the most efficient method for calculating a sphere.
You can learn best about geodesic math by studying the C source programs that the perl scripts generate.
Once you understand the structure of the C programs, you will understand the perl scripts more easily.
The programs in this directory fail if you create a sphere with an odd frequency.
The programs in this directory calculate vertices and strut lengths for the top symmetry triangle of a sphere based on an octahedron.
Each octahedron triangle on the sphere contains 3 symmetry triangles rotating 120 degrees. A 4th triangle fits in the center, symmetric in three directions.
The programs in this directory generate spheres with frequencies from 4 to 32.
You may modify the perl script to allow larger frequencies.
Spheres larger than frequency 8 use trusses or diamond shells for reinforcing the vertices.
Example:
calc 4
This example calculates the vertices and strut lengths for a frequency 4 sphere.
Vertex location is based on row and column in a triangle.
First digit is row.
Second digit is column.
The diagram below shows vertex locations on a 2v triangle.
0,0 /\ / \ / \ / \ 1,0 ------------ 1,1 / \ / \ / \ / \ / \ / \ / \ / \ -------------------------- 2,0 2,1 2,2
Vertices in a sphere are defined as phi and theta angles from the center of the sphere (the point of origin). The angle phi is the number of degrees south from the north pole. The angle theta is the number of degrees east of the 0 degree meridian.
The strut length in the calc program is calculated from a radius of 1. In an 4 frequency dome, the calculated strut length ranges around 50% or 60% of the radius length. If the diameter of the dome is 40 feet, the radius is 20 feet (40 / 2). Multiply the original strut length times the calculated radius to give the actual strut length. If the original strut length is 50% of the radius, the actual strut length is 10 feet when the radius is 20 feet.
D = 40 (Diameter)
S = .5 (Strut length when R = 1)
R = D / 2 (Radius)
L = R * S (Actual Strut Length)
Example:
c2m3ppm 4
This example generates a PPM file for a frequency 4 symmetry triangle.
The following output files are created for a 6 frequency dome.
gcview is an X Windows program to view a compressed PPM image file.
Input to gcview is standard input.
If the image is larger than the display window, use your arrow keys to scroll.
To terminate gcview, press escape.
Example of gcview:
gcview <4.ppm.gz
This example displays a 4 frequency dome in X Windows.
The PPM program in this directory creates a PPM file in compressed format. The compression ratio can be as high as 99%. To uncompress a PPM file, use...
The netpbm suite of programs allows you to convert between different graphics formats. Below is a partial list of formats with sample commands.
The command in the second column is based on a 4 frequency dome, 4.ppm.gz. This is a compressed file. zcat uncompresses the file and pipes the output to the conversion program.
Format | Program |
---|---|
JPEG | zcat 4.ppm.gz | ppmtojpeg >4.jpg |
PNG | zcat 4.ppm.gz | pnmtopng >4.png |
TIFF | zcat 4.ppm.gz | pnmtotiff >4.tif |
PGM | zcat 4.ppm.gz | ppmtopgm >4.pgm |
PBM | pgmtopbm <4.pgm >4.pbm |
G3 | pbmtog3 <4.pbm >4.g3 |
GIF | zcat 4.ppm.gz | ppmtogif >4.gif |
The Image Magick program mogrify also allows you to convert the file format. See the table below.
The example in the second column is based on a 4 frequency dome.
Format | Program |
---|---|
JPEG | mogrify -format jpeg 4.ppm |
PNG | mogrify -format png 4.ppm |
TIFF | mogrify -format tiff 4.ppm |
PGM | mogrify -format pgm 4.ppm |
PBM | mogrify -format pbm 4.ppm |
FAX | mogrify -format fax 4.ppm |
GIF | mogrify -format gif 4.ppm |