Class I Octahedron Geodesic Sphere

Copying programs in the c1octa directory.
What is copyleft?
GNU Philosophy

The c1octa directory contains

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 an octahedron triangle of a geodesic sphere.

The programs generate spheres with frequencies from 1 to 32. You may generate higher frequency domes by modifying whichever perl script generates the C program you want.

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 frequency 3 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 45% to 65% 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)


Generating a PPM file

Run the script c1ppm to generate a PPM image file of an octahedron triangle.

Example:

    c1ppm 3

This example generates a PPM image file for a frequency 3 octahedron triangle.


Half dome PPM front view

Run the script c1oct to generate a PPM image file of an octahedron half dome from a front view. This script also generates a 64 x 64 image for creating an icon.

Example:

    c1oct 3

This example generates a PPM file for a frequency 3 octahedron half dome, front view.


Output Files

The following output files are created for a 6 frequency dome.


Half dome PPM side view

Run the script c1cap to generate a PPM image file of an octahedron half dome from a side view. This script also generates a 64 x 64 image for creating an icon.

Example:

    c1cap 3

This example generates a PPM file for a frequency 3 octahedron half dome, side view.


Geodesic Wallpaper

The cap2bg and oct2bg programs create wallpaper images of octahedron domes. Below are two examples using these programs.

Example 1, front view:

    c1oct 3
    # escape from gcview
    perl getchord.pl <c1v3.vtx | oct2bg 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, side view:

    c1cap 3
    # escape from gcview
    perl getchord.pl <c1v3.vtx | cap2bg 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 Icosahedron     Class II Method 3 Icosahedron

Class II Method 3 Octahedron