POV-Ray : Newsgroups : povray.general : jigsaw globe : Re: jigsaw globe Server Time
31 Jul 2024 12:25:40 EDT (-0400)
  Re: jigsaw globe  
From: Grassblade
Date: 23 Mar 2007 17:10:01
Message: <web.46044e8f4ad5fc92f677fcac0@news.povray.org>
"CharlesM" <nomail@nomail> wrote:
> Can anybody suggest how I might create a 3D model similar to that
> demonstrated in the link.  I am a novice user and also intend to animate
> such a model in Moray.
>
> Hopefully this is the correct forum for such a request for help
>
> http://www.istockphoto.com/file_closeup.php?id=2326392
>
> kindest regards

The best I could do:


camera {
 location  <0, 10, -25>
 look_at <0, 0, 0>
 angle 25
 right x*image_width/image_height
}
light_source {<0,50,-10> colour rgb 1.25}

#declare aa=1;  //tangent on the outdent's 'bottleneck'
#declare tile=4; // tile size
#declare thick=0.25;// tile thickness
#declare rad=1.0; // radius circle making the outdent
//centre of circle tangent to the rad circle, to make a smooth outdent:
#declare x0=(1+rad)*aa/sqrt(aa*aa+1);
#declare y0=-x0/aa;
#declare sphererad=2; // sphere radius

#declare flatoutdent=
union{
    cylinder{<0,0,0>,<0,0,-thick>, 1}
    difference{
         box{<-1,-0.75,-thick>, <1,-sqrt(5)-0.5,0>}
         cylinder{<x0,y0,0.0001>, <x0,y0,-thick-0.0001>,rad}
         cylinder{<-x0,y0,0.0001>, <-x0,y0,-thick-0.0001>,rad}
         }
    };

#declare flatpiece=
difference{
 union{
  box{<-(tile)/2,-(tile)/2,-thick>,<(tile)/2,(tile)/2,0>}
  object{flatoutdent scale <0.75,0.45,1> translate (tile/2+sqrt(5)/2-0.1)*y}
      object{flatoutdent rotate z*180 scale <0.75,0.45,1> translate
(tile/2+sqrt(5)/2-0.1)*-y}
  }
    object{flatoutdent scale <0.75,0.45001,1.01> rotate z*90 translate
<tile/4,0,0.0001>}
 object{flatoutdent scale <0.75,0.45001,1.01> rotate z*-90 translate
<-tile/4,0,0.00001>}
     };

#declare spherepiece=
difference{
 intersection{
  object{flatpiece pigment{rgb x} scale <0.25,0.25,20> }
  sphere{ <0,0,0>, sphererad  pigment{rgb x}}
  }
  sphere{<0,0,0>, sphererad-thick  pigment{rgb x}}
  translate z*-sphererad
  };

#declare row=0;
union{
 #while (row<24)
 object{spherepiece rotate y*row*15}
 object{spherepiece rotate z*90 rotate y*15*(row+1) }
 object{spherepiece rotate x*30 rotate y*row*15}
 object{spherepiece rotate x*-30 rotate y*row*15}
 object{spherepiece rotate z*90 rotate x*30 rotate y*15*(row+1) }
 object{spherepiece rotate z*90 rotate x*-30 rotate y*15*(row+1) }
 object{spherepiece rotate x*60 rotate y*row*15}
 object{spherepiece rotate x*-60 rotate y*row*15}
 object{spherepiece rotate z*90 rotate x*60 rotate y*15*(row+1) }
 object{spherepiece rotate z*90 rotate x*-60 rotate y*15*(row+1) }
#declare row=row+2;
 #end
  }
#declare row=0;
union{
 #while (row<24)
 object{spherepiece rotate x*15 rotate y*(row+1)*15}
 object{spherepiece rotate x*-15 rotate y*(row+1)*15}
 object{spherepiece rotate z*90 rotate x*15 rotate y*15*row }
 object{spherepiece rotate z*90 rotate x*-15 rotate y*15*row }
 object{spherepiece rotate x*45 rotate y*(row+1)*15}
 object{spherepiece rotate x*-45 rotate y*(row+1)*15}
 object{spherepiece rotate z*90 rotate x*45 rotate y*15*row }
 object{spherepiece rotate z*90 rotate x*-45 rotate y*15*row }
 #declare row=row+2;
 #end
}


I'm too lazy to fuse the two #while procedures. I could have sworn the
pieces should have tiled seamlessly, but the effect isn't bad, so I
refrained from redoing the math. I could also have sworn that a sphere
could be mapped by squares on its surface, but evidently it can't. You'll
have to make special pieces for the rows closer to the poles.

I think I'm going to use this for my RSOCP. :-p


Post a reply to this message

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