Class I Icosahedron Geodesic Sphere
Copying
programs in the c1icosa directory.
What is
copyleft?
GNU
Philosophy
The c1icosa directory contains
-
GNU Public License.
-
lib.mak: compiles a library of subroutines to
calculate Class I icosahedron geodesic spheres.
-
genc1.pl: a perl script to generate a C source program
to calculate vertices and strut lengths for an
icosacap triangle.
-
gensph.pl: a perl script for generating a C source
program to calculate vertices and strut lengths for
a half dome. Below the icosacap triangle, the C
program generates two half triangles extending
to the equator.
-
genmak.pl: a perl script for generating a make file to
compile each C program.
-
bldvtx.pl: a perl script for reading the output report
from the C program to produce a file of strut locations.
This perl script feeds the vtx2ppm and cap2ppm programs.
See below.
-
bldsph.pl: a perl script for reading the output report
from the C program to produce a file of strut locations.
This perl script feeds the dom2ppm and sph2ppm programs.
See below.
-
vtx2ppm: a C program to produce a PPM image of the icosacap
triangle, edge view.
-
cap2ppm: a C program to produce a PPM image of the icosacap
dome, front view.
-
sph2ppm: a C program to produce a PPM image of a half
dome, edge view. In this view one pentagon appears in
the front of the half dome, and one pentagon appears
on each side.
-
sph2ico: a C program to produce a PPM image of a half
dome, edge view. In this view one pentagon appears in
the front of the half dome, and one pentagon appears
on each side. The size of the image is 64 x 64 for
creating an icon.
-
sph2bg: a C program to produce a PPM background image
of a half dome, edge view. In this view one pentagon
appears in the front of the half dome, and one pentagon
appears on each side. The size of the image is small
enough to fit on an HTML page. The color is determined
by 3 RGB input parameters. See
Wallpaper below.
-
dom2ppm: a C program to produce a PPM image of a half
dome, front view. In this view two pentagons appear
in the front of the dome.
-
dom2ico: a C program to produce a PPM image of a half
dome, front view. In this view two pentagons appear
in the front of the dome. The size of the image is
64 x 64 for creating an icon.
-
dom2bg: a C program to produce a PPM background image
of a half dome, front view. In this view two pentagons
appear in the front of the dome.
The size of the image is small
enough to fit on an HTML page. The color is
determined by 3 RGB input parameters. See
Wallpaper below.
-
tr2ppm: a C program to produce a PPM image of a truncated
half dome, front view. In this view two pentagons appear
in the front of the dome. The dome looks like a
bucky ball, or a football/soccer ball.
-
gcview: an X Windows program to view a compressed PPM
file.
Purpose of using perl scripts.
The perl scripts in this directory inform you
about geodesic sphere calculations.
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.
Scope and limitations
The programs in this directory calculate vertices
and strut lengths for a geodesic dome based on an
icosahedron.
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.
Calculating a sphere
Run the script calc
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)
Calculating a half dome geodesic sphere
Run the script calcdome
Example:
calcdome 6
This example calculates the vertices and strut lengths
for a 6 frequency half dome from the north pole to
the equator.
Generating a PPM image of a triangle.
Run the script c1ppm to generate a
PPM image file of an icosacap triangle.
Example:
c1ppm 3
This example generates a PPM image file for a
3 frequency icosacap triangle.
Generating an icosacap PPM file
Run the script c1cap to generate a
PPM image file of an icosacap dome.
Example:
c1cap 3
This example generates a PPM image file for a
3 frequency icosacap dome.
Half dome PPM front view
Run the script c1dome to generate a
PPM image file of a half dome with two
pentagons in the center. This script also
generates a 64 x 64 image for creating an
icon.
Example:
c1dome 6
This example generates 2 PPM image files
for a 6 frequency half dome, front view.
Half dome PPM edge view
Run the script c1sph to generate a
PPM image file of a half dome with the
pentagon in the center. This script also
generates a 64 x 64 image for creating an
icon.
Example:
c1sph 6
This example generates 2 PPM image files
for a 6 frequency half dome.
Output Files
The following output files are created for a 6
frequency dome.
-
c1 in the file name refers to class 1.
-
v6 in the file name refers to frequency 6.
-
c1v6.c is the C program generated by Perl.
-
c1v6.mak is the make file generated by Perl.
-
c1v6 is the executable from the C program.
-
c1v6.txt is the output report from the C
program.
-
c1v6 creates c1v6.txt as standard output.
-
The output report contains phi/theta vertex coordinates
and strut lengths based on a radius of 1.
-
c1v6.vtx is the input to a PPM program.
-
6.ppm.gz is the PPM image file in compressed
format.
-
6i.ppm.gz is the PPM image file in compressed
format. The size is 64 x 64 pixels for creating an
icon.
Truncated Half dome, front view
Run the executable tr2ppm to generate a
PPM image file of a truncated half dome with
two pentagons in the center. The input file is
trunc.3v for a 3 frequency truncated
dome.
Example:
tr2ppm 3 <trunc.3v
The input file is trunc.6v for a 6 frequency
truncated dome.
Example:
tr2ppm 6 <trunc.6v
Truncated Half dome, edge view
Run the executable sph2ppm to generate a
PPM image file of a truncated half dome with
the pentagon in the center. The input file is
trunc.3v for a 3 frequency truncated
dome.
Example:
sph2ppm 3 <trunc.3v
The input file is trunc.6v for a 6 frequency
truncated dome.
Example:
sph2ppm 6 <trunc.6v
Geodesic Wallpaper
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
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.
Portable Pixel Map
The Portable Pixel Map (PPM) format for a
graphics image allows you to create a wide variety
of graphics files by using the netpbm
suite of programs.
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
|
Class I Octahedron
Class II Method 3 Icosaahedron
Class II Method 3 Octahedron