[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[QUIZ] Geodesic Dome Faces (#3

James Gray

10/8/2004 1:01:00 PM

The three rules of Ruby Quiz:

1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.

2. Support Ruby Quiz by submitting ideas as often as you can:

http://www.grayproductions.net/...

3. Enjoy!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

by Gavin Kistner

SUMMARY

Given the faces for a tetrahedron, octahedron, or isocahedron, create a geodesic
dome of arbitrary frequency.

The (equilateral triangle) faces of each primitive are given as triplets of
vertex points. Each vertex is itself a triplet of cartesian 3-space coordinates,
all of unit-distance from 0,0,0. (See the supplied points at the end for an
example.) The resulting geodesic should be an array of triangular faces; again
each face is a triplet of points, and each point is unit-distance from 0,0,0.

DETAILS

A 'simple' solution (using recursion) exists to subdivide each primary face into
4^n sub-faces. Instead, the following (more flexible) algorithm should be used,
which allows for n^2 sub-faces:

[See http://phrogz.net/CSS/Geodesics/... for a visual example of the
following algorithm.]

Step 1) Start with the three points defining a primary face.

Step 2) Divide each side of the face into equal length pieces; the number of
pieces is specified by the 'frequency'. (A frequency of 0 subdivides the face
not at all, a frequency of 1 divides each side into two equal pieces, a
frequency of 2 into three equal pieces, and so on.)

Step 3) Connect each division point along two sides with a line that is parallel
to the third side.

Step 4) Repeat with lines parallel to all three sides.

Step 5) New points are defined wherever the lines intersect.

The combination of the initial face points, the edge points, and the
intersection of the connecting lines provide the points for the faces of the
geodesic. (As diagrammed in http://phrogz.net/CSS/Geodesics/...#step5,
the 16 faces created by subdividing the primary face with frequency 3 can be
described as Aqm, qfm, qrf, rgf, rsg, szg, sBz, mfn, fhn, fgh, gyh, gzy, nho,
hxo, hyx, oxC. )

All points should be 'normalized', so that they are unit-distance from the
origin.

For extra points, ensure that the points for each face are always specified in
the same direction, clockwise or counter-clockwise when looking from the origin.
(The above list of faces are all specified in a clockwise direction.)

STARTER DATA

The points for the three primitives follow. (Solving for any one of them solves
for all of them.)

SQRT2 = Math.sqrt(2)
SQRT3 = Math.sqrt(3)
TETRA_Q = SQRT2 / 3
TETRA_R = 1.0 / 3
TETRA_S = SQRT2 / SQRT3
TETRA_T = 2 * SQRT2 / 3
GOLDEN_MEAN = (Math.sqrt(5)+1)/2

PRIMITIVES = {
:tetrahedron => {
:points => {
'a' => Vector[ -TETRA_S, -TETRA_Q, -TETRA_R ],
'b' => Vector[ TETRA_S, -TETRA_Q, -TETRA_R ],
'c' => Vector[ 0, TETRA_T, -TETRA_R ],
'd' => Vector[ 0, 0, 1 ]
},
:faces => %w| acb abd adc dbc |
},
:octahedron => {
:points => {
'a' => Vector[ 0, 0, 1 ],
'b' => Vector[ 1, 0, 0 ],
'c' => Vector[ 0, -1, 0 ],
'd' => Vector[ -1, 0, 0 ],
'e' => Vector[ 0, 1, 0 ],
'f' => Vector[ 0, 0, -1 ]
},
:faces => %w| cba dca eda bea
def ebf bcf cdf |
},
:icosahedron => {
:points => {
'a' => Vector[ 1, GOLDEN_MEAN, 0 ],
'b' => Vector[ 1, -GOLDEN_MEAN, 0 ],
'c' => Vector[ -1, -GOLDEN_MEAN, 0 ],
'd' => Vector[ -1, GOLDEN_MEAN, 0 ],
'e' => Vector[ GOLDEN_MEAN, 0, 1 ],
'f' => Vector[ -GOLDEN_MEAN, 0, 1 ],
'g' => Vector[ -GOLDEN_MEAN, 0, -1 ],
'h' => Vector[ GOLDEN_MEAN, 0, -1 ],
'i' => Vector[ 0, 1, GOLDEN_MEAN ],
'j' => Vector[ 0, 1, -GOLDEN_MEAN ],
'k' => Vector[ 0, -1, -GOLDEN_MEAN ],
'l' => Vector[ 0, -1, GOLDEN_MEAN ]
},
:faces => %w| iea iad idf ifl ile
eha ajd dgf fcl lbe
ebh ahj djg fgc lcb
khb kjh kgj kcg kbc |
}
}


