# taken from various under Creative Commons Share Alike ### index of file options from _layouts.mp #copy custom_snow #copy custom_flowstone #copy custom_water_blue #copy custom_legend_large_format_5U #copy custom_scalebar #borrowedstolen base from AndrewAtkinson Wookeyhole template #copy custom_continuations #copy custom_border #copy custom_rigging_topos (Tarquin's rigging symbols) #copy custom_entrance (Dave Clucas Theta symbol) #copy custom_LayoutAtlasLandscapeA0 #copy custom_planA0 #copy custom_standard ############################################################################################################################# layout custom_standard ##STD FORMAT SHOULD BE USED FOR ALL INITIAL SURVEYS symbol-set BCRA #legend on #legend-columns 3 #legend-width 50 cm #colour map-fg [80 80 80] #grey colour map-fg [97 93 43] #yellow color color-legend off fonts-setup 6 12 16 40 60 north grid scale-bar 100 m symbol-hide group centreline symbol-hide line border symbol-show point station:fixed symbol-colour area water [25 50 100] symbol-colour point water-flow [25 50 100] symbol-colour line water-flow [25 50 100] symbol-colour area sump [10 10 100] symbol-colour point station [100 0 0] symbol-colour line rope [100 0 0] #make rope red symbol-colour point rope [100 0 0] #make rope red statistics topo off # hiding individual survey members, replace with Tresviso Caves Project in the map-comment ### index of file options from _layouts.tex #copy custom_colorlegendbox #copy custom_legendsymbolbox ### index of file options from _layouts.mp #copy custom_border copy custom_entrance copy custom_legend_large_format_5U copy custom_flowstone copy custom_blocks copy custom_lines copy custom_water_blue copy custom_scalebar #copy custom_continuations ### index of file options from _photo_overlay.tex #copy photo_overlay #inserts Tresviso Caves Project logo and other photos #copy no_photo_overlay ### index of file options from _globallayouts.thc copy global_symbols copy global_color endlayout ############################################################################################################################# layout custom_planA0 copy custom_LayoutAtlasLandscapeA0 color map-fg altitude color-legend off legend off colour preview-below 80 colour preview-above [0 50 100] #need latest build for this to work correctly, but does not fill? grid-size 100 100 100 m grid bottom north grid statistics topo off # hiding individual survey members, replace with Tresviso Caves Project in the map-comment #code metapost #fonts_setup(0.01,0.01,0.01,6,8); ##font size 0.01 is invisible, but text still adds kilobytes to file size ##these fonts look OK unscaled code metapost fonts_setup(0.01,6,8,12,16); ##font size 0.01 is invisible, but text still adds kilobytes to file size ##these fonts look OK scaled half size,but 8,9 a bit small #CAVE APPEARANCE min-symbol-scale S #symbol-hide group all #hides ALL except passage infill colour #symbol-show line wall # gives definition if colour by altitude or map is used #Survey lines #--------- symbol-hide group cave-centreline #hides passage not yet drawn symbol-hide group surface-centreline #hides morphed sketches as well?? symbol-show point cave-station symbol-hide point section #Hiding cross sections as not done for all symbol-hide line section #labels symbol-show point label symbol-show line label symbol-show line arrow #showing arrow can look funny if smaller text hidden #symbol-hide point altitude symbol-hide point wall-altitude symbol-hide point station-name #specific station name points symbol-show point flag:continuation #this only has effect if text scale medium is visible endlayout custom_planA0 ############################################################################################################################# layout custom_LayoutAtlasLandscapeA0 #------------------------------ #NAV PANE #-------- nav-factor 30 nav-size 2 1 #PAGE LAYOUT #----------- # page-setup . set page dimensions in this order: paper-width, #paper-height, page-width, page-height, left-margin and top-margin. page-setup 118.9 84.1 115.9 81.1 1.5 1 cm overlap 1 cm #size 110 75 cm size 118.9 84.1 cm endlayout custom_LayoutAtlasLandscapeA0 ############################################################################################################################# layout custom_snow symbol-assign area snow TRESVISO code metapost initsymbol ("a_snow_TRESVISO"); def a_snow_TRESVISO (expr p) = T:=identity; thclean p; thfill p withpattern pattern_ice_AUT; pickup PenC; thdraw p; enddef; endcode endlayout ############################################################################################################################# layout custom_flowstone symbol-assign area flowstone TEST code metapost initsymbol ("a_flowstone_TEST"); beginpattern(pattern_flowstone_TEST); pickup PenC;​ p:=(-.25u,0){dir -60} .. {dir 60}(0.25u,0);​ draw p;​ draw p shifted (0.35u,0.4u);​ patternxstep(0.9u);​ patternystep(0.30u);​ endpattern; def a_flowstone_TEST (expr Path) = T:=identity;​ thclean Path;​ thfill Path withpattern pattern_flowstone_TEST;​ enddef; endcode endlayout ############################################################################################################################# layout custom_water_blue code metapost # 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; endcode endlayout ############################################################################################################################# layout custom_legend_large_format_5U code metapost % code to make the legend boxes much bigger % def draw_legend_box = %make the objects in the legend boxes bigger currentpicture := currentpicture scaled 1.7; clip currentpicture to unitsquare scaled 5u; drawoptions(); pickup PenB; draw unitsquare scaled 5u ; enddef; %clear the background of the larger legend boxes def clean_legend_box = unfill unitsquare scaled 5u; enddef; %change the value of inscale to fill the legend boxes def inscale = xscaled legend_scale yscaled (0.618*legend_scale) %xscaled legend_scale yscaled legend_scale enddef; endcode endlayout ############################################################################################################################ layout custom_scalebar #Change the scale bar to black and white bar, split into 5 and labelled 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; #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; endcode endlayout ############################################################################################################################## layout custom_continuations #this metapost for continuations makes the text appear after the ? code metapost def p_continuation(expr pos,theta,sc,al) = % draw default continuation symbol ie ? p_continuation_UIS(pos,theta,sc,al); % if text attribute is set if known(ATTR__text) and picture(ATTR__text): % set labeling color to light orange push_label_fill_color(0.8, 0.8, 0.0); % draw filled label with text next to symbol ? p_label.urt(ATTR__text,(.5u,-.25u) transformed T,0.0,8); % restore original labeling color pop_label_fill_color; fi; enddef; endcode endlayout ############################################################################################################################# layout custom_border #this draws thicker border around pdf output code tex-map \framethickness=0.5mm endcode endlayout ############################################################################################################################# layout custom_cs code tex-map \outcsname = {UTM30N} endcode endlayout ############################################################################################################################# layout custom_lines # dotted lines for offsets, arrow heads code metapost % Q = 0 -- no arrows % 1 -- end % 2 -- begin % 3 -- both def l_arrow (expr P, Q) = T:=identity; pickup PenB; thdraw P; p := (-.1u,-.5u)--(0,0)--(.1u,-.5u)--cycle; % 0.25 changed to .5 and close end to get nicer arrowhead if odd Q: thfilldraw p rotated (angle(thdir(P,0))+90) shifted (point 0 of P); fi; if Q>1: thfilldraw p rotated (angle(thdir(P,length P))-90) shifted (point infinity of P); fi; enddef; def l_mapconnection (expr P) = thdrawoptions(dashed dashpattern(on 1bp off 2bp on 1bp off 2bp) scaled (3 * optical_zoom) withpen PenB); %draw map-connection line with arrowhead at end l_arrow(P,1); %How to double or triple arrowhead size with this call? %draw dot at start of map-connection line thdraw point infinity of P withpen pencircle scaled 0.3u; %Why infinity and not 0 for dot at start of line?? %If point before arrow head, then point does not render in legend but does on map?? thdrawoptions(); enddef; #CODE TO MAKE UNSURVEYED WALL LINES LIGHT-WEIGHT AND DASHED #--------------------------------------------------------------- %Bruce Mutton 2010.06.20 for Therion 5.3.8 def l_wall_unsurveyed (expr P) = T:=identity; pickup PenC; thdraw P dashed evenly scaled (2*optical_zoom); enddef; endcode code metapost def p_camp_GFS (expr pos,r,s,al) = U:=(.4u, .5u); T:=identity aligned al scaled s shifted pos; pickup PenC; thdraw (-.5u,-.4u)--(.5u,-.4u); pickup PenD; thdraw (-.4u,-.4u)--(0,.5u)--(.4u,-.4u); thfill (-.3u,-.4u)--(0,.30u)--(.3u,-.4u)--cycle; thfill (0,.5u)--(.35u,.45u)--(.07u,.35u)--cycle; enddef; initsymbol("p_camp_GFS"); symbol-assign point camp GFS def l_u_hydro (expr P) = #Create new line for showing presumed hydrological connections on overlay (Phil Walker - 2024) T:=identity; pickup PenA scaled 2; thdraw P dashed evenly scaled (4*optical_zoom); enddef; endcode symbol-colour line u:hydro [48 84 100] #make 'presumed' hydrological connection lines blue code metapost ##break lines Select this as line type “u” with “-subtype break” in its options. ##You will also need to define it with “-clip off” in its options to allow the ends of the line to show up outside the walls. def l_u_break(expr P)= begingroup; save mainpath, parallel, orientation, direction, gapsize; T:=identity; gapsize:=u/3; path mainpath; %make the ends stick out beyond the passage mainpath:=( (point 0 of P) + u * unitvector( thdir(P, 0) rotated 180 ) / 2 ) -- P -- ( (point (length P) of P) + u * unitvector( thdir(P, arclength P) ) / 2 ); path parallel; string orientation; orientation:=if known ATTR_orientation: ATTR_orientation; else: "horizontal"; fi; if orientation = "vertical": direction:=if (xpart (point 0 of mainpath)) > (xpart (point (length mainpath) of mainpath)): 1; else: -1; fi; parallel:=mainpath shifted (0, direction * gapsize); else: direction:=if (ypart (point 0 of mainpath)) > (ypart (point (length mainpath) of mainpath)): -1; else: 1; fi; parallel:=mainpath shifted (direction * gapsize, 0); fi; if known fill_l_u_break: thfill (mainpath -- (reverse parallel) -- cycle) withcolor fill_l_u_break; else: thunfill (mainpath -- (reverse parallel) -- cycle); fi; pickup PenC; thdraw mainpath; thdraw parallel; endgroup; enddef; initsymbol("l_u_break"); def l_u_break_legend = l_wall_bedrock(((0,.2) .. controls (.3,.2) and (.4,.4) .. (.6,.4)) inscale); l_wall_bedrock(((.7,.6) .. controls (.4,.6) and (.3,.4) .. (0,.4)) inscale); l_u_break(((.6,.4) -- (.7,.6)) inscale); enddef; endcode code metapost rgbcolor fill_l_u_break; fill_l_u_break:=(1,1,1); endcode endlayout ############################################################################################################################# layout custom_rigging_topos symbol-colour line rope [100 0 0] #make rope red symbol-colour point rope [100 0 0] #make rope red ###Adding custom styled labels at any point/linepoint code metapost vardef create_styled_label (expr plaintext,P,R,S,A,defaultstyle)= save textsize, style, thetext; string textsize; if S = 0.5: textsize:="\thtinysize"; elseif S = 0.7: textsize:="\thsmallsize"; elseif S = 1.4: textsize:="\thlargesize"; elseif S = 2: textsize:="\thhugesize"; else: % normal is 1 textsize:="\thnormalsize"; fi; if known ATTR_labelstyle: style:=scantokens(ATTR_labelstyle); else: style:=defaultstyle; fi; picture thetext; thetext:=thTEX("\thframed {" & textsize & " \thfb " & plaintext & "}"); if A = (-1,1): p_label.ulft(thetext,P,R,style); elseif A = (0,1): p_label.top(thetext,P,R,style); elseif A = (1,1): p_label.urt(thetext,P,R,style); elseif A = (-1,0): p_label.lft(thetext,P,R,style); elseif A = (1,0): p_label.rt(thetext,P,R,style); elseif A = (-1,-1): p_label.llft(thetext,P,R,style); elseif A = (0,-1): p_label.bot(thetext,P,R,style); elseif A = (1,-1): p_label.lrt(thetext,P,R,style); else: p_label(thetext,P,R,style); fi; enddef; endcode #number within circle to use text en "point u:ropelength" "rope length" set the text of the label, use “-attr text 17” in its options. code metapost def p_u_ropelength (expr P,R,S,A) = T:=identity shifted P; U:=(0,0); if known ATTR_text: % approximate size (varies with proportional font) U:=(S*u*(length ATTR_text)/4,S*u*(length ATTR_text)/4); create_styled_label(ATTR_text,P,R,S,A,p_label_mode_passageheight); fi; enddef; initsymbol("p_u_ropelength"); def p_u_ropelength_legend = begingroup; save ATTR_text; string ATTR_text; ATTR_text:="12"; p_u_ropelength((.5,.5) inscale,0,1,(0,0)); endgroup; enddef; endcode #deviations code metapost def l_u_deviation (expr P) = begingroup; save ellipse; T:=identity; pickup PenC; path ellipse; ellipse:=fullcircle xscaled (.5u) yscaled (.25u) shifted (point (length P) of P); thdraw P cutafter ellipse; draw ellipse; endgroup; enddef; initsymbol("l_u_deviation"); def l_u_deviation_legend = l_u_deviation(((.1,.5)--(.8,.5)) inscale); enddef; endcode endlayout ############################################################################################################################# layout custom_entrance #Change entrance to a theta symbol (Dave Clucas 2014) code metapost def p_entrance_MY (expr pos,theta,sc,al)= U:=(.2u,.5u); T:=identity aligned al rotated theta scaled sc shifted pos; path p; p = (-.3u,-.25u) -- (-.2u,-.25u){dir 135} .. (0u, .25u) .. {dir 225}(.2u,-.25u) -- (.3u,-.25u); thdraw p withpen PenA; thdraw unitsquare scaled u shifted (-0.5u,-0.5u) rotated 45 withpen PenD; enddef; initsymbol("p_entrance_MY"); let p_entrance = p_entrance_MY; endcode endlayout ############################################################################################################################# layout custom_blocks code metapost initsymbol ("a_blocks_BCA"); def a_blocks_BCA (expr p) = T:=identity; % This is probably a better way to impliment the different sided blocks calculates the vertices of polygons %for (i = 0; i < n; i++) { % printf("%f %f\n",x + r * Math.cos(2 * Math.PI * i / n), y + r * Math.sin(2 * Math.PI * i / n)); %} boolean overlap; overlap:= if known ATTR_overlap: scantokens(ATTR_overlap) else: false fi; % Proportion to the size of separation of centres of the blocks as set out in a rectangular grid %FIXME: Really need to check if it is number and not zero in for some cases separation:= if known ATTR_separation: scantokens(ATTR_separation) else: 0.7 fi; % Max each point of the base block can be moved. Too big and they can intersect themselves block_random:= if known ATTR_block_random: scantokens(ATTR_block_random); else: 0.7 fi; % Rotation from 0 of base block, can be used to set all blocks to the same angle base_rotation:= if known ATTR_base_rotation: scantokens(ATTR_base_rotation) else: 0 fi; % Rotation either side of base rotation eg 20 will be plus or minus 10 each side random_rotation:= if known ATTR_random_rotation: scantokens(ATTR_random_rotation) else: 360 fi; % Minimum multiplier used for the base shape min_scale_factor:= if known ATTR_min_size: scantokens(ATTR_min_size) else: 0.7 fi; % Added to the minimum multiplier to get the maximum scale add_scale_factor:= if known ATTR_max_size: scantokens(ATTR_max_size) else: 0.6 fi; % How much longer the block is than it is wide, before randomising aspect:= if known ATTR_aspect: scantokens(ATTR_aspect) else: 1.5 fi; % Max random amount block can be moved from the original grid shift_random:= if known ATTR_shift_random: scantokens(ATTR_shift_random) else: 0.75 fi; % Set the propotions of different sided block if known ATTR_shapes: b_tri:=scantokens substring (0,1) of ATTR_shapes; b_quad:=scantokens substring (2,3) of ATTR_shapes; b_pent:=scantokens substring (4,5) of ATTR_shapes; b_hex:=scantokens substring (6,7) of ATTR_shapes; else: b_tri:=1; b_quad:=3; b_pent:=4; b_hex:=2; fi; pickup PenC; path q, qq; q = bbox p; pair outside; outside:= ulcorner q + up; picture tmp_pic; uu := max(u, (xpart urcorner q - xpart llcorner q)/100, (ypart urcorner q - ypart llcorner q)/100); iu := uu * aspect; blocks := b_tri+b_quad + b_pent + b_hex; tmp_pic := image( for i = xpart llcorner q step separation * aspect * uu until xpart urcorner q: for j = ypart llcorner q step separation*uu until ypart urcorner q: pick_sides := uniformdeviate(blocks); if pick_sides < b_tri: qq := punked (((.5iu,0)--(-0.25iu,.43uu)--(-.25iu,-0.43uu)--cycle) randomized (block_random * uu)) scaled (uniformdeviate(add_scale_factor)+min_scale_factor) rotated (base_rotation + random_rotation / 2 - uniformdeviate(random_rotation) ) shifted ((i,j) randomized (shift_random * uu)); elseif pick_sides < b_tri + b_quad: qq := punked (((0.5iu,0)--(0,0.5uu)--(-0.5iu,0)--(0,-0.5uu)--cycle) randomized (block_random * uu)) scaled (uniformdeviate(add_scale_factor)+min_scale_factor) rotated (base_rotation + random_rotation / 2 - uniformdeviate(random_rotation) ) shifted ((i,j) randomized (shift_random * uu)); elseif pick_sides < b_tri + b_quad + b_pent: qq := punked (((0.5iu,0)--(.15iu,0.48uu)--(-0.4iu,0.29uu)--(-0.4iu,-0.29uu)--(0.15iu,-0.48uu)--cycle) randomized (block_random * uu)) scaled (uniformdeviate(add_scale_factor)+min_scale_factor) rotated (base_rotation + random_rotation / 2 - uniformdeviate(random_rotation) ) shifted ((i,j) randomized (shift_random * uu)); else: qq := punked (((0.5iu,0)--(0.25iu,0.43uu)--(-0.25iu,0.43uu)--(-0.5iu,0)--(-0.25iu,-0.43uu)--(0.25iu,-0.43uu)--cycle) randomized (block_random * uu)) scaled (uniformdeviate(add_scale_factor)+min_scale_factor) rotated (base_rotation + random_rotation / 2 - uniformdeviate(random_rotation) ) shifted ((i,j) randomized (shift_random * uu)); fi; if not overlap: forever: % Repeatedly reduces the size of the image, as this is done round zero it also moves it to the zero location, until it fits in the area exitif xpart (p intersectiontimes qq) < 0; qq:= qq scaled (0.99 ); endfor; fi if pointinside((i,j),p,outside): thclean qq; thdraw qq; fi; endfor; endfor; ); % clip tmp_pic to p; %this appears not to be needed as the pointinside removes any outside the area drawoptions(); % no idea what this does! draw tmp_pic; enddef; endcode endlayout #############################################################################################################################