metapost

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
metapost [2019/06/02 23:42] – [Symbol Sizing and Positioning] add more examples brucemuttonmetapost [2019/06/04 00:02] – [Magnetic effects] tarquinwj
Line 171: Line 171:
 {{:metapost:symbolparameterindicatorsamples.png?400|}} {{:metapost:symbolparameterindicatorsamples.png?400|}}
  
 +And one last example, using ''point water'', with the above code added, that demonstrates how align is related to scrap coordinates rather than the output coordinates.
 +
 +{{:metapost:symbolscrapaligntooutputalignexplained.png?400|}}
  
 Bruce Bruce
Line 363: Line 366:
  
   text en "point u:warning" "warning/danger"   text en "point u:warning" "warning/danger"
-      + 
 +===Magnetic effects=== 
 + 
 +Certain rocks can cause a compass to give the wrong reading. This icon can be used to show areas where this happens (ie. where the survey may be unreliable as a result); a spinning compass: 
 + 
 +<code> 
 +code metapost 
 +  % a spinning compass 
 +  def p_u_magnetism (expr P,R,S,A)= 
 +    scale:=0.5u; 
 +    halfline:=(0.5u/20S); %half thickness of PenC - pen thicknesses do not scale with S 
 +    pointheight:=scale*.9; 
 +    pointwidth:=scale*.4; 
 +    U:=(scale,scale); 
 +    T:=identity aligned A rotated (R-20) scaled S shifted P; 
 +    % a circle 
 +    thdraw fullcircle scaled 2scale withpen PenC withcolor black; 
 +    % filled triangle 
 +    thfill (0,pointheight)--(pointwidth,0)--(-pointwidth,0)--cycle withcolor black; 
 +    % black triangle outline 
 +    thdraw (0,-pointheight+halfline)--(pointwidth-halfline,0) withpen PenC withcolor black; 
 +    thdraw (0,-pointheight+halfline)--(-pointwidth+halfline,0) withpen PenC withcolor black; 
 +    % spin arcs, a full circle is path 0-8, anticlockwise, starting from the right 
 +    thdraw subpath (2.4,3.5) of fullcircle scaled 1.5scale withpen PenC withcolor black; 
 +    thdraw subpath (6.4,7.5) of fullcircle scaled 1.5scale withpen PenC withcolor black; 
 +  enddef; 
 +  initsymbol("p_u_magnetism"); 
 +endcode 
 +</code> 
 + 
 +{{ ::magnetism.png?nolink |}} 
 + 
 +Select this as point type "u" with "-subtype magnetism" in its options. Use it with this line in your layout: 
 + 
 +  text en "point u:magnetism" "magnetism"
 ====Line Symbols==== ====Line Symbols====
 ===View whole centerline for underground=== ===View whole centerline for underground===
  • metapost.txt
  • Last modified: 21 months ago
  • by tarquinwj