30 Answers

Jamis Buck

10/8/2004 8:08:00 PM

0

Sorry if I'm just dense, but...

What's the deliverable for this quiz? I *think* I understand the
problem, but are we supposed to emit the points of the dome to a file?
Are we supposed to do an OpenGL interface that draws the dome? Are we
supposed to plug our script into an industrial robot and have it start
cranking out full-size geodesic domes for use in construction projects?

Just curious what was expected. :)

- Jamis

Ruby Quiz wrote:
> The three rules of Ruby Quiz:
>
> 1. Please do not post any solutions or spoiler discussion for this quiz until
> 48 hours have passed from the time on this message.
>
> 2. Support Ruby Quiz by submitting ideas as often as you can:
>
> http://www.grayproductions.net/...
>
> 3. Enjoy!
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> by Gavin Kistner
>
> SUMMARY
>
> Given the faces for a tetrahedron, octahedron, or isocahedron, create a geodesic
> dome of arbitrary frequency.
>
> The (equilateral triangle) faces of each primitive are given as triplets of
> vertex points. Each vertex is itself a triplet of cartesian 3-space coordinates,
> all of unit-distance from 0,0,0. (See the supplied points at the end for an
> example.) The resulting geodesic should be an array of triangular faces; again
> each face is a triplet of points, and each point is unit-distance from 0,0,0.
>
> DETAILS
>
> A 'simple' solution (using recursion) exists to subdivide each primary face into
> 4^n sub-faces. Instead, the following (more flexible) algorithm should be used,
> which allows for n^2 sub-faces:
>
> [See http://phrogz.net/CSS/Geodesics/... for a visual example of the
> following algorithm.]
>
> Step 1) Start with the three points defining a primary face.
>
> Step 2) Divide each side of the face into equal length pieces; the number of
> pieces is specified by the 'frequency'. (A frequency of 0 subdivides the face
> not at all, a frequency of 1 divides each side into two equal pieces, a
> frequency of 2 into three equal pieces, and so on.)
>
> Step 3) Connect each division point along two sides with a line that is parallel
> to the third side.
>
> Step 4) Repeat with lines parallel to all three sides.
>
> Step 5) New points are defined wherever the lines intersect.
>
> The combination of the initial face points, the edge points, and the
> intersection of the connecting lines provide the points for the faces of the
> geodesic. (As diagrammed in http://phrogz.net/CSS/Geodesics/...#step5,
> the 16 faces created by subdividing the primary face with frequency 3 can be
> described as Aqm, qfm, qrf, rgf, rsg, szg, sBz, mfn, fhn, fgh, gyh, gzy, nho,
> hxo, hyx, oxC. )
>
> All points should be 'normalized', so that they are unit-distance from the
> origin.
>
> For extra points, ensure that the points for each face are always specified in
> the same direction, clockwise or counter-clockwise when looking from the origin.
> (The above list of faces are all specified in a clockwise direction.)
>
> STARTER DATA
>
> The points for the three primitives follow. (Solving for any one of them solves
> for all of them.)
>
> SQRT2 = Math.sqrt(2)
> SQRT3 = Math.sqrt(3)
> TETRA_Q = SQRT2 / 3
> TETRA_R = 1.0 / 3
> TETRA_S = SQRT2 / SQRT3
> TETRA_T = 2 * SQRT2 / 3
> GOLDEN_MEAN = (Math.sqrt(5)+1)/2
>
> PRIMITIVES = {
> :tetrahedron => {
> :points => {
> 'a' => Vector[ -TETRA_S, -TETRA_Q, -TETRA_R ],
> 'b' => Vector[ TETRA_S, -TETRA_Q, -TETRA_R ],
> 'c' => Vector[ 0, TETRA_T, -TETRA_R ],
> 'd' => Vector[ 0, 0, 1 ]
> },
> :faces => %w| acb abd adc dbc |
> },
> :octahedron => {
> :points => {
> 'a' => Vector[ 0, 0, 1 ],
> 'b' => Vector[ 1, 0, 0 ],
> 'c' => Vector[ 0, -1, 0 ],
> 'd' => Vector[ -1, 0, 0 ],
> 'e' => Vector[ 0, 1, 0 ],
> 'f' => Vector[ 0, 0, -1 ]
> },
> :faces => %w| cba dca eda bea
> def ebf bcf cdf |
> },
> :icosahedron => {
> :points => {
> 'a' => Vector[ 1, GOLDEN_MEAN, 0 ],
> 'b' => Vector[ 1, -GOLDEN_MEAN, 0 ],
> 'c' => Vector[ -1, -GOLDEN_MEAN, 0 ],
> 'd' => Vector[ -1, GOLDEN_MEAN, 0 ],
> 'e' => Vector[ GOLDEN_MEAN, 0, 1 ],
> 'f' => Vector[ -GOLDEN_MEAN, 0, 1 ],
> 'g' => Vector[ -GOLDEN_MEAN, 0, -1 ],
> 'h' => Vector[ GOLDEN_MEAN, 0, -1 ],
> 'i' => Vector[ 0, 1, GOLDEN_MEAN ],
> 'j' => Vector[ 0, 1, -GOLDEN_MEAN ],
> 'k' => Vector[ 0, -1, -GOLDEN_MEAN ],
> 'l' => Vector[ 0, -1, GOLDEN_MEAN ]
> },
> :faces => %w| iea iad idf ifl ile
> eha ajd dgf fcl lbe
> ebh ahj djg fgc lcb
> khb kjh kgj kcg kbc |
> }
> }
>
> .
>


