[Therion] Using metapost code examples

Dave Clucas dave at daveclucas.com
Tue Dec 30 12:00:56 CET 2008


Looking at the metapost examples in the Wiki it appears that a block  
symbol can be defined or redefined which allows the size of the block  
to be changed. Does this apply to each instance of a block or is it a  
global definition. How do you specify the size of the block when you  
place it in the drawing?

   code metapost
    def p_blocks_UIS (expr pos,theta,sc,al)=
     symbolsize:=1.0u; %Factor*u; Factor=size of the blocks
     U:=(.5u,.5u);
     T:=identity aligned al rotated theta scaled sc shifted pos;
     pickup PenC;
     thdraw (.0symbolsize,.0symbolsize)--(1.0symbolsize,-. 
5symbolsize)--(0.0symbolsize,-1.5symbolsize)-- 
(-1.0symbolsize,-1.0symbolsize)--cycle;
     thdraw (.5symbolsize,-.25symbolsize)--(1.0symbolsize,. 
5symbolsize)--(0.0symbolsize,1.5symbolsize)--(-0.5symbolsize,. 
5symbolsize);
     thdraw (.0symbolsize,.0symbolsize)--(.0symbolsize,.5symbolsize)-- 
(-1.5symbolsize,.5symbolsize)--(-1.5symbolsize,-0.5symbolsize)-- 
(-0.5symbolsize,-0.5symbolsize);
    enddef;
   endcode



Dave Clucas
email:dave at daveclucas.com
Website: http://daveclucas.com
                  http://mycaves.org
Skype: daveclucas




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20081230/ea2e1e04/attachment.htm>


More information about the Therion mailing list