POV-Ray : Newsgroups : povray.binaries.images : Small Stellated Dodecahedron Server Time
5 Nov 2024 20:16:06 EST (-0500)
  Small Stellated Dodecahedron (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: PM 2Ring
Subject: Small Stellated Dodecahedron
Date: 21 May 2006 09:35:00
Message: <web.44706a4ad959e4bc76ba2c900@news.povray.org>
Here's one of the Kepler-Poinsot solids: the small stellated dodecahedron,
on a Penrose tiling floor. The code also contains a slightly simpler & more
accurate dodecahedron than the one in the shapes2.inc.

Enjoy!

// Persistence of Vision Ray Tracer Scene Description File
// File: Dodec.pov
// Vers: 3.5
// Desc: Dodecahedron & small stellated dodecahedron
// Date: 2006.13.05
// Auth: PM 2Ring
//
// -d +A0.2 +AM2 +R4
// -F -A0.4 +AM2 +R1
// +A0.5 +AM2 +R2
// -d +A0.1 +AM2 +R4 +w1200 +h900
// +A0.3 +AM2 +R3
// -d +A0.5 +AM2 +R2 +w1200 +h900
// +A0.2 +AM2 +R2 +w1200 +h900 +FN
//

global_settings {
  assumed_gamma 1
  max_trace_level 50 //  7
}

#include "colors.inc"

#declare Area_Lights = 0;
#declare Do_Floor = 1*8;

#declare Reflect = 1*.75;

#declare WorldRad = 40;

//#declare CamLoc = <0, 15, -6.25> * .95;
//#declare CamLoc = <0, 4, -5> * 1;

#declare CamLoc = <0, 2, -6.25>* 2.0;
//#declare LookAt = 0;

//#declare CamLoc = <2.5, -3, 0.75>;
#declare LookAt = y*1.2;

camera {
  location CamLoc
  look_at LookAt
  right x*image_width/image_height up y
  direction z
  angle 30
}

#if(1)
light_source {
  <-0.75, 5, -3> * 4.5
  //rgb 1
  rgb 100 fade_distance 2.0 fade_power 2        //1.65 2.25

  #if(Area_Lights)
    #declare AL = 9;
    #declare ASize = 0.75;
    area_light x*ASize, z*ASize, AL, AL
    adaptive 1 // 2
    jitter
    circular
    orient
  #end
}
#end

light_source {CamLoc rgb .1 shadowless}

//---Textures--------------------------------------------------------------

//For sky
#declare CMGray0 = color_map {[0.2 rgb 0.1][0.8 rgb .9]}

//For ground
#declare CMGray1 = color_map {[0 rgb .60][1 rgb 1.0]}

//Block finish
#declare FShiny =
finish{
  ambient 0.075
  diffuse .8
  specular .75 roughness 3e-4
  phong .5 phong_size 5

  #if(Reflect)
    //reflection .175*Reflect
    reflection {0.05, 1 fresnel}
  #end
  conserve_energy
}

#declare FGlass =
finish
{
  ambient 0
  diffuse 0.15 //.2

  #if(Reflect)
    reflection {0.05*Reflect, 1*Reflect fresnel}
  #end

  specular .75
  roughness 1E-4
  //brilliance 1.5
  conserve_energy
}

#declare TGlass = texture
{
  pigment { color rgbf <0.985, .9975, .990, 1> }
  //pigment { color rgbf <0.985, .9975, 1, 1> }
  finish{FGlass}
}

#declare FGround =
finish{
  ambient 0.05
  specular .25 roughness 3e-4
  reflection .75*Reflect diffuse .7 //2
}

#declare TGround =
texture{
  //pigment{granite scale 75 colour_map{CMGray1}}
  //pigment{checker rgb 0, rgb 1 rotate 45*y scale 2}
  pigment{rgb 0*.75}
  finish{FGround}
}

//Tile textures
#declare Tex1=
texture{
  pigment{rgb 0}
  finish{FGround}
}

#declare Tex2=
texture{
  pigment{rgb 1}
  finish{FGround}
}

#declare Tex3=
texture{
  pigment{rgb 0.5}
  finish{FGround}
}

#declare TSky =
texture{
  pigment {
    function{abs(y)}
    color_map{CMGray0}
  }
  finish{ambient 0.1 diffuse 0.85}
}

//---Macros-------------------------------------------

#macro FaceColour0(N)#end

#macro FaceColour(N)
  #local Hue = 180 + 240*(mod(7+N,11))/11;
  //#local Hue = 240*mod(N,2);

  pigment{colour CHSV2RGB(<Hue, .75, .95>)filter 0.9}  // transmit 0.65
  //pigment{colour CHSV2RGB(<Hue, .65, .85>)}
  //pigment{rgb x}
  finish{FShiny}
  //finish{FGlass}
#end

#macro Pentamid(A, B, C, D, E, F)
  intersection
  {
    object{Planes[A] inverse}
    object{Planes[B]}
    object{Planes[C]}
    object{Planes[D]}
    object{Planes[E]}
    object{Planes[F]}
  }
#end

// ---Penrose triangle macros-------------------------------------

#declare Phi=(sqrt(5)+1)/2;            //The Golden ratio
#declare phi=Phi-1;

//Interpolate from A to B
#macro inter(A,B,r) (A*(1-r)+B*r) #end

#macro PutSlim(A,B,C,P)
  #if(P)
    #local T1 = Tex1;
    #local T2 = Tex2;
  #else
    #local T1 = Tex2;
    #local T2 = Tex1;
  #end

  #local E = inter(A,B,.5);
  #local F = inter(A,C,phi);
  #local G = inter(B,C,Phi/2);

  triangle{A,E,F texture{T1}}
  triangle{C,F,G texture{Tex3}}
  triangle{B,E,F texture{T2}}
  triangle{B,G,F texture{T2}}
#end

#macro PutWide(A,B,C,P)
  #if(P)
    #local T2 = Tex2;
  #else
    #local T2 = Tex1;
  #end

  #local E = inter(B,A,Phi/2);
  #local F = inter(B,C,phi);

  triangle{B,E,F texture{T2}}
  triangle{A,F,E texture{Tex3}}
  triangle{A,F,C texture{Tex3}}
#end

#macro Slim(A,B,C,D,P)
  #if(D=0)
    PutSlim(A,B,C,P)
  #else
    #local E = inter(A,B,phi);
    #local F = inter(C,A,phi);

    Wide(F,E,A,D-1,P)
    Slim(C,E,F,D-1,P)
    Slim(C,E,B,D-1,P)
  #end
#end

#macro Wide(A,B,C,D,P)
  #if(D=0)
    PutWide(A,B,C,P)
  #else
    #local E = inter(C,B,phi);

    Wide(E,A,B,D-1,1-P)
    Slim(C,A,E,D-1,1-P)
  #end
#end

// ----------------------------------------

#declare Top = 0*-1E-4;     //Tile top height
#declare Ang = pi/5;
#declare Ang0 = radians(-117);
#declare Ang1 = radians(-81);
#declare Rad = WorldRad;
#declare Rdepth = Do_Floor;

#if(Do_Floor)
#declare Wedge=mesh{
  Slim(0, <cos(Ang0), 0, sin(Ang0)>*Rad, <cos(Ang1), 0, sin(Ang1)>*Rad,
Rdepth, 0)
  translate Top*y
}