--
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck...


Gavin Kistner

10/9/2004 3:38:00 PM

0

On Oct 8, 2004, at 7:00 AM, Ruby Quiz wrote:
> [See http://phrogz.net/CSS/Geodesics/... for a visual example
> of the
> following algorithm.]

Also, although it will give you no additional help on the programming
side of things, the algorithm is also described in this paper on
Geodesic Math:
http://www.salsburg.com/geod/geodes...

Specifically, the method being employed by this quiz is the "Class I,
Method 1 or 'alternate'" method, described starting on page 9 and
illustrated on page 10.

(Just in case my description confuses you, and you find something in
this paper more clarifying.)

--
(-, /\ \/ / /\/



Fredrik Jagenheim

10/9/2004 7:02:00 PM

0

On Sat, 9 Oct 2004 05:07:42 +0900, Jamis Buck <jgb3@email.byu.edu> wrote:
>
> Just curious what was expected. :)

Yes, you're not the only one confused. It would be great if there was
a solution given that one could use to compare the output from,
preferably from a simple case as 'given these coordinates, you should
get these coordinates.'

This have the added benefits of knowing what the expected output would be. :)

Otherwise, I thought it was a great quiz. Mostly because it was in a
problem domain I'm not customed to. So I had to think harder about it.
:)

Actually, the three Quizes that has been so far have been great,
though my solutions haven't added anything new to the solutions
already posted, so I haven't bothered to post them.

//F


Gavin Kistner

10/9/2004 7:57:00 PM

0

On Oct 9, 2004, at 1:02 PM, Fredrik Jagenheim wrote:
> Yes, you're not the only one confused. It would be great if there was
> a solution given that one could use to compare the output from,
> preferably from a simple case as 'given these coordinates, you should
> get these coordinates.'

I can give you that (below, with rounded values to preserve line
wrapping) but the problem is that the order of faces, and points within
those faces, can be specified in any order and still achieve the same
end result.

Still, when it comes time to actually verifying any solutions, some
sort of structured format would be nice, so that I can read them in,
plot them, and see if it looks right. :)

Sample output for a tetrahedron of frequency 0:
[ [ -0.816, -0.471, -0.333 ], [ 0.000, 0.943, -0.333 ], [ 0.816,
-0.471, -0.333 ] ]
[ [ -0.816, -0.471, -0.333 ], [ 0.816, -0.471, -0.333 ], [ 0.000,
0.000, 1.000 ] ]
[ [ -0.816, -0.471, -0.333 ], [ 0.000, 0.000, 1.000 ], [ 0.000,
0.943, -0.333 ] ]
[ [ 0.000, 0.000, 1.000 ], [ 0.816, -0.471, -0.333 ], [ 0.000,
0.943, -0.333 ] ]

