Guest User

Rotating Diffusion-Limited Aggregation

a guest
Jul 27th, 2026
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | Science | 0 0
  1. #!/usr/bin/env gmic
  2. # File : rotating_dla.gmic
  3. # Author : David Tschumperle
  4.  
  5. # Entrypoint when run from CLI:
  6. go =>[^] "Rotating Diffusion Limited Aggregation" e[] "" animate 60
  7.  
  8. # Main function
  9. go :
  10.   v 0
  11.   480,480 noise 0.001,2 != 0
  12.   nbf=300
  13.   repeat $nbf { f=$>
  14.     e[] "
  15.  > Frame "{$f+1}/$nbf
  16.     +>[0] 0.45 distance. 1 b. 1 g. xy,6 a[-2--1] c orientation.
  17.     1000,1,1,1,":
  18.      do (x = v(w#0 - 1); y = v(h#0 - 1), i(#0,x,y));
  19.      repeat (w#0,k,
  20.        G = I(#-1,x,y,0,1);
  21.        dl = 1/max(abs(G));
  22.        nx = x - dl*G[0];
  23.        ny = y - dl*G[1];
  24.        i(#0,round(nx),round(ny))?break();
  25.        x = nx; y = ny;
  26.      );
  27.      i(#0,x,y) = 1"
  28.     rm[-2,-1]
  29.  
  30.     # Render frame.
  31.     +b[0] 2,3 *. 800 c. 0,255 map. curl
  32.     rotate[0] 2,1,0,50%,50% zoom[0] 0.97
  33.   }
  34.   rm[0]
  35.  
  36. # End of file.
Tags: gmic
Advertisement
Add Comment
Please, Sign In to add comment