#Layouts to be used accross the Farnsley Lane surveys ############################################################################################################################# layout Main_layout symbol-set BCRA legend off symbol-hide group centerline symbol-hide point station debug off scale 1 100 code metapost #Sets font sizes for xs,s,m,l,xl text fonts_setup( 12, 14, 20, 30, 46 ); ##### #Nicer scalebar 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; ##### #Symbol adding or changing symbol-assign area clay Dense initsymbol("a_clay_Dense"); initsymbol ("a_blocks_TEST"); initsymbol("l_u_shuttering"); def l_wall_unsurveyed (expr P) = T:=identity; pickup PenC; thdraw P dashed evenly scaled (2*optical_zoom); enddef; def a_pebbles (expr p) = T:=identity; pickup PenC; path q, qq; q = bbox p; picture tmp_pic; tmp_pic := image( for i = xpart llcorner q step 0.55u until xpart urcorner q: for j = ypart llcorner q step 0.55u until ypart urcorner q: qq := (superellipse((.2u,0),(0,.1u),(-.2u,0),(0,.-.1u),.75)) % randomized (u/25) rotated uniformdeviate(360) shifted ((i,j) randomized 0.7u); if xpart (p intersectiontimes qq) < 0: thdraw qq; fi; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef; def a_clay_Dense (expr p) = T:=identity; pickup PenD; path q, qq; q = bbox p; picture tmp_pic; tmp_pic := image( for i = xpart llcorner q step 0.5u until xpart urcorner q: for j = ypart llcorner q step 0.5u until ypart urcorner q: qq := ((-.20u,0){up}..origin{down}..{up}(0.20u,0)) randomized (u/15) shifted ((i,j) randomized 0.3u); if xpart (p intersectiontimes qq) < 0: thdraw qq; fi; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef; def a_blocks_TEST (expr p) = T:=identity; symbol_distance:=0.7; scale_factor:= 0.001; 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); tmp_pic := image( for i = xpart llcorner q step symbol_distance*uu until xpart urcorner q: for j = ypart llcorner q step symbol_distance*uu until ypart urcorner q: qq := punked (((-.5uu,-.5uu)--(.5uu,-.5uu)--(1.05uu,0.05uu)--(.5uu,.5uu)--(-.5uu,.5uu)--cycle) randomized (uu/2)) scaled (uniformdeviate(0.7)+scale_factor ) rotated uniformdeviate(360) shifted ((i,j) randomized 0.75uu); if xpart (p intersectiontimes qq) < 0: if pointinside((i,j),p,outside): thclean qq; thdraw qq; fi; else: qq:= qq scaled (uniformdeviate(.2)+.5 ) if xpart (p intersectiontimes qq) < 0: if pointinside((i,j),p,outside): thclean qq; thdraw qq; fi; fi; fi; endfor; endfor; ); clip tmp_pic to p; drawoptions(); draw tmp_pic; enddef; def l_u_shuttering (expr P)= begingroup; save pathlength, athick, cthick, linegap, testdiameter, testpath, innerpath, newpoint, curlength, intersections, samplepoint, accuracy, dashes, chosenpattern; T:=identity; % main wall line thdraw P withpen PenC; % work out a parallel path % the easy way is to sample direction every few units, and add a parallel point into a new path % however, this causes weird loops at sharp corners, so check if a sharp corner is coming up within % the length of the gap between lines, and ignore that point if so pathlength:=arclength P; % gap between the main line and dashed line if known ATTR_linegap: linegap:=scantokens(ATTR_linegap) * u; else: linegap:=0.075u; fi; % how tightly should the dashed line follow curves and corners - higher numbers take more time to process if known ATTR_accuracy: accuracy:=scantokens(ATTR_accuracy); else: accuracy:=4; fi; athick:=(xpart (lrcorner PenA)) - (xpart (llcorner PenA)); cthick:=(xpart (lrcorner PenC)) - (xpart (llcorner PenC)); testdiameter:=athick + cthick + 2*linegap; path testpath; testpath:=halfcircle scaled testdiameter shifted (0,athick/2); pair newpoint; path innerpath; pair intersections; curlength:=0; forever: samplepoint:=arctime curlength of P; % every now and then along the line, place a semicircle, rotated to face away from the line, offset by the thickness of the line, % with a radius the same as the gap between the lines - if its ends touch the main line's centre, the corner is too sharp to use % this point intersections:=P intersectiontimes (testpath rotated (angle thdir(P,samplepoint)) shifted (point samplepoint of P)); % if there are no intersections, intersectiontimes returns (-1,-1), otherwise it returns the distance along each path (P,testpath) % where the intersection happened >=0 % enable for debugging %if (xpart intersections) = -1: % thdraw testpath rotated (angle thdir(P,samplepoint)) shifted (point samplepoint of P) withpen (pencircle scaled 0.01u) withcolor .7; %else: % thdraw testpath rotated (angle thdir(P,samplepoint)) shifted (point samplepoint of P) withpen (pencircle scaled 0.01u) withcolor (100*(xpart intersections)/(arclength P),100*(ypart intersections)/(arclength testpath),0); %fi; if (xpart intersections) = -1: newpoint:=((point samplepoint of P) shifted (linegap * unitvector(thdir(P,samplepoint) rotated 90))); % enable for debugging %thdraw newpoint withcolor (0,0,100) withpen PenC; if known innerpath: innerpath:=innerpath .. newpoint{thdir(P,samplepoint)}; else: innerpath:=newpoint{thdir(P,samplepoint)}; fi; fi; exitif curlength = pathlength; % move in small steps, to take account of tight backwards curves, and to get points near a corner curlength:=curlength + testdiameter/accuracy; if curlength > pathlength: curlength:=pathlength; fi; endfor; if known innerpath: if cycle P: innerpath:=innerpath .. cycle; fi; string dashes; if known ATTR_dashes: dashes:=ATTR_dashes; else: dashes:="dashdotdot"; fi; picture chosenpattern; if dashes = "dashed": chosenpattern:=evenly; elseif dashes = "dotted": chosenpattern:=withdots; elseif dashes = "dashdot": chosenpattern:=dashpattern(on 3*cthick off 3*cthick on 0 off 3*cthick); elseif dashes = "dashdashdotdot": chosenpattern:=dashpattern(on 3*cthick off 3*cthick on 3*cthick off 3*cthick on 0 off 3*cthick on 0 off 3*cthick); else: chosenpattern:=dashpattern(on 3*cthick off 3*cthick on 0 off 3*cthick on 0 off 3*cthick); fi; thdraw innerpath dashed chosenpattern withpen PenC; fi; endgroup; enddef; endlayout ############################################ #Specific output styles layout 400scale scale 1 400 min-symbol-scale s endlayout #### layout elevation_colour colour map-fg altitude #[97 93 43] endlayout layout colour symbol-colour point water-flow [25 50 100] symbol-colour point water-drip [25 50 100] code metapost def a_water (expr p) = T:=identity; thfill p withcolor (0.48, 0.84, 1.0); enddef; def a_sump (expr p) = T:=identity; thfill p withcolor (0.05, 0.0, 0.7); enddef; endcode endlayout layout empty_header code tex-map \legendtitle={} \cavename={} \scalebarfalse \cavelengthtitle={} \cavelength={} \cavedepthtitle={} \cavedepth={} endcode endlayout