encoding utf-8 source olomoucky_dom.th select cely_olomoucky@olomoucky_dom layout my_layout cs JTSK scale 1 100 #nastavení měřítka mapy page-setup 42 29.7 41.4 28.5 1 1 cm #A3 size 41 28 cm #A3 #page-setup 29.7 21 27.7 19 1 1 cm #A4 #size 26.7 18 cm #A4 overlap 1.0 cm code tex-atlas \def\dopage{\box\mapbox} \insertmaps origin 10 10 10 m #počátek mapy - myslím spíš pro atlas origin-label 10 K debug station-names extend-debug all debug all #grid bottom #grid-size 1 1 1 m #color map-fg scraps #vybarvení mapy podle scrapů #color map-fg altitude #vybarvení mapy podle nadmořské výšky color map-bg 100 # pozadí mapy color map-fg [50 40 10] symbol-colour group cave-centerline [70 0 0] # brown [35 16 16] barva centerline symbol-colour point cave-station [50 0 0] #hnědočervená barva bodů transparency on # průhlednost pro překrývající se vrstvy opacity 65 # jak moc průhledné mají vrstvy být language cz statistics topo-length on legend on # zobrazení legendy stations-names on #map-header 0 60 nw # zde se nastavuje pozice hlavičky mapy (legendy), nyní ale vypnuto # nastavení řeším dole v code tex-map layers off map-comment "1:100" # komentář s měřítkem mapy scale-bar 5 m # velikost měřítka - jeskyně je malá, tak 5m symbol-assign point station:temporary UIS # zde se předefinovávají některé jinak implicitní definice mapy # hlavně zde umístění hlavičky mapy a velikosti písma hlavičky #code metapost #šířka čáry #def PenA = pencircle scaled (u/10) enddef; #def PenB = pencircle scaled (0.7*u/10) enddef; #def PenC = pencircle scaled (0.5*u/10) enddef; #def PenD = pencircle scaled (0.35*u/10) enddef; #def PenX = pencircle scaled (1.2*u/10) enddef; #endcode code metapost def l_slope (expr P,S)(text Q) = %show Q; T:=identity; numeric dirs[]; numeric lengths[]; for i=Q: dirs[redpart i]:=greenpart i; lengths[redpart i]:=bluepart i; endfor; li:=length(P); % last alw_perpendicular:=true; for i=0 upto li: if unknown dirs[i]: dirs[i]:=-1; else: if dirs[i]>-1: dirs[i]:=((90-dirs[i]) - angle(thdir(P,i))) mod 360; alw_perpendicular:=false; fi; fi; if unknown lengths[i]: lengths[i]:=-1; fi; endfor; %for i=0 upto li: show dirs[i]; endfor; ni:=0; % next pi:=0; % previous for i=0 upto li: d:=dirs[i]; if d=-1: if (i=0) or (i=li): dirs[i] := angle(thdir(P,i) rotated 90) mod 360; pi:=i; else: if ni<=i: for j=i upto li: ni:=j; exitif dirs[j]>-1; endfor; fi; w:=arclength(subpath(pi,i) of P) / arclength(subpath(pi,ni) of P); dirs[i]:=w[dirs[pi],dirs[ni]]; % if (dirs[i]-angle(thdir(P,i))) mod 360>180: % dirs[i]:=w[dirs[ni],dirs[pi]]; % message("*******"); % fi; fi; else: pi:=i; fi; endfor; %for i=0 upto li: show dirs[i]; endfor; ni:=0; % next pi:=0; % previous for i=0 upto li: l:=lengths[i]; if l=-1: if (i=0) or (i=li): lengths[i] := 1cm; % should never happen! thwarning("slope width at the end point not specified"); pi:=i; else: if ni<=i: for j=i+1 upto li: ni:=j; exitif lengths[j]>-1; endfor; fi; w:=arclength(subpath(pi,i) of P) / arclength(subpath(pi,ni) of P); lengths[i]:=w[lengths[pi],lengths[ni]]; pi:=i; fi; else: pi:=i; fi; endfor; % for i=0 upto li: show lengths[i]; endfor; T:=identity; boolean par; cas := 0.3u; krok := 0.7u; dlzka := (arclength P); if dlzka>3u: dlzka:=dlzka-0.6u fi; mojkrok:=adjust_step(dlzka,1.4u) / 3; pickup PenD; par := false; forever: t := arctime cas of P; if t mod 1>0: % not a key point w := (arclength(subpath(floor t,t) of P) / arclength(subpath(floor t,ceiling t) of P)); if alw_perpendicular: a := 90; else: a := w[dirs[floor t],dirs[ceiling t]]; fi; l := w[lengths[floor t],lengths[ceiling t]]; else: if alw_perpendicular: a := 90; else: a:= dirs[t]; fi; l:=lengths[t]; fi; a := a + angle(thdir(P,t)); thdraw (point t of P) -- ((point t of P) + if par: 0.333 * fi l * unitvector(dir(a))); cas := cas + mojkrok; par := not par; exitif cas > dlzka + .3u + (krok / 3); % for rounding errors endfor; if S = 1: pickup PenC; draw P fi; %pickup pencircle scaled 3pt; %for i=0 upto li: draw point i of P; endfor; enddef; endcode code metapost 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("Scale 1 : " & decimal (Scale*100)),(0,0)); endgroup; enddef; endcode code tex-map \def\maplayout{ \legendbox{10}{90}{N}{\northarrow} \legendbox{10}{85}{N}{\scalebar} \legendbox{10}{75}{N}{\the\legendcontent} } \legendcontent={% \hsize=\legendwidth \edef\tmp{\the\cavename} \ifx\tmp\empty \else {\size[26]\the\cavename} \vskip1cm \fi {\rightskip=0pt plus 3em\parskip=3bp \edef\tmp{\the\comment} \ifx\tmp\empty \else {\size[10]\the\comment} \par\medskip \fi \everypar{\hangindent=2em\hangafter=1} \edef\tmp{\the\cavelength} \ifx\tmp\empty \else {\size[8]\si\the\cavelengthtitle: \ss\the\cavelength\par} \fi \edef\tmp{\the\cavedepth} \ifx\tmp\empty \else {\size[8]\si\the\cavedepthtitle: \ss\the\cavedepth\par} \fi \edef\tmp{\the\exploteam} \ifx\tmp\empty \else {\size[8]\si\the\explotitle: \ss\the\exploteam\quad\si\the\explodate\par} \fi \edef\tmp{\the\topoteam} \ifx\tmp\empty \else {\size[8]\si\the\topotitle: \ss\the\topoteam\quad\si\the\topodate\par} \fi \edef\tmp{\the\cartoteam} \ifx\tmp\empty \else {\size[8]\si\the\cartotitle: \ss\the\cartoteam\quad\si\the\cartodate\par} \fi \edef\tmp{\the\copyrights} \ifx\tmp\empty \else {\size[8]\ss\the\copyrights\par} \fi } \formattedlegend } endlayout export map -o ../output/olomoucky_dom.xvi -layout my_layout export map -o ../output/olomoucky_dom.pdf -layout my_layout #export atlas -o ../output/olomoucky_dom_atl.pdf -layout my_layout export model -o ../output/olomoucky_dom.lox