Sample output for an octahedron of frequency 1:
[ [ 0.000, -0.707, 0.707 ], [ 0.707, 0.000, 0.707 ], [ 0.000,
0.000, 1.000 ] ]
[ [ 0.000, -0.707, 0.707 ], [ 0.000, -1.000, 0.000 ], [ 0.707,
-0.707, 0.000 ] ]
[ [ 0.707, 0.000, 0.707 ], [ 0.000, -0.707, 0.707 ], [ 0.707,
-0.707, 0.000 ] ]
[ [ 1.000, 0.000, 0.000 ], [ 0.707, 0.000, 0.707 ], [ 0.707,
-0.707, 0.000 ] ]
[ [ -0.707, 0.000, 0.707 ], [ 0.000, -0.707, 0.707 ], [ 0.000,
0.000, 1.000 ] ]
[ [ -0.707, 0.000, 0.707 ], [ -1.000, 0.000, 0.000 ], [ -0.707,
-0.707, 0.000 ] ]
[ [ 0.000, -0.707, 0.707 ], [ -0.707, 0.000, 0.707 ], [ -0.707,
-0.707, 0.000 ] ]
[ [ 0.000, -1.000, 0.000 ], [ 0.000, -0.707, 0.707 ], [ -0.707,
-0.707, 0.000 ] ]
[ [ 0.000, 0.707, 0.707 ], [ -0.707, 0.000, 0.707 ], [ 0.000,
0.000, 1.000 ] ]
[ [ 0.000, 0.707, 0.707 ], [ 0.000, 1.000, 0.000 ], [ -0.707,
0.707, 0.000 ] ]
[ [ -0.707, 0.000, 0.707 ], [ 0.000, 0.707, 0.707 ], [ -0.707,
0.707, 0.000 ] ]
[ [ -1.000, 0.000, 0.000 ], [ -0.707, 0.000, 0.707 ], [ -0.707,
0.707, 0.000 ] ]
[ [ 0.707, 0.000, 0.707 ], [ 0.000, 0.707, 0.707 ], [ 0.000,
0.000, 1.000 ] ]
[ [ 0.707, 0.000, 0.707 ], [ 1.000, 0.000, 0.000 ], [ 0.707,
0.707, 0.000 ] ]
[ [ 0.000, 0.707, 0.707 ], [ 0.707, 0.000, 0.707 ], [ 0.707,
0.707, 0.000 ] ]
[ [ 0.000, 1.000, 0.000 ], [ 0.000, 0.707, 0.707 ], [ 0.707,
0.707, 0.000 ] ]
[ [ -0.707, 0.000, -0.707 ], [ 0.000, 0.707, -0.707 ], [ 0.000,
0.000, -1.000 ] ]
[ [ -0.707, 0.000, -0.707 ], [ -1.000, 0.000, 0.000 ], [ -0.707,
0.707, 0.000 ] ]
[ [ 0.000, 0.707, -0.707 ], [ -0.707, 0.000, -0.707 ], [ -0.707,
0.707, 0.000 ] ]
[ [ 0.000, 1.000, 0.000 ], [ 0.000, 0.707, -0.707 ], [ -0.707,
0.707, 0.000 ] ]
[ [ 0.000, 0.707, -0.707 ], [ 0.707, 0.000, -0.707 ], [ 0.000,
0.000, -1.000 ] ]
[ [ 0.000, 0.707, -0.707 ], [ 0.000, 1.000, 0.000 ], [ 0.707,
0.707, 0.000 ] ]
[ [ 0.707, 0.000, -0.707 ], [ 0.000, 0.707, -0.707 ], [ 0.707,
0.707, 0.000 ] ]
[ [ 1.000, 0.000, 0.000 ], [ 0.707, 0.000, -0.707 ], [ 0.707,
0.707, 0.000 ] ]
[ [ 0.707, 0.000, -0.707 ], [ 0.000, -0.707, -0.707 ], [ 0.000,
0.000, -1.000 ] ]
[ [ 0.707, 0.000, -0.707 ], [ 1.000, 0.000, 0.000 ], [ 0.707,
-0.707, 0.000 ] ]
[ [ 0.000, -0.707, -0.707 ], [ 0.707, 0.000, -0.707 ], [ 0.707,
-0.707, 0.000 ] ]
[ [ 0.000, -1.000, 0.000 ], [ 0.000, -0.707, -0.707 ], [ 0.707,
-0.707, 0.000 ] ]
[ [ 0.000, -0.707, -0.707 ], [ -0.707, 0.000, -0.707 ], [ 0.000,
0.000, -1.000 ] ]
[ [ 0.000, -0.707, -0.707 ], [ 0.000, -1.000, 0.000 ], [ -0.707,
-0.707, 0.000 ] ]
[ [ -0.707, 0.000, -0.707 ], [ 0.000, -0.707, -0.707 ], [ -0.707,
-0.707, 0.000 ] ]
[ [ -1.000, 0.000, 0.000 ], [ -0.707, 0.000, -0.707 ], [ -0.707,
-0.707, 0.000 ] ]

