[Therion] North Grid and Mag

Martin Sluka martinsluka at mac.com
Mon Jun 27 11:42:46 CEST 2016


https://www.tug.org/docs/metapost/mpman.pdf

pge 65.

14.1 Customizing Run-Time Behavior
MetaPost knows and obeys a number of internal variables that have no direct impact on drawing commands, but can be used to customize the way the MetaPost compiler processes input files. The following paragraphs describe those variables (in no particular order).
Date and Time MetaPost provides a number of internal numeric variables that store the date and time a job was started, i.e., the MetaPost executable was called on the command-line. Variables year, month, day, hour, and minute should be self-explanatory. Variable time returns the number of minutes past midnight, since the job was started, i.e., time = 60 * hour + minute.

m.

On Jun 27, 2016, at 11:15 AM, Bruce <bruce at tomo.co.nz> wrote:

Dirk
I have posted this on the wiki, but not tested.
http://therion.speleo.sk/wiki/doku.php/metapost#special_symbol_examples
 
Bruce
 
From: Dirk Peinelt [mailto:dirk.peinelt at t-online.de] 
Sent: Thursday, 9 June 2016 7:35 a.m.
To: 'Martin Sluka'; Bruce Mutton
Subject: AW: [Therion] Therion Digest, Vol 126, Issue 7
 
Hi Martin, Bruce,
the definition may be published to the wiki.
I’dont know if the code is effective. (I’ve not used the A-D Pens.)
 
I combine this compass rose with a creation date in the map-header (/currentdate).
A date variable is not present in metapost.
 
If the CS is not set, the declination is Zero.
Also if the declination is Zero, the northarrow is a Nmag arrow:
North grid/true rotate the whole plan with the north arrow. (merid. Conv.?)
 
A small change… (I hope i am not mistaken.)
 
 
<image001.jpg>
<image003.jpg>
 
def s_northarrow (expr rot) =
              valscal=1.2; % scale your north arrow here
              decl:=MagDecl;
              T:=identity;
              picture tmp_pic;
              tmp_pic = image (
                            pickup pencircle scaled .3;
                            thfill fullcircle scaled 4cm withcolor 1white;
                            thdraw fullcircle scaled 3.1cm;
                            thdraw fullcircle scaled 4.05cm;
                            pickup pencircle scaled .1;
                            thdraw fullcircle scaled 3cm;
                            thdraw fullcircle scaled 4cm;
                            pickup pencircle scaled .2;
                            thdraw (dir(45)*2.025cm)--(dir(45)*3.7cm);
                            thdraw (dir(135)*2.025cm)--(dir(135)*3.7cm);
                            thdraw (dir(225)*2.025cm)--(dir(225)*3.7cm);
                            thdraw (dir(315)*2.025cm)--(dir(315)*3.7cm);
                            pickup pencircle scaled .1;
                            for whereto=0 step 15 until 345:
                              thdraw dir(whereto)*.65cm--dir(whereto)*.9cm;
                              thdraw dir(whereto)*1.4cm--dir(whereto)*1.5cm;
                            endfor;
                            for whereto=0 step 5 until 355:
                              thdraw dir(whereto)*.65cm--dir(whereto)*.8cm;
                              thdraw dir(whereto)*1.45cm--dir(whereto)*1.5cm;
                            endfor;
                            for whereto=0 step 1 until 359:
                              thdraw dir(whereto)*1.94cm--dir(whereto)*2cm;
                            endfor;
                            pickup pencircle scaled 1;
                            thdraw fullcircle scaled 1cm;
                            thdraw fullcircle scaled 1.1cm;
                            thdraw fullcircle scaled 1.3cm withpen pencircle scaled .3;
                            vald=90-decl;
                            texrot=0-decl;
                            drawarrow(dir(vald)*-2cm--dir(vald)*2cm) withpen pencircle scaled .2;
                            if (MagDecl <> 0): thdraw image(label.top(btex $mg$ etex, (0,0)) scaled .5 rotated texrot;) shifted (dir(vald)*2.04cm); fi;                                              
                            thfill (1.06cm,1.06cm)--(0,.2cm)--(-1.06cm,1.06cm)--(-.2cm,0)--(-1.06cm,-1.06cm)--(0,-.2cm)--(1.06cm,-1.06cm)--(.2cm,0)--cycle;
                            thfill (-.2cm,.2cm)--(0,2cm)--(0,0)--cycle;
                            thfill (.2cm,-.2cm)--(0,-2cm)--(0,0)--cycle;
                            thfill (.2cm,.2cm)--(2cm,0)--(0,0)--cycle;
                            thfill (-.2cm,-.2cm)--(-2cm,0)--(0,0)--cycle;
                            thfill (.2cm,.2cm)--(-0,2cm)--(0,0)--cycle withcolor 1white;
                            thfill (.2cm,-.2cm)--(2cm,0)--(0,0)--cycle withcolor 1white;
                            thfill (-.2cm,-.2cm)--(0,-2cm)--(0,0)--cycle withcolor 1white;
                            thfill (-.2cm,.2cm)--(-2cm,0)--(0,0)--cycle withcolor 1white;                                    
                            pickup pencircle scaled .2;
                            thdraw (-.2cm,.2cm)--(0,2cm)--(.2cm,.2cm)--(2cm,0cm)--(.2cm,-.2cm)--(0,-2cm)--(-.2cm,-.2cm)--(-2cm,0)--cycle;
                            thfill fullcircle scaled .56cm withcolor 1white;
                            pickup pencircle scaled .1;
                            thdraw (.28cm,0)..(0,.28cm)..(-.28cm,0)..(0,-.28cm)..cycle;
                            pickup pencircle scaled .4;
                            thdraw (.2cm,0)..(0,.2cm)..(-.2cm,0)..(0,-.2cm)..cycle;
                            if (MagDecl = 0): label.bot(btex $Nmag$ etex, (0,2.6cm)); else: label.bot(btex $N$ etex, (0,2.6cm)); fi;
                            label.lft(btex $E$ etex, (2.6cm,0));
                            label.rt(btex $W$ etex, (-2.6cm,0));
                            label.top(btex $S$ etex, (0,-2.6cm));
              );
              thdraw tmp_pic scaled valscal rotatedaround(origin, -rot);
enddef;
 
 
//dirk
_______________________________________________
Therion mailing list
Therion at speleo.sk
http://mailman.speleo.sk/mailman/listinfo/therion
<image001.jpg>
<image003.jpg>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20160627/37a1fe24/attachment.htm>


More information about the Therion mailing list