#declare Floor =
union{
#declare I=0;
#while(I<5)
  object {Wedge rotate y*72*I}
  object {Wedge matrix <0,0,-1, 0,1,0, -1,0,0, 0,0,0> rotate y*72*I}
  #declare I=I+1;
#end
  rotate 9*y
}
#end

//--------------------------The objects-------------------

//Pre-compute dodecahedron planes
#declare Planes = array[12];
#declare Planes[0] = plane { y, 1 FaceColour(0)};
#declare Planes[11] = plane {-y, 1 FaceColour(11)};
#declare I=1;
#while(I<=5)
  #declare Planes[I] =   plane {<0,  1, -2>, 1 rotate y*(36+72*I)
FaceColour(I)};
  #declare Planes[I+5] = plane {<0, -1, -2>, 1 rotate y*72*I
FaceColour(I+5)};
  #declare I=I+1;
#end

#declare Dodecahedron =
intersection
{
  #declare I=0;
  #while(I<12)
    object{Planes[I]}
    #declare I=I+1;
  #end

  bounded_by {sphere {0, 1.258409}}      //(2-Phi)*sqrt(3*Phi+6)
}

#declare SSDodec =
//union
merge
{
  Pentamid(0, 1, 2, 3, 4, 5)
  Pentamid(1, 0, 2, 5, 6, 7)
  Pentamid(2, 0, 1, 3, 7, 8)
  Pentamid(3, 0, 2, 4, 8, 9)
  Pentamid(4, 0, 3, 5, 9, 10)
  Pentamid(5, 0, 1, 4, 6, 10)
  Pentamid(6, 11, 10, 7, 5, 1)
  Pentamid(7, 11, 8, 6, 2, 1)
  Pentamid(8, 11, 9, 7, 3, 2)
  Pentamid(9, 11, 10, 8, 4, 3)
  Pentamid(10, 11, 9, 6, 5, 4)
  Pentamid(11, 10, 9, 8, 7, 6)
  object{Dodecahedron}

  //interior{ior 1.5 dispersion 1.1 dispersion_samples 5}
  interior{ior 1.5}

  bounded_by {sphere {0, sqrt(5)}}
  rotate x*degrees(atan(3-sqrt(5)))

  translate y*1.7761
}

