encoding utf-8 layout symbols symbol-assign line wall:debris AUT code metapost def l_u_rail (expr P) = T:=identity; cas := 0; dlzka := arclength P; mojkrok:=adjust_step(dlzka, 0.8u); pickup PenC; forever: t0 := arctime (cas) of P; t1 := arctime (cas + mojkrok*2/5) of P; t := arctime (cas + mojkrok/2) of P; t4 := arctime (cas + mojkrok*3/5) of P; t5 := arctime (cas + mojkrok) of P; thdraw (subpath (t0,t1) of P); thdraw (subpath (t4,t5) of P); drawdot (point t of P); #mark_ (P,t,0.02u); #mark_ (P,t,-0.02u); #f := (P,t,0.2u); #draw f; cas := cas + mojkrok; exitif cas > dlzka - (2*mojkrok/3); % for rounding errors endfor; enddef; initsymbol("l_u_rail") #text en line u:rail "Railing" def a_debris_CHED (expr p) = T:=identity; pickup PenC; path q, qq; q = bbox p; picture tmp_pic; tmp_pic := image( for i = xpart llcorner q step u until xpart urcorner q: for j = ypart llcorner q step u until ypart urcorner q: qq := punked (((-.2u,-.2u)--(.2u,-.2u)--(.2u,.2u)--(-.2u,.2u)--cycle) randomized (u/2)) rotated uniformdeviate(360) shifted ((i,j) randomized u); if xpart (p intersectiontimes qq) < 0: thclean qq; thdraw qq; fi; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef; def a_sand_CHED(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 .3u until xpart urcorner q: for j = ypart llcorner q step .3u until ypart urcorner q: draw origin shifted ((i,j) randomized 0.2u) withpen PenC; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef; def l_flowstone_CHED (expr P) = T:=identity; cas := 0; dlzka := arclength P; mojkrok:=adjust_step(dlzka, .25u); pickup PenC; t1:=0; forever: t2 := arctime (cas + mojkrok) of P; thdraw (point t1 of P){dir (angle(thdir(P,t1)) + 60)} .. {dir (angle(thdir(P,t2)) - 60)}(point t2 of P); cas := cas + mojkrok; exitif cas > dlzka + (mojkrok / 3); % for rounding errors t1:=t2; endfor; enddef; def l_overhang_CHED (expr P) = # taken from: def l_ceilingstep_SKBB (expr P) = T:=identity; cas := 0; dlzka := arclength P; #controls the length mojkrok:=adjust_step(dlzka, 0.3u); pickup PenC; forever: t1 := arctime (cas + mojkrok*1/5) of P; t := arctime (cas + mojkrok/2) of P; t2 := arctime (cas + mojkrok*4/5) of P; thdraw (subpath (t1,t2) of P); #controls the lengthof the tick mark_ (P,t,0.15u); cas := cas + mojkrok; exitif cas > dlzka - (2*mojkrok/3); % for rounding errors endfor; enddef; def l_pit_CHED (expr P) = T:=identity; cas := 0; dlzka := arclength P; mojkrok:=adjust_step(dlzka, 0.1u); pickup PenD; forever: t := arctime cas of P; mark_ (P,t,0.1u); cas := cas + mojkrok; exitif cas > dlzka + (mojkrok / 3); % for rounding errors endfor; pickup PenC; thdraw P; enddef; initsymbol ("l_flowstone_CHED"); initsymbol ("l_pit_CHED"); initsymbol ("l_overhang_CHED"); initsymbol ("a_sand_CHED"); initsymbol ("a_debris_CHED"); def l_wall_blocks_CHED (expr P) = % pickup PenD; % draw P withcolor red; T:=identity; cas := 0; dlzka := arclength P; if dlzka > 0: mojkrok:=adjust_step(dlzka, .9u); pickup PenB; forever: t1 := arctime (cas + mojkrok*1/10) of P; t2 := arctime (cas + mojkrok*9/10) of P; q := ((point t1 of P) + .2u * unitvector(thdir(P,t1) rotated -90)) -- (subpath (t1,t2) of P) -- ((point t2 of P) + .2u * unitvector(thdir(P,t2) rotated -90)); thdraw q randomized (u/6); cas := cas + mojkrok; exitif cas > dlzka - (2*mojkrok/3); % for rounding errors endfor; fi; enddef; initsymbol ("l_wall_blocks_CHED"); #derived from def l_pit_UIS (expr P) = def l_floorstep_CHED (expr P) = T:=identity; cas := 0; dlzka := arclength P; # Step leangth changed from 0.25 mojkrok:=adjust_step(dlzka, 0.12u); pickup PenD; forever: t := arctime cas of P; #length of tck shorted pit was 0.2 mark_ (P,t,0.1u); cas := cas + mojkrok; exitif cas > dlzka + (mojkrok / 3); % for rounding errors endfor; pickup PenC; thdraw P; enddef; initsymbol ("l_floorstep_CHED"); symbol-colour point water-flow [0 0 100] code metapost let p_gradient = p_entrance_UIS; #replaces the UIS gradient symbol with the entrance symbol that looks like #BCRA gradient symbol # define dashed line for surface surveys def l_survey_surface (expr P) = T:=identity; pickup PenD scaled 0.2; thdraw P withcolor (0.8,0.8,0.8); enddef; def l_survey_cave (expr P) = T:=identity; pickup PenD scaled 0.2; thdraw P; enddef; # define water to be light blue def a_water (expr p) = T:=identity; #nice light blue - but nearly same as level colour - change back when we have control of that thfill p withcolor (0.48, 0.84, 1.0); # thfill p withcolor (0.0, 0.0, 1.0); enddef; # define sump to be dark blue def a_sump (expr p) = T:=identity; thfill p withcolor (0.05, 0.0, 0.7); enddef; #Change the scale bar to black and transparent bar, split into 5 and labelled 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; #Adjusted to make lines not stick out: 0.25*u/10,0 is half thickness of PenC draw (-tmpl+0.25*u/10,0)--(tmpl-0.25*u/10,0); draw (tmpl-0.25*u/10,-tmph)--(-tmpl+0.25*u/10,-tmph); 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.top(thTEX(decimal (i)),(tmpx,0)); endfor; label.top(thTEX(decimal (l) & "\thinspace" & txt),(tmpl,0)); # label.bot(thTEX("Original Scale = 1 : " & decimal (Scale*100)),(0,-tmph)); endgroup; enddef; def s_northarrow_CHED (expr rot) = T:=identity scaled 0.7 rotated -rot; thdraw (-1cm,-2cm)--(0,3cm)--(1cm,-2cm)--(0,0cm)--cycle; thfill (-1cm,-2cm)--(0,3cm)--(0,0cm)--cycle; enddef; initsymbol("s_northarrow_CHED") endcode symbol-assign area blocks AUT symbol-assign area debris CHED symbol-assign area sand CHED symbol-assign line flowstone CHED symbol-assign line overhang CHED symbol-assign line pit CHED symbol-assign line wall:blocks CHED symbol-assign line floor-step CHED symbol-assign special north-arrow CHED endlayout