Posted to tcl by kbk at Sun Jan 17 22:31:54 GMT 2010view pretty
# Points to define the unit cube
set points {
{0.0 0.0 0.0}
{1.0 0.0 0.0}
{1.0 1.0 0.0}
{0.0 1.0 0.0}
{0.0 0.0 1.0}
{1.0 0.0 1.0}
{1.0 1.0 1.0}
{0.0 1.0 1.0}
}
foreach pt $points {
lassign $pt x y z
lappend points [list [expr {0.25 + 0.5*$x}] [expr {0.25 + 0.5*$y}] $z]
}
# Try removing one of the faces to demonstrate holes.
set faces {
{0 8 9 1}
{1 9 10 2}
{2 10 11 3}
{3 11 8 0}
{0 1 5 4}
{1 2 6 5}
{2 3 7 6}
{3 0 4 7}
{4 5 13 12}
{5 6 14 13}
{6 7 15 14}
{7 4 12 15}
{8 9 13 12}
{9 10 14 13}
{10 11 15 14}
{11 8 12 15}
}