[Therion] area file defs

Andrew Atkinson andrew at wotcc.org.uk
Thu Sep 16 09:46:13 CEST 2010


Bruce (or anyone else)

Thanks for the examples of code you have put on the wiki, it is helping 
me lots with my first play at altering the code. I have moved onto 
playing with the area defs.

I am slowly getting my head round it, and hopefully will be able to add 
a novice guide to the wiki, when eventually I do.

What I would like to do is change the density of the debris code, 
although random, it seems logical that the probability of getting more 
can be increased.. Same size parts but more of them.

I have played with some of the numbers but not got anywhere, is it 
possible to change the density of the 'blocks' and for future reference 
the size of them?

       def a_debris_AMER (expr p) =
       T:=identity;
       pickup PenC;
       path q, qq; q = bbox p;
       picture tmp_pic;
       tmp_pic := image(
         for i = xpart llcorner q step u until xpart urcorner q:
          for j = ypart llcorner q step u until ypart urcorner q:
             qq := punked
   (((-.2u,-.2u)--(.2u,-.2u)--(.2u,.2u)--(-.2u,.2u)--cycle)
          randomized (u/2))
                rotated uniformdeviate(360)
                shifted ((i,j) randomized u);
        if xpart (p intersectiontimes qq) < 0:
         thclean qq;
         thdraw qq;
        fi;
           endfor;
         endfor;
       );
       clip tmp_pic to p;
       draw tmp_pic;
     enddef;

thanks

Andrew




More information about the Therion mailing list