<div dir="ltr"><div>Hi Tarquin and Bruce</div><div><br></div><div>Thanks a lot for your answer, it work great</div><div><br></div><div>Finaly i use this, for a dashed line with circle at 0 and infinity point (not try arrows)</div><div><br></div><div>def l_mapconnection_REDESSINE (expr P) =<br> T:=identity;<br> pickup pencircle scaled 2;<br> thdraw P dashed evenly scaled optical_zoom withcolor (0.4, 0.4, 0.4);<br> thdraw point infinity of P withpen pencircle scaled 0.4u;<br> thdraw point 0 of P withpen pencircle scaled 0.4u;<br>enddef;<br>initsymbol("l_mapconnection_REDESSINE");<br>symbol-assign line map-connection REDESSINE</div><div><br></div><div><img src="cid:ii_mgkzjc4a1" alt="3.png" width="562" height="309"><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le jeu. 9 oct. 2025 à 20:36, <<a href="mailto:bruce@tomo.co.nz">bruce@tomo.co.nz</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-1248157160633644092"><div lang="EN-NZ" style="overflow-wrap: break-word;"><div class="m_-1248157160633644092WordSection1"><div><div><p class="MsoNormal">- Is it possible to modifiy in metapost the line which is dessined into 2 <b>points</b> map-connection ?: <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I took what maybe a simpler approach to that Tarquin describes, minimally altering the default metapost, but adding a clear start and end point to the map-connection line.<u></u><u></u></p><p class="MsoNormal"><img width="321" height="213" style="width: 3.3472in; height: 2.2222in;" id="m_-1248157160633644092Picture_x0020_1" src="cid:ii_199ceaaccc84cff311"><u></u><u></u></p><p class="MsoNormal">What I discovered when attempting this was that arrow heads are intimately connected, in the default metapost, to map-connection lines.<u></u><u></u></p><p class="MsoNormal">The example below is complicated by a change we made to refine the alignment of arrow heads when the incoming line is curved.<u></u><u></u></p><p class="MsoNormal">If you want I could dig out the code prior to the arrow head change, but you can probably extract that from your own installation.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Bruce<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">#ARROW and MAP-CONNECTION REDEFINITIONS<u></u><u></u></p><p class="MsoNormal">#--------------------------<u></u><u></u></p><p class="MsoNormal">#Edited Bruce Mutton Apr2018 Redefinition of map-connection line and arrow heads<u></u><u></u></p><p class="MsoNormal">code metapost<u></u><u></u></p><p class="MsoNormal">% Q = 0 -- none (no arrows)<u></u><u></u></p><p class="MsoNormal">% 1 -- end (default)<u></u><u></u></p><p class="MsoNormal">% 2 -- begin<u></u><u></u></p><p class="MsoNormal">% 3 -- both<u></u><u></u></p><p class="MsoNormal">def l_arrow (expr P, Q) =<u></u><u></u></p><p class="MsoNormal">% Arrow heads rotated so that line path intersects middle of back of arrowhead. Johnny Willis 3Jun2023<u></u><u></u></p><p class="MsoNormal"> T:=identity;<u></u><u></u></p><p class="MsoNormal"> pickup PenC;<u></u><u></u></p><p class="MsoNormal"> path Pcircle_s, Pcircle_e, ah_start, ah_end, p, P_mod, errcheck;<u></u><u></u></p><p class="MsoNormal"> pair sp, ep, int_start, int_end;<u></u><u></u></p><p class="MsoNormal"> numeric alength, c_diam;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> ep = point 0 of P;<u></u><u></u></p><p class="MsoNormal"> sp = point infinity of P;<u></u><u></u></p><p class="MsoNormal"> alength = 0.5u;<u></u><u></u></p><p class="MsoNormal"> c_diam = 2*alength;<u></u><u></u></p><p class="MsoNormal"> Pcircle_s = fullcircle scaled c_diam shifted sp;<u></u><u></u></p><p class="MsoNormal"> Pcircle_e = fullcircle scaled c_diam shifted ep;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> p := (-0.1u,-alength)--(-0,0)--(.1u,-alength)--cycle;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> errcheck = (ep) -- (sp);<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">if arclength(errcheck) < alength: %if end points P shorter than arrow head, don't trim P<u></u><u></u></p><p class="MsoNormal"> int_end = ep;<u></u><u></u></p><p class="MsoNormal"> int_start = sp;<u></u><u></u></p><p class="MsoNormal"> ah_end = (sp) -- (ep);<u></u><u></u></p><p class="MsoNormal"> ah_start = (ep) -- (sp);<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">else: %set up for trimming P at back of arrowheads<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> int_end = Pcircle_e intersectionpoint P;<u></u><u></u></p><p class="MsoNormal"> int_start = Pcircle_s intersectionpoint P;<u></u><u></u></p><p class="MsoNormal"> ah_end = (int_end) -- (ep);<u></u><u></u></p><p class="MsoNormal"> ah_start = (int_start) -- (sp);<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">fi;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">if Q = 0: % -head none<u></u><u></u></p><p class="MsoNormal"> P_mod = P;<u></u><u></u></p><p class="MsoNormal">fi;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">if Q = 1: %arrow at end of line -head end<u></u><u></u></p><p class="MsoNormal"> draw p rotated (angle(thdir(ah_end,0))-90) shifted (point 0 of P);<u></u><u></u></p><p class="MsoNormal"> fill p rotated (angle(thdir(ah_end,0))-90) shifted (point 0 of P);<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> P_mod = P cutbefore int_end;<u></u><u></u></p><p class="MsoNormal">fi;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">if Q = 2: %arrow at start of line -head begin<u></u><u></u></p><p class="MsoNormal"> draw p rotated (angle(thdir(ah_start,0))-90) shifted (point infinity of P);<u></u><u></u></p><p class="MsoNormal"> fill p rotated (angle(thdir(ah_start,0))-90) shifted (point infinity of P);<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> P_mod = P cutafter int_start;<u></u><u></u></p><p class="MsoNormal">fi;<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">if Q = 3: %arrow at both ends of line -head both<u></u><u></u></p><p class="MsoNormal"> draw p rotated (angle(thdir(ah_start,0))-90) shifted (point infinity of P);<u></u><u></u></p><p class="MsoNormal"> fill p rotated (angle(thdir(ah_start,0))-90) shifted (point infinity of P);<u></u><u></u></p><p class="MsoNormal"> draw p rotated (angle(thdir(ah_end,0))-90) shifted (point 0 of P);<u></u><u></u></p><p class="MsoNormal"> fill p rotated (angle(thdir(ah_end,0))-90) shifted (point 0 of P);<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> P_mod = (P cutbefore int_end) cutafter int_start;<u></u><u></u></p><p class="MsoNormal">fi;<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> thdraw P_mod;<u></u><u></u></p><p class="MsoNormal">enddef;<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">def l_mapconnection (expr P) =<u></u><u></u></p><p class="MsoNormal"> thdrawoptions(dashed dashpattern(on 1bp off 2bp on 1bp off 2bp) <u></u><u></u></p><p class="MsoNormal"> scaled (2 * optical_zoom) withpen PenA);<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> %draw map-connection line with arrowhead at end<u></u><u></u></p><p class="MsoNormal"> l_arrow(P,1); %How to double or triple arrowhead size with this call?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> %draw dot at start of map-connection line<u></u><u></u></p><p class="MsoNormal"> thdraw point infinity of P withpen pencircle scaled 0.3u; <u></u><u></u></p><p class="MsoNormal"> %Why infinity and not 0 for start?? <u></u><u></u></p><p class="MsoNormal"> %If point before arrow head, then point does not render in legend but does on map?? <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> thdrawoptions();<u></u><u></u></p><p class="MsoNormal">enddef;<u></u><u></u></p><p class="MsoNormal">endcode<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"># and if necessary in some other layout…<u></u><u></u></p><p class="MsoNormal">symbol-colour line map-connection [54 7 60] #purple<u></u><u></u></p><p class="MsoNormal">symbol-show line map-connection<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">#And then in th-config but outside of a layout…<u></u><u></u></p><p class="MsoNormal">text en "line map-connection" "passage offset connection"<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">#END<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div>_______________________________________________<br>
Therion mailing list<br>
<a href="mailto:Therion@speleo.sk" target="_blank">Therion@speleo.sk</a><br>
<a href="https://mailman.speleo.sk/listinfo/therion" rel="noreferrer" target="_blank">https://mailman.speleo.sk/listinfo/therion</a><br>
</div></blockquote></div>