mmj:106

The default code for symbol area snow is this one :

  def a_snow (expr P) =
    T:=identity;
    pickup PenC;
    path q; q = bbox P;
    picture tmp_pic, tmp_sn; 
    pair z;
    tmp_sn := image(
      pickup PenC;
      p := origin--(0,.2*u);
      draw p; draw p rotated (60); draw p rotated (120);
      draw p rotated (180); draw p rotated (240); draw p rotated (300);
      p := ((0,.3u)--(0,0.2u)--(0.1u,0.2u)) rotatedaround ((0,0.2u),45);
      draw p; draw p rotated (60); draw p rotated (120);
      draw p rotated (180); draw p rotated (240);
      draw p rotated (300);
    );
    tmp_pic := image(
      for i = xpart llcorner q step 1.5u until xpart urcorner q:
        for j = ypart llcorner q step 1.5u until ypart urcorner q:
          z:=((i,j) randomized 1.3u);
          if xpart (P intersectiontimes ((bbox tmp_sn) shifted z)) < 0:
            draw tmp_sn shifted z;
          fi;
        endfor;  
      endfor;
    );
    clip tmp_pic to P;
    draw tmp_pic;
  enddef;
  • mmj/106.txt
  • Last modified: 13 years ago
  • (external edit)