POV-Ray : Newsgroups : povray.advanced-users : Direct stochastic tiling : Direct stochastic tiling Server Time
23 Feb 2024 22:53:44 EST (-0500)
  Direct stochastic tiling  
From: Bald Eagle
Date: 20 Sep 2023 22:05:00
Message: <web.650ba428c90fe1dd1f9dae3025979125@news.povray.org>
Following through a long train of papers and references therein, I picked a part
of one that looked "simple" to implement.

The attached is a "Direct stochastic tiling" pattern that assigns any unit
square a random, but calculable Wang tile.  The edge color of any Wang tile
matches the edge of any adjacent Wang tile.


Since it's a pattern, it's all functions.

Would you like to not lose your mind trying to figure out why patterns don't do
what you think they're supposed to do?  Especially across the origin?
Stop using mod (), and use the user-defined function:

#declare fmod = function (N, Modulo) {select (N, 1-mod(abs(N), Modulo), mod
(abs(N), Modulo))}

And use that wherever you need x, y, or z in a repeating unit-square pattern.

- BE

Post a reply to this message

Download 'direct stochastic tiling.png' (31 KB)

Preview of image 'direct stochastic tiling.png'
direct stochastic tiling.png


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