Quantcast
Channel: How to have a real random pattern? - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 4

How to have a real random pattern?

$
0
0

How to have a new recalculated random pattern? This one is the same translated everywhere.

Edit

I perfectly understand that the pattern is calculated once and drawn several times after.

My question is, how to change this: use the mechanism of the pattern to paint an area with, but to force a recalculation of the pattern at each drawing. For an usual pattern it is useless, but in this case one could extract the code and switch the order and insert the pattern calculation and drawing inside the loop that fill the area: a sort of pattern-bis that one could use as normal pattern syntax.

I don't know TeX programming enough to do that if it possible. Of course such a work will deserve a bounty !

enter image description here

\documentclass[tikz,margin=3pt]{standalone}\usetikzlibrary{patterns}\pgfdeclarepatternformonly{Rnd}{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}{\pgfpoint{.5cm}{.5cm}}{\foreach \i in {1,...,100} {%    \pgfpathcircle{%        %\pgfpoint{.25cm}{.25cm}}{.4pt}        \pgfpoint{rnd*.5cm}{rnd*.5cm}}{.25pt}}    \pgfusepath{fill}}\begin{document}\begin{tikzpicture}\draw[pattern=Rnd] (0,0) rectangle (5,5) ;\end{tikzpicture}\end{document}

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images