POV-Ray : Newsgroups : povray.binaries.images : Strata (Tiling) [25 + 32 Kbu, jpg] : Re: Strata (Tiling) [25 + 32 Kbu, jpg] Server Time
18 Aug 2024 08:23:49 EDT (-0400)
  Re: Strata (Tiling) [25 + 32 Kbu, jpg]  
From: Ron Parker
Date: 14 May 2001 14:32:42
Message: <slrn9g096f.okg.ron.parker@fwi.com>
On Mon, 14 May 2001 19:58:36 +0200, Wlodzimierz ABX Skiba wrote:

>> This two pictures are the last of the patterns in my tiling patch.
>> Yep... It's a code patch, not a script.
>> In the meantime, maybe someone will find a macro/script to provide the
>> same kind of paving, but I doubt it...
>
>are you talking about universal macro generating pigment form count of
>segment/vertex/figures or script for selected patterns ?
>here is my result for your first pigment
>script is not optimized, I want to show way of finding
>of course MegaPOV required

Why "of course"?  Here are a few that work in plain ol' POV.  I started 
to do 6.4.3 but never finished it.

#macro _6_6_6()
  #local G=pigment {gradient x color_map {[0 rgb 1][1 rgb 0]} scale 1.000001}
  #local B=pigment{
    radial 
    pigment_map{
      #local i=0;
      #while(i<6)
        [i/6 G rotate(30+60*i)*y]
        [(i+1)/6 G rotate(30+60*i)*y]
        #local i=i+1;
      #end
    }
  }
  #local T2=sqrt(3)/2;
  radial 
  pigment_map{
    [1/3 B translate<.5,0,-T2>]
    [1/3 B translate<-1,0,0>]
    [2/3 B translate<-1,0,0>]
    [2/3 B translate<.5,0,T2>]
  }
  translate x 
  warp{repeat 1.5*x flip x}
  warp{repeat .5*sqrt(3)*z flip z}
#end

#macro _8_8_4()
  #local G=pigment {gradient x color_map {[0 rgb 1][1 rgb 0]} scale .5000001}
  #local H=pigment {
    gradient x
    pigment_map {
      [.5 G][.5 G translate -.5*x scale <1-sqrt(2),1,1> translate .5*x]
    }
  }
        
  radial 
  pigment_map{
    #local i=0;  
    #local j=8;
    #while(i<j)
      [i/j H rotate(180/j+360/j*i)*y]
      [(i+1)/j H rotate(180/j+360/j*i)*y]
      #local i=i+1;
    #end
  }

  rotate 180/j*y

  warp{repeat .5*x flip x}
  warp{repeat .5*z flip z}
#end

#macro _12_4_6( )
  #local G=pigment {gradient x color_map {[0 rgb 1][1 rgb 0]} scale .5000001}

  #local T15=tan(pi/12);

  #local Hx=pigment {
    radial 
    pigment_map{
      #local i=0;
      #while(i<6)
        [i/6 G scale <T15*sqrt(3),1,1> rotate(30+60*i)*y]
        [(i+1)/6 G scale <T15*sqrt(3),1,1> rotate(30+60*i)*y]
        #local i=i+1;
      #end
    }
    rotate 30*y
  }

  #local H=pigment{
    gradient x
    pigment_map {[.5 G][.5 Hx translate (.5+T15*sqrt(3)/2)*x]}
  }                                                               

  #local J=pigment{
    gradient x
    pigment_map {[T15/2 G scale <T15,1,1>]
                 [T15/2 Hx translate (T15*(1+sqrt(3)))/2*x]}
  }

  #local Sq=pigment {
    radial 
    pigment_map{
      #local i=0;
      #while(i<4)
        [i/4 J rotate(45+90*i)*y]
        [(i+1)/4 J rotate(45+90*i)*y]
        #local i=i+1;
      #end
    }
    rotate 45*y
  }
  #local I=pigment{
    gradient x
    pigment_map {[.5 G][.5 Sq translate (.5+.5*T15)*x]}
  }

  #local B=pigment{
    radial 
    pigment_map{
      #local i=0;
      #while(i<12)
        [i/12 #if (i/2 = int(i/2)) I #else H #end rotate(15+30*i)*y]
        [(i+1)/12 #if (i/2 = int(i/2)) I #else H #end rotate(15+30*i)*y]
        #local i=i+1;
      #end
    }  
    rotate 15*y
  }
          
  #local T2=sqrt(3)/2;
  radial 
  pigment_map{
    [1/3 B translate<.5,0,-T2>*(.5+T15*sqrt(3)/2)]
    [1/3 B translate<-1,0,0>*(.5+T15*sqrt(3)/2)]
    [2/3 B translate<-1,0,0>*(.5+T15*sqrt(3)/2)]
    [2/3 B translate<.5,0,T2>*(.5+T15*sqrt(3)/2)]
  }                                   
  translate (.5+T15*sqrt(3)/2)*x
  warp{repeat 1.5*x*(.5+T15*sqrt(3)/2) flip x}
  warp{repeat .5*sqrt(3)*z*(.5+T15*sqrt(3)/2) flip z}
#end

#macro _12_12_3( )
  #local G=pigment {gradient x color_map {[0 rgb 1][1 rgb 0]} scale 1.00001}
  #local P=tan(15*pi/180)/sqrt(3);
  #local H=pigment {gradient x
    pigment_map {[.5/(1+P) G scale <.5/(1+P),1,1>]
                 [.5/(1+P) G scale <.5/(1+P),1,1> translate -.5/(1+P)*x 
                  scale <-P,1,1> translate .5/(1+P)*x]} 
    scale <2,1,1>
  }
  #local B=pigment{
    radial 
    pigment_map{
      #local i=0;
      #local j=12;
      #while(i<j)
        [i/j H rotate(180/j+360/j*i)*y]
        [(i+1)/j H rotate(180/j+360/j*i)*y]
        #local i=i+1;
      #end
    }
    rotate 180/j*y
  }     
  #local T2=sqrt(3)/2;
  radial 
  pigment_map{
    [1/3 B translate<.5,0,-T2>]
    [1/3 B translate<-1,0,0>]
    [2/3 B translate<-1,0,0>]
    [2/3 B translate<.5,0,T2>]
  }
  translate x 
  warp{repeat 1.5*x flip x}
  warp{repeat .5*sqrt(3)*z flip z}
#end

//plane {y 0 pigment {_6_6_6()} finish {ambient 1}}
//plane {y 0 pigment {_8_8_4()} finish {ambient 1}}
//plane {y 0 pigment {_12_12_3()} finish {ambient 1}}
plane {y 0 pigment {_12_4_6()} finish {ambient 1}}
camera {location 3*y sky z look_at 0}

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbf 1}hollow interior{media{emission 3-T}}}#end 
Z(-x-x.2x)camera{location z*-10rotate x*90normal{bumps.02scale.05}}


Post a reply to this message

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