[Therion] metapost
Tarquin Wilton-Jones
tarquin.wilton-jones at ntlworld.com
Thu Oct 9 17:54:12 CEST 2025
Hi Yann,
> - Is it possible to modifiy in metapost the line which is dessined into
> 2 *points* map-connection ?:
Yes, absolutely. You add a point map-connection, but Therion actually
draws a mapconnection *line*. So you need to define:
l_mapconnection_YOURNAME
then in your layout, you use:
symbol-assign line map-connection YOURNAME
In your metapost, you will have something like this:
def l_mapconnection_YOURNAME (expr P) =
... code here...
enddef;
initsymbol("l_mapconnection_YOURNAME");
It is quite a complicated one to draw, because you need to draw the line
(just like any other line in metapost) like this:
thdraw P withpen PenA;
*BUT* you also need to draw the arrowheads if you want them, and you
probably don't want the ends of the line to poke out the ends of the
arrowheads. So you need to shorten the path by the correct amount at
each end, to allow space for the arrowheads. I do that with this command:
thdraw ( subpath( arctime 0.4u of P, arctime ( ( arclength P ) - 0.4u )
of P ) of P ) withpen PenA;
Then you need to thfill the arrowheads with whatever shape you choose.
I have done this in the survey of Pwll Dwfn, using a hack that allows
you to choose from one of several colours, so different arrows can have
different colours (this allowed us to show "the red route through the
cave"). If you wanted to see it, it's here, but I warn you that it's a
bit more complex than you probably want, because of the hack:
https://www.cavinguk.co.uk/pwlldwfn/pwlldwfn.zip
/therion/symbols/l_mapconnection_MY.th
/therion/configuration/layouts.th
The hack needs you to create two points:
point mapconnection etc
point u:mapconnectiondata -attr theme 2
Sorry it is not a very simple example.
Tarquin
More information about the Therion
mailing list