#declare Ground =
  cylinder{
  -y, Top*y, WorldRad
  texture{TGround}
}

#declare Sky =
sphere {0,1 inverse
  texture{TSky}
  scale WorldRad
}

//--------------------------The actual scene-------------------

#if(1)
  object{Sky}
#else
  background{rgb 0.5}
#end

#if(Do_Floor)
  object{Floor}
#else
  object{Ground}
#end

#if(1)
object{
  //Dodecahedron
  SSDodec
  //texture{TGlass}

  //translate y
  rotate y*(180 - 3*18)

  //scale 1.25
  //translate -Phi*z
}
#end

//-------------------------End of file-------------------------


Post a reply to this message


Attachments:
Download 'dodecf0ws.jpg' (114 KB)

Preview of image 'dodecf0ws.jpg'
dodecf0ws.jpg


 

From: Mike the Elder
Subject: Re: Small Stellated Dodecahedron
Date: 21 May 2006 10:30:01
Message: <web.447078752a55f1ca1039d0950@news.povray.org>
Nifty! Thanks.

"PM 2Ring" <nomail@nomail> wrote:
> Here's one of the Kepler-Poinsot solids: the small stellated dodecahedron,
> on a Penrose tiling floor. The code also contains a slightly simpler & more
> accurate dodecahedron than the one in the shapes2.inc.
>
> Enjoy!
>


Post a reply to this message

From: Mr Seb
Subject: Re: Small Stellated Dodecahedron
Date: 21 May 2006 12:24:28
Message: <4470943c$1@news.povray.org>
Nice !
The penrose floor is nice. Interesting code !


news:web.447078752a55f1ca1039d0950@news.povray.org...
> Nifty! Thanks.
>
> "PM 2Ring" <nomail@nomail> wrote:
> > Here's one of the Kepler-Poinsot solids: the small stellated
dodecahedron,
> > on a Penrose tiling floor. The code also contains a slightly simpler &
more
> > accurate dodecahedron than the one in the shapes2.inc.
> >
> > Enjoy!
> >
>
>
>


Post a reply to this message

From: PM 2Ring
Subject: Re: Small Stellated Dodecahedron
Date: 22 May 2006 10:55:00
Message: <web.4471cfdc2a55f1ca1bd1c060@news.povray.org>
"Mr Seb" <ban### [at] wanadoofr> wrote:
> Nice !
> The penrose floor is nice. Interesting code !
>

> news:web.447078752a55f1ca1039d0950@news.povray.org...
> > Nifty! Thanks.
> >
> > "PM 2Ring" <nomail@nomail> wrote:
> > > Here's one of the Kepler-Poinsot solids: the small stellated
> dodecahedron,
> > > on a Penrose tiling floor. The code also contains a slightly simpler &
> more
> > > accurate dodecahedron than the one in the shapes2.inc.
> > >
> > > Enjoy!

Thanks, guys! I had a clear one with dispersion and area lights going all
weekend and half of Monday on my machine at work... I've *got* to do one
with photons, radiosity and maybe even HDRI now. :)


Post a reply to this message


Attachments:
Download 'dodecf8ws.jpg' (149 KB)

Preview of image 'dodecf8ws.jpg'
dodecf8ws.jpg


 

From: Janet
Subject: Re: Small Stellated Dodecahedron
Date: 24 May 2006 00:05:00
Message: <web.4473da892a55f1ca7e8a39890@news.povray.org>
MUST... STEAL... FLOOR... CODE...
This excites me. I have been really interested in Penrose tiling for a while
now. So, the code for the floor really floored me. So, thank you genius!


Post a reply to this message

From: PM 2Ring
Subject: Re: Small Stellated Dodecahedron
Date: 24 May 2006 08:55:00
Message: <web.447454932a55f1ca1bd1c060@news.povray.org>
"Janet" <par### [at] attnet> wrote:
> MUST... STEAL... FLOOR... CODE...

Be my guest, Janet!

> This excites me. I have been really interested in Penrose tiling for a while
> now. So, the code for the floor really floored me. So, thank you genius!

Thanks, though I must also thank John VanSickle for the Penrose code in his
'Boxer' anim (an IRTC entry), which I originally based my code on.

Once you understand the Penrose code in this thread, you may want to take a
look at the code I posted last November, which uses two Penrose tilings
simultaneously: triangles and pentagons. The code is at
<web.4386daf17ed7ae6c2eef1b3b0@news.povray.org> and an image is at
http://news.povray.org/povray.binaries.images/attachment/%3Cweb.4386eb2d7ed7ae6c2eef1b3b0%40news.povray.org%3E/penroset
s.jpg?ttop=228370&toff=400