Sample output for a tetrahedron of frequency 2:
[ [ 0.426, -0.739, -0.522 ], [ 0.853, 0.000, -0.522 ], [ 0.816,
-0.471, -0.333 ] ]
[ [ 0.426, 0.739, -0.522 ], [ -0.426, 0.739, -0.522 ], [ 0.000,
0.943, -0.333 ] ]
[ [ -0.426, 0.739, -0.522 ], [ 0.426, 0.739, -0.522 ], [ 0.000,
0.000, -1.000 ] ]
[ [ -0.853, 0.000, -0.522 ], [ -0.426, 0.739, -0.522 ], [ 0.000,
0.000, -1.000 ] ]
[ [ -0.426, -0.739, -0.522 ], [ -0.853, 0.000, -0.522 ], [ 0.000,
0.000, -1.000 ] ]
[ [ 0.426, -0.739, -0.522 ], [ -0.426, -0.739, -0.522 ], [ 0.000,
0.000, -1.000 ] ]
[ [ 0.853, 0.000, -0.522 ], [ 0.426, -0.739, -0.522 ], [ 0.000,
0.000, -1.000 ] ]
[ [ 0.426, 0.739, -0.522 ], [ 0.853, 0.000, -0.522 ], [ 0.000,
0.000, -1.000 ] ]
[ [ -0.853, 0.000, -0.522 ], [ -0.426, -0.739, -0.522 ], [ -0.816,
-0.471, -0.333 ] ]
[ [ -0.426, -0.246, 0.870 ], [ 0.426, -0.246, 0.870 ], [ 0.000,
0.000, 1.000 ] ]
[ [ 0.853, -0.492, 0.174 ], [ 0.426, -0.739, -0.522 ], [ 0.816,
-0.471, -0.333 ] ]
[ [ 0.426, -0.739, -0.522 ], [ 0.853, -0.492, 0.174 ], [ 0.000,
-0.943, 0.333 ] ]
[ [ -0.426, -0.739, -0.522 ], [ 0.426, -0.739, -0.522 ], [ 0.000,
-0.943, 0.333 ] ]
[ [ -0.853, -0.492, 0.174 ], [ -0.426, -0.739, -0.522 ], [ 0.000,
-0.943, 0.333 ] ]
[ [ -0.426, -0.246, 0.870 ], [ -0.853, -0.492, 0.174 ], [ 0.000,
-0.943, 0.333 ] ]
[ [ 0.426, -0.246, 0.870 ], [ -0.426, -0.246, 0.870 ], [ 0.000,
-0.943, 0.333 ] ]
[ [ 0.853, -0.492, 0.174 ], [ 0.426, -0.246, 0.870 ], [ 0.000,
-0.943, 0.333 ] ]
[ [ -0.426, -0.739, -0.522 ], [ -0.853, -0.492, 0.174 ], [ -0.816,
-0.471, -0.333 ] ]
[ [ -0.426, 0.739, -0.522 ], [ 0.000, 0.985, 0.174 ], [ 0.000,
0.943, -0.333 ] ]
[ [ 0.000, 0.492, 0.870 ], [ -0.426, -0.246, 0.870 ], [ 0.000,
0.000, 1.000 ] ]
[ [ -0.426, -0.246, 0.870 ], [ 0.000, 0.492, 0.870 ], [ -0.816,
0.471, 0.333 ] ]
[ [ -0.853, -0.492, 0.174 ], [ -0.426, -0.246, 0.870 ], [ -0.816,
0.471, 0.333 ] ]
[ [ -0.853, 0.000, -0.522 ], [ -0.853, -0.492, 0.174 ], [ -0.816,
0.471, 0.333 ] ]
[ [ -0.426, 0.739, -0.522 ], [ -0.853, 0.000, -0.522 ], [ -0.816,
0.471, 0.333 ] ]
[ [ 0.000, 0.985, 0.174 ], [ -0.426, 0.739, -0.522 ], [ -0.816,
0.471, 0.333 ] ]
[ [ 0.000, 0.492, 0.870 ], [ 0.000, 0.985, 0.174 ], [ -0.816,
0.471, 0.333 ] ]
[ [ -0.853, -0.492, 0.174 ], [ -0.853, 0.000, -0.522 ], [ -0.816,
-0.471, -0.333 ] ]
[ [ 0.000, 0.985, 0.174 ], [ 0.426, 0.739, -0.522 ], [ 0.000,
0.943, -0.333 ] ]
[ [ 0.853, 0.000, -0.522 ], [ 0.853, -0.492, 0.174 ], [ 0.816,
-0.471, -0.333 ] ]
[ [ 0.853, -0.492, 0.174 ], [ 0.853, 0.000, -0.522 ], [ 0.816,
0.471, 0.333 ] ]
[ [ 0.426, -0.246, 0.870 ], [ 0.853, -0.492, 0.174 ], [ 0.816,
0.471, 0.333 ] ]
[ [ 0.000, 0.492, 0.870 ], [ 0.426, -0.246, 0.870 ], [ 0.816,
0.471, 0.333 ] ]
[ [ 0.000, 0.985, 0.174 ], [ 0.000, 0.492, 0.870 ], [ 0.816,
0.471, 0.333 ] ]
[ [ 0.426, 0.739, -0.522 ], [ 0.000, 0.985, 0.174 ], [ 0.816,
0.471, 0.333 ] ]
[ [ 0.853, 0.000, -0.522 ], [ 0.426, 0.739, -0.522 ], [ 0.816,
0.471, 0.333 ] ]
[ [ 0.426, -0.246, 0.870 ], [ 0.000, 0.492, 0.870 ], [ 0.000,
0.000, 1.000 ] ]

