[Therion] Metapost code for pendant and stromatolite symbols

Bill Gee bgee at campercaver.net
Tue Nov 11 19:25:11 CET 2014


Hi Martin -

Thanks!  I wound up not using any of this.  A bit of digging around the 
Internet found a document which described out to do circles and arcs in 
Metapost.  I adopted it and created routines to do symbols for both pendants 
and stromatolites.  See below ...

The stromatolite symbol is something that one of my friends invented for his 
own use.  I have not found any list of cave map symbols which includes a 
stromatolite. 

Bill Gee

====================
    def p_u_stromatolite (expr pos,theta,sc,al) =
      U:=(.15u, .4u);
      T:=identity aligned al rotated theta scaled sc shifted pos;
      pickup PenC;
      
      thdraw (0.7u, 0.8u) -- (-0.7u, 0.8u) -- (-0.2u, -0.8u) -- (0.2u, -0.8u) 
-- cycle;
      thdraw (-0.4u, 0.4u) -- (0.0u, 0.65u) -- (0.4u, 0.4u);    
      thdraw (-0.3u, 0.1u) -- (0.0u, 0.3u) -- (0.3u, 0.1u);     
      thdraw (-0.2u, -0.2u) -- (0.0u, -0.1u) -- (0.2u, -0.2u);  
      thdraw (-0.15u, -0.5u) -- (0.0u, -0.4u) -- (0.15u, -0.5u);
      
    enddef;

    def p_u_pendant (expr pos,theta,sc,al) =
      U:=(.15u, .4u);
      T:=identity aligned al rotated theta scaled sc shifted pos;
      pickup PenC;

      thdraw (-0.9u, 0.7u) -- (-0.5u, 0.7u);
      thdraw (-0.5u, 0.7u) .. (-0.3u, 0.6u) .. (-0.4u, 0.4u);
      thdraw (-0.4u, 0.4u) .. (-0.6u, 0.0u) .. (-0.3u, -0.5u);
      thdraw (-0.3u, -0.5u) -- (0.3u, -0.5u);
      thdraw (0.3u, -0.5u) .. (0.6u, 0.0u) .. (0.5u, 0.4u);
      thdraw (0.5u, 0.4u) .. (0.3u, 0.6u) .. (0.5u, 0.7u); 
      thdraw (0.5u, 0.7u) -- (0.9u, 0.7u);
  
    enddef;

    initsymbol ("p_u_stromatolite");
    initsymbol ("p_u_pendant");
======================


On Tuesday, November 11, 2014 12:49:01 Martin Sluka wrote:
> Just third link: sniper logo. Use the part of code you need.
> 
> 
> 
> % sniperlogo.mp
> % L. Nobre G.
> % 2012
> 
> prologues := 1;
> 
> beginfig(1);
>   numeric u, ray, siz, xdis, ang, mar, i;
>   u = 1cm;
>   siz = 5u;
>   ray = siz/6;
>   fill fullcircle scaled (2*(siz+ray));
>   xdis = (siz-2*ray) +-+ (2*ray);
>   ang = angle(xdis,2*ray);
>   z1 = (siz-ray)*dir(ang);
>   z2 = (siz-ray)*dir(90-ang);
>   z3 = (ray,(siz-2*ray)*cosd(ang));
>   z4 = z3 xscaled -1;
>   z5 = z2 xscaled -1;
>   z6 = z1 xscaled -1;
>   for i=7 upto 16:
>     z[i] = z[i-4] rotated 90;
>   endfor;
>   for i=0 upto 3:
>     z[21+i] = (siz-ray)*dir(45+90*i);
>   endfor;
>   path sniperpath;
>   sniperpath = z1{dir(ang+90)}..z21..{dir(180-ang)}z2..z3{down}..{up}z4..
>     z5{dir(180+ang)}..z22..{dir(270-ang)}z6..z7{right}..{left}z8..
>     z9{dir(270+ang)}..z23..{dir(-ang)}z10..z11{up}..{down}z12..
>     z13{dir(ang)}..z24..{dir(90-ang)}z14..z15{left}..{right}z16..cycle;
>   unfill sniperpath rotated 45;
> %  draw sniperpath;
> %  drawoptions( withcolor red );
> %  dotlabels(1,2,3,4,5,6,7,8,9,21,22)
> endfig;
> 
> end.
> 
> 
> 
> On Nov 11, 2014, at 01:30 PM, Bill Gee <bgee at campercaver.net> wrote:
> 
> Hi Martin -
> 
> I looked over the Metapost samples on the Therion Wiki but found nothing
> that seemed useful. I have done some Metapost code for symbols like
> stalactites and stalacmites, and I modified the popcorn symbol, so Metapost
> is not completely alien to my experience. I am no expert, though.
> 
> The pendant symbol is a bit of a challenge because it is not straight lines.
> I need to figure out how to draw curved lines for it.
> 
> The stromatolite symbol is even more of a challenge because I can't find
> anything to draw! One of my caving buddies has created his own symbol. He
> did it as a small jpg file, and I think I could do it in Metapost without
> much trouble. I would like to use an official symbol, if such a thing
> exists.
> 
> Regards - Bill Gee
> 
> On Tuesday, November 11, 2014 08:55:42 Martin Sluka wrote:
> > Try to check the links on wiki, there are many of examples how to use
> > metapost. The simplest way is to find something similar you need and
> > modify
> > code.
> > 
> > m.s.
> > 
> > 10. 11. 2014 v 17:39, Bill Gee <bgee at campercaver.net>:
> > > Hello everyone -
> > > 
> > > I need to put some pendants and stromatolites on a map. I do not see
> > > these
> > > symbols in Therion. Has anyone already done the Metapost code for them?
> > > 
> > > The symbol for a pendant looks sort of like the Greek letter upsilon,
> > > except it has rounded corners instead of sharp.
> > > 
> > > Attached is a bit of the sketch I am working from which shows the
> > > pendant
> > > symbol.
> > > 
> > > Thanks - Bill Gee
> > > 
> > > <MillCreekSymbols3.jpg>_______________________________________________
> > > Therion mailing list
> > > Therion at speleo.sk
> > > http://mailman.speleo.sk/mailman/listinfo/therion
> > 
> > _______________________________________________
> > Therion mailing list
> > Therion at speleo.sk
> > http://mailman.speleo.sk/mailman/listinfo/therion
> 
> _______________________________________________
> Therion mailing list
> Therion at speleo.sk
> http://mailman.speleo.sk/mailman/listinfo/therion




More information about the Therion mailing list