The c1icosa 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 generate spheres with frequencies from 1 to 32. You may generate higher frequency domes by modifying the perl script that generates the C program.
Spheres larger than frequency 8 use trusses or diamond shells for reinforcing their struts and vertices. The programs in this directory do not calculate trusses or diamond shells.
Example:
calc 3
This example calculates the vertices and strut lengths for a 3 frequency 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 3 frequency dome, the calculated strut length ranges around 30% or 40% 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 30% of the radius, the actual strut length is 6 feet when the radius is 20 feet.
D = 40 (Diameter)
S = .3 (Strut length when R = 1)
R = D / 2 (Radius)
L = R * S (Actual Strut Length)
Example:
calcdome 6
This example calculates the vertices and strut lengths for a 6 frequency half dome from the north pole to the equator.
Example:
c1ppm 3
This example generates a PPM image file for a 3 frequency icosacap triangle.
Example:
c1cap 3
This example generates a PPM image file for a 3 frequency icosacap dome.
Example:
c1dome 6
This example generates 2 PPM image files for a 6 frequency half dome, front view.
Example:
c1sph 6
This example generates 2 PPM image files for a 6 frequency half dome.
The following output files are created for a 6 frequency dome.
Example:
tr2ppm 3 <trunc.3v
The input file is trunc.6v for a 6 frequency truncated dome.
Example:
tr2ppm 6 <trunc.6v
Example:
sph2ppm 3 <trunc.3v
The input file is trunc.6v for a 6 frequency truncated dome.
Example:
sph2ppm 6 <trunc.6v
The dom2bg and sph2bg programs create wallpaper images of icosahedron domes. Below are two examples showing how to create wallpaper images.
Example 1, front view:
c1dome 3
# escape from gcview
perl getchord.pl <c1v3.vtx | dom2bg 3 230 230 250
zcat 3.ppm.gz | ppmtogif >3.gif
The example above creates a 3 frequency gif image to use as the background for an HTML document.
The three parameters 230 230 250 determine the RGB color of the background image.
Example 2, edge view:
c1sph 3
# escape from gcview
perl getchord.pl <c1v3.vtx | sph2bg 3 230 230 250
zcat 3.ppm.gz | ppmtogif >3.gif
The example above creates a 3 frequency gif image to use as the background for an HTML document.
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 <3.ppm.gz
This example displays a 3 frequency dome in X Windows.
The programs in this directory create PPM files in compressed format. The compression ratio can be as high as 99.5%. 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 3 frequency dome, 3.ppm.gz. This is a compressed file. zcat uncompresses the file and pipes the output to the conversion program.
| Format | Program |
|---|---|
| JPEG | zcat 3.ppm.gz | ppmtojpeg >3.jpg |
| PNG | zcat 3.ppm.gz | pnmtopng >3.png |
| TIFF | zcat 3.ppm.gz | pnmtotiff >3.tif |
| PGM | zcat 3.ppm.gz | ppmtopgm >3.pgm |
| PBM | pgmtopbm <3.pgm >3.pbm |
| G3 | pbmtog3 <3.pbm >3.g3 |
| GIF | zcat 3.ppm.gz | ppmtogif >3.gif |
The Image Magick program mogrify also allows you to convert the file format. See the table below.
The command in the second column is based on a 3 frequency dome.
| Format | Program |
|---|---|
| JPEG | mogrify -format jpeg 3.ppm |
| PNG | mogrify -format png 3.ppm |
| TIFF | mogrify -format tiff 3.ppm |
| PGM | mogrify -format pgm 3.ppm |
| PBM | mogrify -format pbm 3.ppm |
| FAX | mogrify -format fax 3.ppm |
| GIF | mogrify -format gif 3.ppm |