POV-Ray : Newsgroups : povray.binaries.scene-files : Platonic solids Server Time
2 Sep 2024 12:17:06 EDT (-0400)
  Platonic solids (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Deaken
Subject: Platonic solids
Date: 14 Jan 2002 00:50:25
Message: <3C42719F.9BD9A7FF@sw-tech.com>
As mentioned in p.b.i...


Post a reply to this message


Attachments:
Download 'us-ascii' (13 KB) Download 'soliddemo.pov.txt' (4 KB)

From: Deaken
Subject: Re: Platonic solids
Date: 14 Jan 2002 00:52:31
Message: <3C42721D.934CED4D@sw-tech.com>
Deaken wrote:
> 
> As mentioned in p.b.i...
> 

Nice.  It inlines some plain text attachments but not others.  Sorry.  I
will keep kicking Netscape.

Deaken


Post a reply to this message

From: Thies Heidecke
Subject: Re: Platonic solids
Date: 14 Jan 2002 01:59:20
Message: <3c4281c8@news.povray.org>
Hi Deaken,

first of all, good work so far.

>// Bugs: The math is slightly off on both the Dodecahedron and the
>//       Icosahedron.  I am still tracking this down, I'm afraid.

As i read this i thought my source could be helpful to you, feel free
to use it in your include-file if you like it.

Some explanations:
r is the radius of the outer bounding sphere of the icosahedron
h,a,b,c,d are some precalculated constants.

P1 - P12 are the vertexes of the Icosahedron
P1 is the top vertex
P2-P6 is the upper pentagon-shaped layer
P7 is the bottom vertex
P8-P12 is the lower pentagon-shaped layer

I hope you find it useful.

Greetings
    Thies Heidecke


// Icosahedron - Vertex - Definitions :
#declare r     = 1.0;
#declare sqrt5 = sqrt(5.0);
#declare h     = 1.0/sqrt5;
#declare a     = 2.0*sqrt((5.0+sqrt5)/40.0);
#declare b     = 2.0*sqrt((5.0-sqrt5)/40.0);
#declare c     = (5.0-sqrt5)/10.0;
#declare d     = (5.0+sqrt5)/10.0;


#declare P0    = < 0.0,  0.0,      0.0>;
#declare P1    = < 0.0,    r,      0.0>;
#declare P2    = < 0.0,  h*r,  2.0*h*r>;
#declare P3    = < a*r,  h*r,      c*r>;
#declare P4    = < b*r,  h*r,     -d*r>;
#declare P5    = <-b*r,  h*r,     -d*r>;
#declare P6    = <-a*r,  h*r,      c*r>;
#declare P7    = < 0.0,   -r,      0.0>;
#declare P8    = < b*r, -h*r,      d*r>;
#declare P9    = < a*r, -h*r,     -c*r>;
#declare P10   = < 0.0, -h*r, -2.0*h*r>;
#declare P11   = <-a*r, -h*r,     -c*r>;
#declare P12   = <-b*r, -h*r,      d*r>;


Post a reply to this message

From: Deaken
Subject: Re: Platonic solids
Date: 14 Jan 2002 02:43:20
Message: <3C428C12.41C7D55D@sw-tech.com>
Thies Heidecke wrote:
> 
> Hi Deaken,

Hello.

> first of all, good work so far.

Thanks.

> >// Bugs: The math is slightly off on both the Dodecahedron and the
> >//       Icosahedron.  I am still tracking this down, I'm afraid.
> 
> As i read this i thought my source could be helpful to you, feel free
> to use it in your include-file if you like it.
> 
> Some explanations:
> r is the radius of the outer bounding sphere of the icosahedron

I use 1 for this, like your default.  "Bounded by the unit sphere", as
they say.

> h,a,b,c,d are some precalculated constants.

Hm.  You seem to have a much better grasp on the geometry involved than
I do.  I was foolish, and trusted reference pages which I found on the
web.  :)

> I hope you find it useful.

Indeed.  Many thanks.

> // Icosahedron - Vertex - Definitions :
> #declare r     = 1.0;
> #declare sqrt5 = sqrt(5.0);
> #declare h     = 1.0/sqrt5;
> #declare a     = 2.0*sqrt((5.0+sqrt5)/40.0);
> #declare b     = 2.0*sqrt((5.0-sqrt5)/40.0);
> #declare c     = (5.0-sqrt5)/10.0;
> #declare d     = (5.0+sqrt5)/10.0;

Interesting.  I must study this.  Thanks again.

Deaken


Post a reply to this message

From: Herman Serras
Subject: Re: Platonic solids
Date: 14 Jan 2002 08:42:12
Message: <3C42E03E.26BF4F96@pandora.be>
Hello,
This is very well done. I appreciate that you are putting the sources
available.
The macros to define a square and a pentagon as a mesh of triangles are
a very good idea!
I also have some include files concerning polyhedra and using "polygon"
often gives problems concerning the planarity. I think it's better to
use triangles.
I see you're inscribing the platonic solids in a sphere. That's the most
symetrical way to do it but startin from a cube is mathematically more
easy.
You can find some examples on my website.
Friendly greetings.

