Category : Printer + Display Graphics
Archive   : PLYDAT.ZIP
Filename : POLYTOPE.PI

 
Output of file : POLYTOPE.PI contained in archive : PLYDAT.ZIP
#
# Polyray data file by Alexander Enzmann
# 4 February 1992
#
# A number of polytopes (including the 5 regular polyhedra):
# tetrahedron, cube, octahedron, dodecahedron, icosahedron,
# stella_octangula, compound_cubocta, compound_dodecicos,
# cuboctahedron, and icosidodecahedron.
#
# Each of the 5 platonic solids has been scaled so that it exactly
# fits into a sphere of radius 1.
#

viewpoint {
from <0,0,-12>
at <0,0,0>
up <0,1,0>
angle 45
resolution 256, 256
}

background midnight_blue
light < 20,30,-20>
light <-20,30,-20>

bounding_slab <1, 0, 0>
bounding_slab <0, 1, 0>
bounding_slab <0, 0, 1>

include "colors.inc"

define tau 1.6180339887 # Golden mean = (1 + sqrt(5))/2
define itau 0.6180339888 # tau^-1

# dist to vertex = 1.73073
define tetrahedron
object {
object { polynomial x + y + z - 1 }
* object { polynomial x - y - z - 1 }
* object { polynomial -x + y - z - 1 }
* object { polynomial -x - y + z - 1 }
bounds object { sphere <0, 0, 0>, 1.73073 }
scale <1/1.73073, 1/1.73073, 1/1.73073>
}

# dist to a vertex = 1.73205
define cube
object {
object { polynomial x - 1 }
* object { polynomial y - 1 }
* object { polynomial z - 1 }
* object { polynomial -x - 1 }
* object { polynomial -y - 1 }
* object { polynomial -z - 1 }
bounds object { sphere <0, 0, 0>, 1.73205 }
scale <1/1.73205, 1/1.73205, 1/1.73205>
}

# dist to vertex = 1
define octahedron
object {
object { polynomial x + y + z - 1 }
* object { polynomial x + y - z - 1 }
* object { polynomial x - y + z - 1 }
* object { polynomial x - y - z - 1 }
* object { polynomial -x + y + z - 1 }
* object { polynomial -x + y - z - 1 }
* object { polynomial -x - y + z - 1 }
* object { polynomial -x - y - z - 1 }
bounds object { sphere <0, 0, 0>, 1 }
}

# dist to vertex = 0.66158
define dodecahedron
object {
object { polynomial z + tau * y - 1 }
* object { polynomial z - 1.6180339887 * y - 1 }
* object { polynomial -z + 1.6180339887 * y - 1 }
* object { polynomial -z - tau * y - 1 }
* object { polynomial x + tau * z - 1 }
* object { polynomial x - tau * z - 1 }
* object { polynomial -x + tau * z - 1 }
* object { polynomial -x - tau * z - 1 }
* object { polynomial y + tau * x - 1 }
* object { polynomial y - tau * x - 1 }
* object { polynomial -y + tau * x - 1 }
* object { polynomial -y - tau * x - 1 }
bounds object { sphere <0, 0, 0>, 0.66158 }
scale <1/0.66158, 1/0.66158, 1/0.66158>
}

# Icosahedron, dist from center to a vertex = 0.72654
define icosahedron
object {
object { polynomial x + y + z - 1 }
* object { polynomial x + y - z - 1 }
* object { polynomial x - y + z - 1 }
* object { polynomial x - y - z - 1 }
* object { polynomial -x + y - z - 1 }
* object { polynomial -x + y - z - 1 }
* object { polynomial -x - y - z - 1 }
* object { polynomial -x - y - z - 1 }
* object { polynomial itau * y + tau * z - 1 }
* object { polynomial itau * y - tau * z - 1 }
* object { polynomial -itau * y + tau * z - 1 }
* object { polynomial -itau * y - tau * z - 1 }
* object { polynomial itau * z + tau * x - 1 }
* object { polynomial itau * z - tau * x - 1 }
* object { polynomial -itau * z + tau * x - 1 }
* object { polynomial -itau * z - tau * x - 1 }
* object { polynomial itau * x + tau * y - 1 }
* object { polynomial itau * x - tau * y - 1 }
* object { polynomial -itau * x + tau * y - 1 }
* object { polynomial -itau * x - tau * y - 1 }
bounds object { sphere <0, 0, 0>, 0.72654 }
scale <1/0.72654, 1/0.72654, 1/0.72654>
}

# Simplest compound figure, two tetrahedrons
define stella_octangula
object {
tetrahedron
+ tetrahedron { rotate <180, 90, 0> }
}

# Compound figure made out of cube and octahedron
define compound_cubocta
object {
cube + octahedron { scale <1.1547, 1.1547, 1.1547> }
}

# Compound figure made out of dodecahedron and icosahedron
define compound_dodecicos
object {
dodecahedron + icosahedron { scale <1.0982, 1.0982, 1.0982> }
}

# The two quasi-regular polytopes
define cuboctahedron
object {
cube * octahedron { scale <1.1547, 1.1547, 1.1547> }
}

define icosidodecahedron
object {
dodecahedron * icosahedron { scale <1.0982, 1.0982, 1.0982> }
}

# Place the various polytopes in a circles around
# a sphere
define red_tex matte_red
define green_tex matte_green

tetrahedron {
rotate <15, 15, 0>
translate <2, 0, 2>
red_tex
}
cube {
rotate <15, 15, 0>
translate <2*cos(radians(72)), 2*sin(radians(72)), 2>
red_tex
}
octahedron {
rotate <15, 15, 0>
translate <2*cos(radians(144)), 2*sin(radians(144)), 2>
red_tex
}
dodecahedron {
rotate <15, 15, 0>
translate <2*cos(radians(-144)), 2*sin(radians(-144)), 2>
red_tex
}
icosahedron {
rotate <15, 15, 0>
translate <2*cos(radians(-72)), 2*sin(radians(-72)), 2>
red_tex
}

stella_octangula {
rotate <15, 15, 0>
translate <3*cos(radians(36)), 3*sin(radians(36)), 0>
green_tex
}
compound_cubocta {
rotate <15, 15, 0>
translate <3*cos(radians(108)), 3*sin(radians(108)), 0>
green_tex
}
compound_dodecicos {
rotate <15, 15, 0>
translate <3*cos(radians(180)), 3*sin(radians(180)), 0>
green_tex
}
cuboctahedron {
rotate <15, 15, 0>
translate <3*cos(radians(-108)), 3*sin(radians(-108)), 0>
green_tex
}
icosidodecahedron {
rotate <15, 15, 0>
translate <3*cos(radians(-36)), 3*sin(radians(-36)), 0>
green_tex
}


  3 Responses to “Category : Printer + Display Graphics
Archive   : PLYDAT.ZIP
Filename : POLYTOPE.PI

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/