encoding  utf-8

source Jazveci_hrad_a_Viktoria.th


export model -output Jazveci_hrad_a_Viktoria.lox
export map -output Jazveci_hrad_a_Viktoria.pdf -layout nazov
#export map -output Jazveci_hrad_a_Viktoria.xvi -layout nazov
export map -output Jazveci_hrad_a_Viktoria_ext.pdf -layout nazov -projection extended
#export map -output Jazveci_hrad_a_Viktoria_ext.xvi -layout nazov -projection extended

text sk "area clay" "hlina"
text sk "line u:bralo" "obrys brala"
text sk "line u:strop" "znížený strop"
text sk "line overhang" "komín"
text sk "line slope" "šikmina"
text sk "line wall:pit" "betónový vstup - priepasť"
text sk "point station:temporary" "meračský bod"
text sk "point clay-choke" "hlinitý uzáver (treba prekopať)"

layout nazov

scale 1 100
#symbol-hide line survey
symbol-color line survey [80 70 50]

debug station-names

symbol-assign point station SKBB
#symbol-assign sand AUT 
symbol-assign line wall:clay AUT

legend on 
legend-columns 3
legend-width 23 cm

language sk
#symbol-color area u:bahno 50
symbol-hide line survey:surface
#colour map-fg [90 90 90]
#colour map-bg [0 0 80]

code metapost

def 
PenA = pencircle scaled (1.3*u/10) 
enddef;
def
PenB = pencircle scaled (0.1*u/10)
enddef;

def l_wall (expr P) = 
  T:=identity;
  pickup PenA;
  thdraw P;
enddef;

def l_wall_extended (expr P) = 
  T:=identity;
  pickup PenA;
  thdraw P;
enddef;
 
 def l_u_bralo (expr P) = 
  T:=identity;
  pickup PenB;
  thdraw P;
enddef;

def l_u_strop(expr Path) =
 T:=identity;
 pickup PenC;
 draw Path dashed evenly scaled (3 * optical_zoom);
enddef;

  def a_sand (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 0.4u until xpart urcorner q:
      for j = ypart llcorner q step 0.4u until ypart urcorner q:
        draw origin shifted ((i,j) randomized 0.7u) withpen PenC;
      endfor;
    endfor;
  );
  clip tmp_pic to p;
  drawoptions();
  draw tmp_pic;
enddef;

 #strelka:
  def s_northarrow (expr rot) =
    begingroup
      interim defaultscale:=0.7; % scale your north arrow here
      T:=identity scaled defaultscale rotated -rot;
      interim linecap:=squared;
        interim linejoin:=rounded;
      #strelka horná:
      thdraw (-.6cm,-.1cm)--(0,2.4cm)--(.6cm,-.1cm)--cycle;
      thfill (-.6cm,-.1cm)--(0,2.4cm)--(.0cm,-.1cm)--cycle;
      #nožička hore:
      pickup pencircle scaled (0.06cm * defaultscale);
      thdraw (0,-3.5)--(0,-0.6cm);
      #nožička dole:
      pickup pencircle scaled (0.06cm * defaultscale);
      thdraw (0,-87)--(0,-2.6cm);
      #strelka dolná:
      pickup pencircle scaled (0.03cm * defaultscale);
      thdraw (-.3cm,-4.3cm)--(-0.1,-3.0cm)--(.3cm,-4.3cm)--cycle;
      thfill (-.0cm,-4.3cm)--(-0.1,-3.0cm)--(.3cm,-4.3cm)--cycle;
      #kruh okolo:
      pickup pencircle scaled (0.06cm * defaultscale);
      p:=fullcircle scaled 1.9cm shifted (0,-1.6cm);
      thdraw p;
      #N-ko a nápis za ním:
      pickup pencircle scaled (0.18cm * defaultscale);
      p:=(0.4cm,0.6cm);
      thdraw ((p--(p yscaled -1)--(p xscaled -1)--(p scaled -1)) shifted (0,-1.6cm));
      label.rt(thTEX("orth") scaled 1.2, (.9cm,-2.12cm)) transformed T;
      #fifíky vpravo a vľavo
      pickup pencircle scaled (0.06cm * defaultscale);
      p:=((0.29cm,0) shifted (0,-1.6cm)--(0.35cm,0) shifted (0,-1.6cm));
      thdraw p xscaled 3.4; thdraw p xscaled -3.4; 
    endgroup;
  enddef;
  
  #mierka mapy:
  def s_scalebar (expr l, units, txt) =
    begingroup
      interim warningcheck:=0;
      tmpl:=l / Scale * cm * units / 2;
      tmpx:=l / Scale * cm * units / 5;
      tmph:=5bp; % bar height
    endgroup;
    pickup PenC;
    draw (-tmpl,0)--(tmpl,0)--(tmpl,-tmph)--(-tmpl,-tmph)--cycle;
    p:=(0,0)--(tmpx,0)--(tmpx,-tmph)--(0,-tmph)--cycle;
    for i:=-2.5 step 2 until 2:
      fill p shifted (i * tmpx,0);
    endfor;
    begingroup
      interim labeloffset:=3.5bp;
      for i:=0 step (l/5) until (l-1):
        tmpx:=tmpl * (i * 2 / l - 1);
        label.bot(thTEX(decimal (i)),(tmpx,-tmph));
      endfor;
      label.bot(thTEX(decimal (l) & "\thinspace" & txt),(tmpl,-tmph));
      label.top(thTEX("Mierka 1 : " & decimal round(Scale*100)),(0,0.2cm));
    endgroup;
  enddef;
 endcode
endlayout