Sample output for an icosahedron of frequency 3:
[ [ 0.443, 0.864, 0.239 ], [ 0.682, 0.717, 0.148 ], [ 0.526,
0.851, 0.000 ] ]
[ [ 0.717, 0.148, 0.682 ], [ 0.851, 0.000, 0.526 ], [ 0.864,
0.239, 0.443 ] ]
[ [ 0.688, 0.425, 0.588 ], [ 0.717, 0.148, 0.682 ], [ 0.864,
0.239, 0.443 ] ]
[ [ 0.809, 0.500, 0.309 ], [ 0.688, 0.425, 0.588 ], [ 0.864,
0.239, 0.443 ] ]
[ [ 0.688, 0.425, 0.588 ], [ 0.809, 0.500, 0.309 ], [ 0.588,
0.688, 0.425 ] ]
[ [ 0.425, 0.588, 0.688 ], [ 0.688, 0.425, 0.588 ], [ 0.588,
0.688, 0.425 ] ]
[ [ 0.309, 0.809, 0.500 ], [ 0.425, 0.588, 0.688 ], [ 0.588,
0.688, 0.425 ] ]
[ [ 0.443, 0.864, 0.239 ], [ 0.309, 0.809, 0.500 ], [ 0.588,
0.688, 0.425 ] ]
[ [ 0.682, 0.717, 0.148 ], [ 0.443, 0.864, 0.239 ], [ 0.588,
0.688, 0.425 ] ]
[ [ 0.809, 0.500, 0.309 ], [ 0.682, 0.717, 0.148 ], [ 0.588,
0.688, 0.425 ] ]
[ [ 0.425, 0.588, 0.688 ], [ 0.239, 0.443, 0.864 ], [ 0.500,
0.309, 0.809 ] ]
[ [ 0.688, 0.425, 0.588 ], [ 0.425, 0.588, 0.688 ], [ 0.500,
0.309, 0.809 ] ]
[ [ 0.717, 0.148, 0.682 ], [ 0.688, 0.425, 0.588 ], [ 0.500,
0.309, 0.809 ] ]
[ [ 0.239, 0.443, 0.864 ], [ 0.425, 0.588, 0.688 ], [ 0.148,
0.682, 0.717 ] ]
[ [ 0.000, 0.526, 0.851 ], [ 0.239, 0.443, 0.864 ], [ 0.148,
0.682, 0.717 ] ]
[ [ 0.425, 0.588, 0.688 ], [ 0.309, 0.809, 0.500 ], [ 0.148,
0.682, 0.717 ] ]
[ [ -0.443, 0.864, 0.239 ], [ -0.295, 0.955, 0.000 ], [ -0.526,
0.851, 0.000 ] ]
[ [ 0.443, 0.864, 0.239 ], [ 0.526, 0.851, 0.000 ], [ 0.295,
0.955, 0.000 ] ]
[ [ 0.162, 0.951, 0.263 ], [ 0.443, 0.864, 0.239 ], [ 0.295,
0.955, 0.000 ] ]
[ [ 0.000, 1.000, 0.000 ], [ 0.162, 0.951, 0.263 ], [ 0.295,
0.955, 0.000 ] ]
[ [ 0.162, 0.951, 0.263 ], [ 0.000, 1.000, 0.000 ], [ -0.162,
0.951, 0.263 ] ]
[ [ 0.000, 0.851, 0.526 ], [ 0.162, 0.951, 0.263 ], [ -0.162,
0.951, 0.263 ] ]
[ [ -0.309, 0.809, 0.500 ], [ 0.000, 0.851, 0.526 ], [ -0.162,
0.951, 0.263 ] ]
[ [ -0.443, 0.864, 0.239 ], [ -0.309, 0.809, 0.500 ], [ -0.162,
0.951, 0.263 ] ]
[ [ -0.295, 0.955, 0.000 ], [ -0.443, 0.864, 0.239 ], [ -0.162,
0.951, 0.263 ] ]
[ [ 0.000, 1.000, 0.000 ], [ -0.295, 0.955, 0.000 ], [ -0.162,
0.951, 0.263 ] ]
[ [ 0.000, 0.851, 0.526 ], [ 0.148, 0.682, 0.717 ], [ 0.309,
0.809, 0.500 ] ]
[ [ 0.162, 0.951, 0.263 ], [ 0.000, 0.851, 0.526 ], [ 0.309,
0.809, 0.500 ] ]
[ [ 0.443, 0.864, 0.239 ], [ 0.162, 0.951, 0.263 ], [ 0.309,
0.809, 0.500 ] ]
[ [ 0.148, 0.682, 0.717 ], [ 0.000, 0.851, 0.526 ], [ -0.148,
0.682, 0.717 ] ]
[ [ 0.000, 0.526, 0.851 ], [ 0.148, 0.682, 0.717 ], [ -0.148,
0.682, 0.717 ] ]
[ [ 0.000, 0.851, 0.526 ], [ -0.309, 0.809, 0.500 ], [ -0.148,
0.682, 0.717 ] ]
[ [ -0.717, 0.148, 0.682 ], [ -0.864, 0.239, 0.443 ], [ -0.851,
0.000, 0.526 ] ]
[ [ -0.443, 0.864, 0.239 ], [ -0.526, 0.851, 0.000 ], [ -0.682,
0.717, 0.148 ] ]
[ [ -0.588, 0.688, 0.425 ], [ -0.443, 0.864, 0.239 ], [ -0.682,
0.717, 0.148 ] ]
[ [ -0.809, 0.500, 0.309 ], [ -0.588, 0.688, 0.425 ], [ -0.682,
0.717, 0.148 ] ]
[ [ -0.588, 0.688, 0.425 ], [ -0.809, 0.500, 0.309 ], [ -0.688,
0.425, 0.588 ] ]
[ [ -0.425, 0.588, 0.688 ], [ -0.588, 0.688, 0.425 ], [ -0.688,
0.425, 0.588 ] ]
[ [ -0.500, 0.309, 0.809 ], [ -0.425, 0.588, 0.688 ], [ -0.688,
0.425, 0.588 ] ]
[ [ -0.717, 0.148, 0.682 ], [ -0.500, 0.309, 0.809 ], [ -0.688,
0.425, 0.588 ] ]