Deaken wrote:
> 
> As mentioned in p.b.i...
> 
>   ------------------------------------------------------------------------
> // Persistence of Vision Ray Tracer Include File
> // File: platonic.inc
> // Vers: 0.9
> // Desc: This file provides untextured versions of the five Platonic solids,

... skipped

-- 
Herman Serras
Gent (Belgium)
http://cage.rug.ac.be/~hs/


Post a reply to this message

From: Deaken
Subject: Re: Platonic solids
Date: 14 Jan 2002 09:53:42
Message: <3C42F0E3.7FAF75DE@sw-tech.com>
Herman Serras wrote:
> 
> Hello,

Hi there.

> This is very well done. 

Thank you.

> I appreciate that you are putting the sources
> available.

Well, there is no other choice, as far as I'm concerned.  I learn from
the group, so I give back to the group, in my inexperienced (and
currently mostly useless) manner.  I hope to change that over time and
actually present something useful.

> The macros to define a square and a pentagon as a mesh of triangles are
> a very good idea!

It struck me as the easiest and most uniform way to do it.  It could
have been easier if I had used box{} for the cube, but then it would not
have been constructed similar to the other polyhedra.

> I also have some include files concerning polyhedra and using "polygon"
> often gives problems concerning the planarity. I think it's better to
> use triangles.
> I see you're inscribing the platonic solids in a sphere. That's the most
> symetrical way to do it but startin from a cube is mathematically more
> easy.
> You can find some examples on my website.

Wow.

"Easy", you say?  You are far beyond me in math, I'm afraid.

I did, however, find a link to already-provided polyhedral include files
(on mac.povray.org) from your site.  I KNEW I was reinventing the
wheel.  :/

Interesting that Mr. Towle seems (I have not been able to examine the
include files yet; I still need something to unpack .SIT and .HQX files)
to have provided the "pipes-and-balls" structures, too.  There is
nothing new under the sun.

It also occurs to me that I should have used a unit cube.  I would not
have found the bug in the icosa- and dodecahedra.  Heh.

> Friendly greetings.

Back at you.  :)

Deaken


Post a reply to this message

From: Herman Serras
Subject: Re: Platonic solids
Date: 14 Jan 2002 10:54:23
Message: <3C42FF39.DEA4AEB5@pandora.be>
Hello,


> It struck me as the easiest and most uniform way to do it.  It could
> have been easier if I had used box{} for the cube, but then it would not
> have been constructed similar to the other polyhedra.

I think it's a good idea to try to obtain a uniform way to describe the
platonic solids. So I don't mean you should use "box" for the cube. But
the nice thing I learned from your include file is to avoid "polygon" by
using your macros. As I wrote, there can be difficulties if the 3D
polygon is not a planar one, and this can be a matter of rounding off.
The only polygon we're sure that it is a planar one is the triangle!


> 
> I did, however, find a link to already-provided polyhedral include files
> (on mac.povray.org) from your site.  I KNEW I was reinventing the
> wheel.  :/
> 
> Interesting that Mr. Towle seems (I have not been able to examine the
> include files yet; I still need something to unpack .SIT and .HQX files)
> to have provided the "pipes-and-balls" structures, too.  There is
> nothing new under the sun.

The .hqx files can be expanded using "stuffit". You can find this
program on the web.
I also examined some of the files from Mr. Towle. But being a
mathematician I want to construct the polyhedra (or obtain their data)
myself. I think Mr. Towle obtained his data using an other programme:
all his data are written in decimal form (not using square roots
etc...).

> 
> It also occurs to me that I should have used a unit cube.  I would not
> have found the bug in the icosa- and dodecahedra.  Heh.

One of the advantages starting from the cube and deriving the other four
platonic polyhedra form it is that one doesn't need to use spherical
geometry (or spherical trigonometry). I think most young people don't
study those things at school and the whole thing can be done starting
from the cube and using some analytical geometry. And... you see very
well the nice relations using the golden section that exist ex. in the
dodecahedron!
> 
> > Friendly greetings.
> 
> Back at you.  :)
> 
> Deaken

Greetings from Ghent!

Herman Serras

-- 
Herman Serras
Gent (Belgium)
http://cage.rug.ac.be/~hs/


Post a reply to this message

From: Deaken
Subject: Re: Platonic solids
Date: 14 Jan 2002 17:35:16
Message: <3C435D07.A990D0EA@sw-tech.com>
Herman Serras wrote:
> 
> Hello,
> 
> > It struck me as the easiest and most uniform way to do it.  It could
> > have been easier if I had used box{} for the cube, but then it would not
> > have been constructed similar to the other polyhedra.
> 
> I think it's a good idea to try to obtain a uniform way to describe the
> platonic solids. So I don't mean you should use "box" for the cube. 

Sorry.  I was unclear.  I was just explaining my methods and reasoning. 
I didn't mean to say that I thought you had suggested it.

