POV-Ray : Newsgroups : povray.binaries.images : Pavement conundrum : Re: Pavement conundrum Server Time
1 Aug 2024 16:24:59 EDT (-0400)
  Re: Pavement conundrum  
From: andrel
Date: 9 Sep 2008 15:58:20
Message: <48C6D5A2.8030704@hotmail.com>
On 09-Sep-08 21:44, Tek wrote:
> I had a bit of a play with a function to create this pattern. Obviously I'm 
> cheating and not using rectangular blocks. Here's the code:
> 
>  #declare Wrap = function(a) { (a/2-floor(a/2))*2-1 }
>  #declare Feeder = function(x,y) { Wrap( (y - 
> sqrt(1-pow(Wrap(x*sqrt(2))/sqrt(2),2)))*8 ) }
>  #declare Tiles =
>   pigment { function {
>    min(
>    1-abs(Feeder(x,y))
>    ,
>    abs(Wrap(8.8*(-Feeder(x,y)*.1+.9)*Wrap(x*sqrt(2))))
>    )
>   } }
> 
> 

If this were a short code contest, I would say that
pow(Wrap(x*sqrt(2))/sqrt(2),2)) is equivalent to
pow(Wrap(x*sqrt(2)),2)/2)

other than that, I am baffled.


Post a reply to this message

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