A top down view of just the floor is attached below.

That code uses a few 'interesting' techniques. If you need help
understanding anything in it, just ask.


Post a reply to this message


Attachments:
Download 'penroses2.jpg' (83 KB)

Preview of image 'penroses2.jpg'
penroses2.jpg


 

From: Janet
Subject: Re: Small Stellated Dodecahedron
Date: 24 May 2006 21:00:01
Message: <web.447500cb2a55f1caf2f4cea50@news.povray.org>
Wow, thanks so much Mr. Ring, actually if I ever understand it, it may be a
miracle, but I'll do my best. The one with the triangles and pentagons
together looks great too.
Janet


Post a reply to this message

From: PM 2Ring
Subject: Re: Small Stellated Dodecahedron
Date: 26 May 2006 07:10:00
Message: <web.4476e1502a55f1ca1bd1c060@news.povray.org>
"Janet" <par### [at] attnet> wrote:
> Wow, thanks so much Mr. Ring,

No worries.

> actually if I ever understand it, it may be a miracle, but I'll do my best.

:) Well, at least you probably already understand the role of the matrix in
reflecting the triangle.

Play with the code. Make all the triangles different colours so you can see
whats going on. Do scenes with low recursion depth to see how the triangles
get subdivided. Draw diagrams on paper. Investigate the geometry of the two
golden isoceles triangles:

http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/phi2DGeomTrig.html#pentagon

There's also material on Penrose tilings on that page.

> The one with the triangles and pentagons together looks great too.

Thanks. That one did require a bid of hard thinking to combine the two, but
I think my solution is elegant.


Post a reply to this message

From: Janet
Subject: Re: Small Stellated Dodecahedron
Date: 27 May 2006 16:25:01
Message: <web.4478b4c42a55f1ca329ba8740@news.povray.org>
"PM 2Ring" <nomail@nomail> wrote:
> Play with the code. Make all the triangles different colours so you can see
> whats going on. Do scenes with low recursion depth to see how the triangles
> get subdivided. Draw diagrams on paper. Investigate the geometry of the two
> golden isoceles triangles:
>
> http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/phi2DGeomTrig.html#pentagon
>
> There's also material on Penrose tilings on that page.
>
> > The one with the triangles and pentagons together looks great too.
>
> Thanks. That one did require a bid of hard thinking to combine the two, but
> I think my solution is elegant.

I did play. Messed with a bunch of the variables. Messed with the angles
too, not so hot when you change them. :) Thanks for the link. I was looking
at a bunch of Penrose stuff and Phi stuff a while back. Played around with
equiangular spirals too, see ==> http://www.deviantart.com/view/29573733/
Well, I still need to play with the "triangles and pentagons" one too.
Thanks again!!!


Post a reply to this message

From: PM 2Ring
Subject: Re: Small Stellated Dodecahedron
Date: 30 May 2006 01:10:01
Message: <web.447bd2ec2a55f1caad93754b0@news.povray.org>
"Janet" <par### [at] attnet> wrote:
> "PM 2Ring" <nomail@nomail> wrote:
> > Play with the code. Make all the triangles different colours so you can see
> > whats going on. Do scenes with low recursion depth to see how the triangles
> >
> > Thanks. That one did require a bid of hard thinking to combine the two, but
> > I think my solution is elegant.

Um, that should say "a bit of hard thinking". :)
>
> I did play. Messed with a bunch of the variables. Messed with the angles
> too, not so hot when you change them. :)

I bet!

> Thanks for the link. I was looking
> at a bunch of Penrose stuff and Phi stuff a while back. Played around with
> equiangular spirals too,

I did an equiangular spiral for my introductory RSOCP post:

//Pickover shell
#macro Shell(N,A,B,C,K)
  #local D=(11/3-A)/N; #local I=1;
  //union{
  merge{
    #while(I<N)
      #local T=I/N; #local R=B*exp(A*K);
      sphere{
        R*<1,0,C/B>,R rotate z*A*360
        pigment{rgb<T, .6, 1-T*T>}
        finish{reflection{0,1} phong .7}
      }
      #local I=I+1; #local A=A+D;
    #end
    rotate x*30 translate <1,5,-2.5>
  }
#end

>see ==> http://www.deviantart.com/view/29573733/

Interesting, but I agree with one of the comments that it's slightly creepy.
Speaking of which, do you know about Alexander's Horned Sphere"? It's been
called the ugliest object in mathematics.

> Well, I still need to play with the "triangles and pentagons" one too.
> Thanks again!!!

No worries!


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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