<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">;) it is in normal distribution </div><div class=""><br class=""></div><div class=""><img height="247" width="247" apple-width="yes" apple-height="yes" apple-inline="yes" id="344756FE-1018-418D-9B1B-E6AD2832842C" src="cid:900BEE6F-B01F-4737-8725-98D3AEABF6BA" class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><img height="290" width="241" apple-width="yes" apple-height="yes" apple-inline="yes" id="7630E031-2320-4A29-ACD8-A3411768416B" src="cid:07D6EBBD-0C04-45E0-902C-FA4D15591E41" class=""></div><div class=""><br class=""></div><div class=""><img height="350" width="315" apple-width="yes" apple-height="yes" apple-inline="yes" id="2D134583-B1CF-4620-B07A-0CF995C1554C" src="cid:AFA6F378-A1DE-4481-AC5B-5E118F50E651" class=""></div><div class=""><br class=""></div><div class="">code metapost</div><div class=""><br class=""></div>def l_u_steps (expr P) =<br class=""> if known ATTR_c: c := scantokens ATTR_c; else: c := 2; fi;<br class=""> if ATTR__elevation:<br class="">   if (c < 2):<br class="">     thwarning("Invalid stairs definition (c<2)");<br class="">     pickup PenA;<br class="">     draw P withcolor red;<br class="">   else:<br class="">     path PP;<br class="">     if (ypart point 0 of P) < (ypart point length P of P):<br class="">       PP := P;<br class="">     else:<br class="">       PP := reverse P;<br class="">     fi;<br class="">     path p;     <br class="">     for j:=0 upto ((length PP) - 1):<br class="">       p := (point j of PP) -- (point (j + 1) of PP);<br class="">       c := ceiling(abs((ypart point 0 of p) - (ypart point length p of p)) / (0.2 / Scale * 72 / 2.54));  % 20 cm height<br class="">       if (c < 2): c:=2 fi;<br class="">       pair cp;<br class="">       cp = point length p of p - point 0 of p;<br class="">       dx := (xpart cp) / c;<br class="">       dy := (ypart cp) / c;<br class="">       cp := point 0 of p;<br class="">       for i:= 0 upto c - 1:<br class="">         l_border_visible(cp -- cp + (0,dy) -- cp + (dx,dy));<br class="">         cp := cp + (dx, dy);<br class="">       endfor;<br class="">       %draw P;<br class="">     endfor;<br class="">   fi;<br class=""> else: <br class="">   if known ATTR_l: l := scantokens ATTR_l; else: l := (length(P)-2)/2; fi;<br class="">   if ((length(P) < 4) or (c < 2)) or ((odd length P) and (not known ATTR_l)):<br class="">     thwarning("Invalid stairs definition (l) " if c<2: &" (c<2)" fi);<br class="">     pickup PenA;<br class="">     draw P withcolor red;<br class="">   else:<br class="">     thclean P -- cycle;<br class="">     path p, q;<br class="">     p = subpath (1, 1+l) of P;<br class="">     q = reverse subpath (l+2, length(P)) of P;<br class="">     lp := arclength(p);<br class="">     lq := arclength(q);<br class="">     for i=1 upto c:<br class="">       l_border_visible(point(arctime ((i-1)/(c-1)*lp) of p) of p --<br class="">point(arctime ((i-1)/(c-1)*lq) of q) of q);<br class="">     endfor;<br class="">     l_border_visible(p);<br class="">     l_border_visible(q);<br class="">     drawoptions(withcolor 0.3*white);<br class="">     %p_label(decimal c, point 0.5 of P, 0, 6);<br class="">     drawoptions();<br class="">   fi;<br class=""> fi;<br class="">enddef;<div class=""><br class=""></div><div class="">endcode</div><div class=""><br class=""></div><div class="">m.<br class=""><br class=""><blockquote type="cite" class="">24. 1. 2017 v 23:51, Benedikt Hallinger via Therion <<a href="mailto:therion@speleo.sk" class="">therion@speleo.sk</a>>:<br class=""><br class="">Hello,<br class="">i get gray hair with metapost while i want to make a line symbol for ladders, so i can nicely draw them in my maps as the cave have alot of them.<br class=""><br class="">The basic idea i had was, t define a symbol of one "rung" segment (rung and a little of either sides, like the letter "H") as a symbol picture. Then i wanted to apply this image seamlessly over the length of the given path (straight lines)<br class="">What i have for now is the following, however it does not show at all (still shows a red line with symbol set AUT in effect), so i have no clue how to even debug this.<br class=""><br class="">I tried to start with the example from thbook salted a little with peeks to the internal metapost codes.<br class=""><br class="">Can someone assist please?<br class=""><br class="">Thank you very much!<br class=""><br class=""><br class=""># Symbol for fixed ladder<br class="">   def l_fixedladder_SKBB (expr P) =<br class="">     T:=identity;<br class="">     cas := 0;<br class="">     dlzka := arclength P;<br class="">     mojkrok:=adjust_step(dlzka, 1.0u);<br class=""><br class="">     pickup PenC;<br class="">     sideL := (-.20u,0)--(-.20u,0.20u);<br class="">     sideR := (.20u,0)--(.20u,0.20u);<br class="">     rung  := (-.20u,0.10u)--(.20u,0.10u);<br class=""><br class="">     picture symbol,test_symbol;<br class="">     symbol:= image (<br class="">                thdraw sideL;<br class="">                thdraw sideR;<br class="">                thdraw rung;<br class="">                );<br class=""><br class="">     forever:<br class="">           t := arctime cas of P;<br class="">           thdraw symbol shifted (point t of P) withcolor black;<br class="">           cas := cas + mojkrok;<br class="">           exitif cas > dlzka + (mojkrok / 3); % for rounding errors<br class="">     endfor;<br class=""><br class="">   enddef;<br class=""><br class="">_______________________________________________<br class="">Therion mailing list<br class=""><a href="mailto:Therion@speleo.sk" class="">Therion@speleo.sk</a><br class="">https://mailman.speleo.sk/listinfo/therion<br class=""></blockquote><br class=""></div></body></html>