> But
> the nice thing I learned from your include file is to avoid "polygon" by
> using your macros. 

I am an almost-decent Forth programmer.  I find the overlap between
factoring code in Forth nicely similar to building POV scenes out of
primitives.  I try to use Forth's "simplify as much as possible, and
remove everything that can be removed" strategy as often as I can.

> As I wrote, there can be difficulties if the 3D
> polygon is not a planar one, and this can be a matter of rounding off.
> The only polygon we're sure that it is a planar one is the triangle!

This is why I did something relatively simple, instead of, say, all the
rest of the polyhedra.  :)

> > Interesting that Mr. Towle seems (I have not been able to examine the
> > include files yet; I still need something to unpack .SIT and .HQX files)
> > to have provided the "pipes-and-balls" structures, too.  There is
> > nothing new under the sun.
> 
> The .hqx files can be expanded using "stuffit". You can find this
> program on the web.

Yes, I used to be a Mac person.  I recognize the file type.  I once had
a toolkit for such files that worked on unix, but I am having a hard
time finding it again.

> I also examined some of the files from Mr. Towle. But being a
> mathematician I want to construct the polyhedra (or obtain their data)
> myself.  I think Mr. Towle obtained his data using an other programme:
> all his data are written in decimal form (not using square roots
> etc...).

I am not a mathematician, just someone who wants to better his SDL
skills.

[I've actually got a problem relating to that, but I'm not sure if
povray.programming is the right place, or if it should go in
povray.newusers.  It involves translating something from C to a macro. 
It's rather nasty.]

> > It also occurs to me that I should have used a unit cube.  I would not
> > have found the bug in the icosa- and dodecahedra.  Heh.
> 
> One of the advantages starting from the cube and deriving the other four
> platonic polyhedra form it is that one doesn't need to use spherical
> geometry (or spherical trigonometry). 

To be honest, I took a look at your site last night and I haven't the
faintest idea how I would, for example, construct a dodecahedron out of
a cube in POV-Ray, the way you describe it on your page.

> I think most young people don't
> study those things at school and the whole thing can be done starting
> from the cube and using some analytical geometry. 

Or, in my case, have studied it far too long ago to remember any of it. 
:/

Deaken


Post a reply to this message

From: Christopher James Huff
Subject: Re: Platonic solids
Date: 15 Jan 2002 19:51:01
Message: <chrishuff-28BB44.19520015012002@netplex.aussie.org>
In article <3C435D07.A990D0EA@sw-tech.com>, Deaken <dwy### [at] sw-techcom> 
wrote:

> I am an almost-decent Forth programmer.  I find the overlap between
> factoring code in Forth nicely similar to building POV scenes out of
> primitives.  I try to use Forth's "simplify as much as possible, and
> remove everything that can be removed" strategy as often as I can.

I've never seen any Forth code...what's it like?


> > The .hqx files can be expanded using "stuffit". You can find this
> > program on the web.
> 
> Yes, I used to be a Mac person.  I recognize the file type.  I once had
> a toolkit for such files that worked on unix, but I am having a hard
> time finding it again.

StuffIt does work on Unix, it runs on Mac OS X. ;-)
Ok, I'm assuming that's not quite what you had in mind...though if you 
want, I could make a .tgz of the files for you, just send them to me.
BTW, what are you using now? Your X-Mailer header says Win95, which I 
assume is incorrect...


> [I've actually got a problem relating to that, but I'm not sure if
> povray.programming is the right place, or if it should go in
> povray.newusers.  It involves translating something from C to a macro. 
> It's rather nasty.]

Sounds like an interesting problem, povray.advanced-users might be a 
better place...
povray.programming is more for discussion of the program source code 
than the scene language.

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

From: Patrick Elliott
Subject: Re: Platonic solids
Date: 16 Jan 2002 18:13:51
Message: <1103_1011222959@selliot>
On Tue, 15 Jan 2002 19:52:01 -0500, Christopher James Huff <chr### [at] maccom> wrote:
> In article <3C435D07.A990D0EA@sw-tech.com>, Deaken <dwy### [at] sw-techcom> 
> wrote:
> 
> > I am an almost-decent Forth programmer.  I find the overlap between
> > factoring code in Forth nicely similar to building POV scenes out of
> > primitives.  I try to use Forth's "simplify as much as possible, and
> > remove everything that can be removed" strategy as often as I can.
> 
> I've never seen any Forth code...what's it like?
> 


Except for some minor syntax differences, like using FORMAT to print formated
output, instead of PRINT USING, .OR. instead of simple OR and similar things
the code in Forth appears to be very similar to that of QBASIC, which also allows
you to use line numbers only when you need them.

It probably is a lot better at doing math though, since the last time I tried to port
the code from one into a version of basic, the results where off by quite a bit. I
may have forgot to convert to radians or something though, so I can't be sure
and I am stopped fiddling with that code a while back. ;)

Some examples are at http://www.ngs.noaa.gov/PC_PROD/pc_prod.shtml


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.