POV-Ray : Newsgroups : povray.advanced-users : Direct stochastic tiling : Direct stochastic tiling Server Time23 Feb 2024 22:53:44 EST (-0500)
 Direct stochastic tiling
 From: Bald Eagle Date: 20 Sep 2023 22:05:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.650ba428c90fe1dd1f9dae3025979125%40news.povray.org",
"dateCreated": "2023-09-21T02:05:00+00:00",
"datePublished": "2023-09-21T02:05:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
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.

https://graphics.cs.kuleuven.be/publications/LD05PODF/LD05PODF_paper.pdf

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
```

Attachments: