POV-Ray : Newsgroups : povray.binaries.images : Pavement conundrum Server Time
1 Aug 2024 14:27:31 EDT (-0400)
  Pavement conundrum (Message 11 to 17 of 17)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: andrel
Subject: Re: Pavement conundrum
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

From: Thomas de Groot
Subject: Re: Pavement conundrum
Date: 10 Sep 2008 04:34:55
Message: <48c786af$1@news.povray.org>
While I prefer ChrisB's solution as being closer to the original idea (and 
purpose), your variation is very nice indeed introduces an interesting 
modulation of the pattern from rectangular to diamond-shaped. I love it!

Thomas

"Tek" <tek### [at] evilsuperbraincom> schreef in bericht 
news:48c6d20f@news.povray.org...
>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))))
>   )
>  } }
>
>
> -- 
> Tek
> http://evilsuperbrain.com
>


Post a reply to this message

From: Thomas de Groot
Subject: Re: Pavement conundrum
Date: 10 Sep 2008 04:42:46
Message: <48c78886$1@news.povray.org>
"Jim Charter" <jrc### [at] msncom> schreef in bericht 
news:48c49700$1@news.povray.org...
>>
> This is pretty close to what I did with the circular mosaic patterns on 
> the table tops I posted recently.
> The code is real messy, it probably would be more work for you to try and 
> read it than to write your own but I will try to annotate it if you are 
> interested.
> Basically what I contrived, was a set of concentric bands or rings of a 
> preset width. Since the tiles were considered squares the width of the 
> band determined the number of tiles along the inner circumference.  But 
> each sucessive band, as you expand from the center, does not add enough 
> circumference to accommodate a whole new tile along it each time.  So what 
> I did was average the growing discrepency across the gaps of all the 
> tiles, rather than leave a gap or try to make a partial tile at the end. 
> Then when the circumference had expanded enough, I added a new tile.  Also 
> I randomized the 'starting' point for each ring of tiles.

Thank you Jim! I shall have to read this very carefully. Unfortunately, my 
math is a bit below average which is why I could not find a way out of this 
conundrum. However, there are great minds here (yours, and Chris' and Tek's) 
who readily find a solution. I am truly deeply impressed.

Thomas


Post a reply to this message

From: Jim Charter
Subject: Re: Pavement conundrum
Date: 10 Sep 2008 07:47:18
Message: <48c7b3c6$1@news.povray.org>
Thomas de Groot wrote:
> "Jim Charter" <jrc### [at] msncom> schreef in bericht 
> news:48c49700$1@news.povray.org...
> 
>>This is pretty close to what I did with the circular mosaic patterns on 
>>the table tops I posted recently.
>>The code is real messy, it probably would be more work for you to try and 
>>read it than to write your own but I will try to annotate it if you are 
>>interested.
>>Basically what I contrived, was a set of concentric bands or rings of a 
>>preset width. Since the tiles were considered squares the width of the 
>>band determined the number of tiles along the inner circumference.  But 
>>each sucessive band, as you expand from the center, does not add enough 
>>circumference to accommodate a whole new tile along it each time.  So what 
>>I did was average the growing discrepency across the gaps of all the 
>>tiles, rather than leave a gap or try to make a partial tile at the end. 
>>Then when the circumference had expanded enough, I added a new tile.  Also 
>>I randomized the 'starting' point for each ring of tiles.
> 
> 
> Thank you Jim! I shall have to read this very carefully. Unfortunately, my 
> math is a bit below average which is why I could not find a way out of this 
> conundrum. However, there are great minds here (yours, and Chris' and Tek's) 
> who readily find a solution. I am truly deeply impressed.
> 
> Thomas
> 
> 
Well Chris's solution is more comprehensive so I will leave it at that!


Post a reply to this message

From: Jim Charter
Subject: Re: Pavement conundrum
Date: 10 Sep 2008 08:40:26
Message: <48c7c03a$1@news.povray.org>
#include "shapes.inc"
#declare S=seed(0);

#local Scale = .375;
#local StartRing = 5;
#local NumberOfRings=10;
#local TileSize = .48*Scale; //set the space for grout


#local Ring=StartRing;

//circular grid
#while(Ring<NumberOfRings)

   //#debug #concat ("\n Lat ",str(Lat,0,0 ))
   #local Circum = 2*3.1416*Ring*Scale;
   #local NumberOfTiles = int(Circum/Scale);
   #local Remainder =  mod(Circum/Scale,1);
   #local Adj = 1+Remainder/NumberOfTiles;
   #local Offset=60*rand(S);

   #local Tile=1;#while(Tile<NumberOfTiles+1 )

     object {
       Round_Box_Merge (
         <-TileSize,0,0>,
         <TileSize,-.5,2*TileSize>,
         TileSize/20
       )
       translate  <0,0,Ring*Scale>
       rotate  y*(Offset+(360*(Tile*Adj)/(Circum/Scale)))
       pigment { rgb .5}
     }

   #local Tile=Tile+1;#end
#local Ring=Ring+1;#end


Post a reply to this message

From: Chris B
Subject: Re: Pavement conundrum
Date: 20 Nov 2008 11:46:41
Message: <49259471$1@news.povray.org>
>> "Thomas de Groot" <t.d### [at] internlDOTnet> wrote in message
>> news:48c3964b@news.povray.org...
>>>
>>> How would one model this pavement in POV-Ray?
> Below is a simple POV-Ray encapsulation of this. There are lots of things
> you can play with, ...

I've tidied this macro up, written it up and added it to the Object 
Collection. at 
http://lib.povray.org/collection/curvedpaving/chrisb%201.0/curvedpaving.html

It's probably too late to be of use to Thomas, but maybe someone else can 
make use of it.

Regards,
Chris B.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Pavement conundrum
Date: 22 Nov 2008 03:28:14
Message: <4927c29e$1@news.povray.org>
"Chris B" <nom### [at] nomailcom> schreef in bericht 
news:49259471$1@news.povray.org...
>
>
> I've tidied this macro up, written it up and added it to the Object 
> Collection. at 
> http://lib.povray.org/collection/curvedpaving/chrisb%201.0/curvedpaving.html
>
> It's probably too late to be of use to Thomas, but maybe someone else can 
> make use of it.
>

Thanks a lot Chris! I had no immediate use for this pavement when I started 
the thread. It had been playing in my mind for quite a long time and it just 
came up again. However, I am sure I shall find use for it sooner or later.

Thomas


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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