...truncated...

--
(-, /\ \/ / /\/



Gavin Kistner

10/11/2004 1:19:00 AM

0

Well...no one seems to have posted a Quiz solution.

I'm sorry that it didn't seem to catch people's fancy. To help figure
out what makes a good quiz:
Was the question too hard, too long, or too boring to tackle and solve?
Or was it perhaps not specified/described well enough?

For the curious, I've posted and described my own solution here:
http://phrogz.net/CSS/Geodesics/Finding...

I've also rolled the new code into my Geodesics library, including
little features (good for testing solutions) like finding the normal
for faces and then deciding if that normal is inward- or
outward-pointing. The core face-subdividing code is at the bottom of
the previous url, the full code is at
http://phrogz.net/RubyLibs/G...

I apologize if people didn't find this quiz enticing enough. Please do
let us know what kept you from tackling/solving it, so better quizzes
can be made in the future.


--
(-, /\ \/ / /\/



Florian Gross

10/11/2004 1:52:00 AM

0

Gavin Kistner wrote:

> Well...no one seems to have posted a Quiz solution.
>
> I'm sorry that it didn't seem to catch people's fancy. To help figure
> out what makes a good quiz:
> Was the question too hard, too long, or too boring to tackle and solve?
> Or was it perhaps not specified/described well enough?

I didn't understand the terminology (Not sure if that is influenced by
me not being a native speaker of English) and problem space that it
involved, personally. A few links to explanations, why this problem is
important and so on could have solved that, I think.

But I can't talk for everybody, of course.

Kind regards,
Florian Gross

Jamis Buck

10/11/2004 1:59:00 AM

0

Gavin Kistner wrote:
> Well...no one seems to have posted a Quiz solution.
>
> I'm sorry that it didn't seem to catch people's fancy. To help figure
> out what makes a good quiz:
> Was the question too hard, too long, or too boring to tackle and solve?
> Or was it perhaps not specified/described well enough?
>
> For the curious, I've posted and described my own solution here:
> http://phrogz.net/CSS/Geodesics/Finding...
>
> I've also rolled the new code into my Geodesics library, including
> little features (good for testing solutions) like finding the normal for
> faces and then deciding if that normal is inward- or outward-pointing.
> The core face-subdividing code is at the bottom of the previous url, the
> full code is at http://phrogz.net/RubyLibs/G...
>
> I apologize if people didn't find this quiz enticing enough. Please do
> let us know what kept you from tackling/solving it, so better quizzes
> can be made in the future.

Well, as for me, the Quiz was fascinating enough. The timing was just
bad. :( I was swamped with other projects this weekend and didn't have a
chance to do more than read the quiz description. :(

- Jamis

--
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck...


Bill Kelly

10/11/2004 2:07:00 AM

0

Hi Gavin,

From: "Gavin Kistner" <gavin@refinery.com>
> Well...no one seems to have posted a Quiz solution.
>
> I'm sorry that it didn't seem to catch people's fancy. To help figure
> out what makes a good quiz:
> Was the question too hard, too long, or too boring to tackle and solve?
> Or was it perhaps not specified/described well enough?

I liked (like?) it! This is the first Quiz that has
interested me personally enough that I have started
working on it. It happens to touch on areas that I'm
rusty on (3D vector math, OpenGL) that I'm just starting
to get back into - so it's great for me. :)

I don't know if I'll have a solution in time, i.e. I
don't know if I'll finish it this week... I'm juggling
a lot of projects... But I'm definitely enjoying the
Quiz ! :)


Thanks!

Regards,

Bill




martinus

10/11/2004 6:42:00 AM

0

Here is my solution:
http://martinus.geekisp.com/files/ge...
unzip and start depthcue.rb for a simple opengl visualization.

geodesic.rb contains the subsampling code,
geodesic-data.rb contains the data as published in the quiz, and
depthcue.rb is a simple opengl visualization (a modified opengl
sample).

This quiz was real fun to solve :-)

martinus

Dennis Ranke

10/11/2004 10:05:00 AM

0

On 10 Oct 2004 23:41:33 -0700, martinus <martin.ankerl@gmail.com> wrote:

> Here is my solution:
> http://martinus.geekisp.com/files/ge...
> unzip and start depthcue.rb for a simple opengl visualization.
>
> geodesic.rb contains the subsampling code,
> geodesic-data.rb contains the data as published in the quiz, and
> depthcue.rb is a simple opengl visualization (a modified opengl
> sample).
>
> This quiz was real fun to solve :-)

A nice and short solution (I wasn't even aware of the Vector class in the
standard lib), you only forgot to normalize the vertices of the resulting
triangles.
Changing the line:

ab.push b*x + a*(1.0-x)

in GeoDesicDome::split to:

v = b*x + a*(1.0-x)
ab.push v * (1 / Math.sqrt(v.inner_product(v)))

produces the correct result.

--
exoticorn/farbrausch