# 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 #legend on #legend-columns 3 #legend-width 50 cm colour map-fg [80 80 80] fonts-setup 6 12 16 40 60 north grid scale-bar 100 m symbol-hide group centreline symbol-hide line border ### 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_legend_large_format_5U copy custom_flowstone 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 #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_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 #############################################################################################################################