[Therion] Slope symbol needed

Philip Schuchardt ohc at vt.edu
Thu May 4 20:56:04 CEST 2006


This is how you overload metapost symbols.

######### thconfig file ###########
input layout.th
source main.th

#One page map
export map -layout plan -output ABC.pdf
export map -layout print -output ABC_Printable.pdf

########## Heres my layout.th ################
layout plan
  scale 1 200 #Working map scale
  #scale 1 400
  #scale 1 600 #1" to 50'
  #base-scale 1 600
  units imperial
  legend on
  color map-fg altitude
  transparency on
  debug station-names
    
  #PDF DOCUMENTION
  doc-author "Philip Schuchardt"
  code tex-map
    \cavename={Alva Blankenship Cave (WORKING COPY }
    \comment{Cartography By: Philip Schuchardt and Philip Balister  \copyright 
2006 VPI Cave Club}
  endcode
  

code metapost
    def l_wall_bedrock_AMER (expr P) =
      T:=identity;
      pickup PenA;
      thdraw P;
    enddef;  
    
    def p_gradient_AMER (expr pos,theta,sc,al) =
        U:=(.15u, .4u);
        T:=identity aligned al rotated theta scaled sc shifted pos;
        pickup PenC;
                
        #Left Hand side
        thdraw (-.3u, -.2u) -- (-.7u, .1u);
        thdraw (-.2u, -.1u) -- (-.4u, .6u);
        
        #Centerline
        thdraw (0u, 0u) -- (0u, .9u);
        
        #Right side
        thdraw (.3u, -.2u) -- (.7u, .1u);
        thdraw (.2u, -.1u) -- (.4u, .6u);
        
    enddef;

    def a_sand_AMER (expr p) =
      T:=identity;
      %  thclean p;
      pickup PenC;
      path q; q = bbox p;
      picture tmp_pic; 
      tmp_pic := image(
        for i = xpart llcorner q step .3u until xpart urcorner q:
          for j = ypart llcorner q step .3u until ypart urcorner q:
            draw origin shifted ((i,j) randomized 0.2u) withpen PenC;
          endfor;  
        endfor;
      );
      clip tmp_pic to p;
      draw tmp_pic;
    enddef;
    
    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;

  initsymbol ("a_sand_AMER");
  initsymbol ("a_debris_AMER");
  initsymbol ("p_gradient_AMER");
  initsymbol ("l_wall_bedrock_AMER");
  endcode
  
  symbol-assign area sand AMER
  symbol-assign area debris AMER
  symbol-assign line wall:bedrock AMER
  symbol-assign point gradient AMER


endlayout

Philip Schuchardt




More information about the Therion mailing list