POV-Ray : Newsgroups : povray.general : platonic solids as solids Server Time
31 Oct 2024 08:17:43 EDT (-0400)
  platonic solids as solids (Message 1 to 6 of 6)  
From: Paul Bourke
Subject: platonic solids as solids
Date: 10 Dec 2005 23:04:51
Message: <pdbNOSPAM-404A20.15044911122005@news.povray.org>
I've created the first three platonic solids as "solid" objects
in POVRay so I do CSG operations on them. Before I give myself a
headache doing the icosahedron and dodecahedron I though I would
ask if someome has already done it.....and would care to share them.

// Tetrahedron
#declare THETA = degrees(atan(2/sqrt(2)));
#declare TET1 = intersection {
   plane { <0,0,1>, 0 rotate <0, THETA,0> translate < 1,0,0> }
   plane { <0,0,1>, 0 rotate <0,-THETA,0> translate <-1,0,0> }
   plane { <0,0,1>, 0 rotate <0, THETA,0> rotate <0,0,90> translate <0, 1,0> scale
<1,1,-1> }
   plane { <0,0,1>, 0 rotate <0,-THETA,0> rotate <0,0,90> translate <0,-1,0> scale
<1,1,-1> }
   scale DIST/2
}

// Octahedron, made of an upper and lower half
#declare THETA = degrees(atan(sqrt(2)));
#declare DIST = 1 / (2 * sqrt(2));
#declare OCT0 = intersection {
   plane { <0,0,1>, 0 rotate <0, THETA,0> translate < DIST,0,0> }
   plane { <0,0,1>, 0 rotate <0,-THETA,0> translate <-DIST,0,0> }
   plane { <0,0,1>, 0 rotate < THETA,0,0> translate <0,-DIST,0> }
   plane { <0,0,1>, 0 rotate <-THETA,0,0> translate <0, DIST,0> }
   plane { <0,0,-1>, 0 }
}
#declare OCT1 = union {
   object { OCT0 }
   object { OCT0 scale <1,1,-1> translate <0,0,0.001> }
   scale 0.5/DIST
}

We already have "box" for the hexahedron.

-- 
Paul Bourke
pdb(NOSPAM)swin.edu.au


Post a reply to this message

From: Paul Bourke
Subject: Re: platonic solids as solids
Date: 10 Dec 2005 23:39:24
Message: <pdbNOSPAM-E3AD8D.15392311122005@news.povray.org>
> I've created the first three platonic solids as "solid" objects
> in POVRay so I do CSG operations on them. Before I give myself a
> headache doing the icosahedron and dodecahedron I though I would
> ask if someome has already done it.....and would care to share them.

Woops, they seem to be defined in "shapes2.inc"

-- 
Paul Bourke
pdb(NOSPAM)swin.edu.au


Post a reply to this message

From: John VanSickle
Subject: Re: platonic solids as solids
Date: 10 Dec 2005 23:56:12
Message: <439bb16c$1@news.povray.org>
Paul Bourke wrote:
> I've created the first three platonic solids as "solid" objects
> in POVRay so I do CSG operations on them. Before I give myself a
> headache doing the icosahedron and dodecahedron I though I would
> ask if someome has already done it.....and would care to share them.

// why not

intersection {
#local sX=-1;#while(sX<2)
#local sY=-1;#while(sY<2)
#local sZ=-1;#while(sZ<2)
   plane { <sX,sY,sZ>,sqrt(1/3) }
   bounded_by { box { -1,1 } }
}

for the octohedron?

For the other two:

#local sA=sqrt(.3125)+.25;
#local sB=.5;

#declare Dodecahedron= intersection {
   plane { < sA, sB,0>,.5 }
   plane { <0, sA, sB>,.5 }
   plane { < sB,0, sA>,.5 }
   plane { <-sA, sB,0>,.5 }
   plane { <0,-sA, sB>,.5 }
   plane { < sB,0,-sA>,.5 }
   plane { < sA,-sB,0>,.5 }
   plane { <0, sA,-sB>,.5 }
   plane { <-sB,0, sA>,.5 }
   plane { <-sA,-sB,0>,.5 }
   plane { <0,-sA,-sB>,.5 }
   plane { <-sB,0,-sA>,.5 }
}

#declare Icosahedron = intersection {
   plane { < sA+sB, sB,0>,.5 }
   plane { <0, sA+sB, sB>,.5 }
   plane { < sB,0, sA+sB>,.5 }
   plane { <-sA-sB, sB,0>,.5 }
   plane { <0,-sA-sB, sB>,.5 }
   plane { < sB,0,-sA-sB>,.5 }
   plane { < sA+sB,-sB,0>,.5 }
   plane { <0, sA+sB,-sB>,.5 }
   plane { <-sB,0, sA+sB>,.5 }
   plane { <-sA-sB,-sB,0>,.5 }
   plane { <0,-sA-sB,-sB>,.5 }
   plane { <-sB,0,-sA-sB>,.5 }

   plane { <-sA,-sA,-sA>,.5 }
   plane { < sA,-sA,-sA>,.5 }
   plane { <-sA, sA,-sA>,.5 }
   plane { < sA, sA,-sA>,.5 }
   plane { <-sA,-sA, sA>,.5 }
   plane { < sA,-sA, sA>,.5 }
   plane { <-sA, sA, sA>,.5 }
   plane { < sA, sA, sA>,.5 }
}

Hope this helps,
John


Post a reply to this message

From: Mike Williams
Subject: Re: platonic solids as solids
Date: 11 Dec 2005 01:09:27
Message: <LLLRtPALJ8mDFwng@econym.demon.co.uk>
Wasn't it Paul Bourke who wrote:
>> I've created the first three platonic solids as "solid" objects
>> in POVRay so I do CSG operations on them. Before I give myself a
>> headache doing the icosahedron and dodecahedron I though I would
>> ask if someome has already done it.....and would care to share them.
>
>Woops, they seem to be defined in "shapes2.inc"

The "bounded_by" that's in "shapes2.inc" is a good idea. Without it,
objects that are created from the intersections of infinite planes are
themselves considered to be infinite.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Paul Bourke
Subject: Re: platonic solids as solids
Date: 15 Dec 2005 00:05:01
Message: <web.43a0f942852787c34ef218200@news.povray.org>
If you want to see what prompted this original email, it was to create the
inverse of various platonic solid fractals. For picures see
    http://astronomy.swin.edu.au/~pbourke/fractals/platonic/


Post a reply to this message

From: kurtz le pirate
Subject: Re: platonic solids as solids
Date: 15 Dec 2005 02:39:42
Message: <43a11dbe$1@news.povray.org>

web.43a0f942852787c34ef218200@news.povray.org...
> If you want to see what prompted this original email, it was to 
> create the
> inverse of various platonic solid fractals. For picures see
>    http://astronomy.swin.edu.au/~pbourke/fractals/platonic/
>

on this french site http://louisbel.free.fr, go to "scenes" then 

you can see in a slide slow, 80 of them.

klp


Post a reply to this message

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