[NTG-context] Metapost: directionpoint gives unexpected point(?)
Mikael Sundqvist
mickep at gmail.com
Fri Feb 5 17:48:20 CET 2021
Hi,
I get sometimes the wrong directionpoint. In the example below it
works for all values of direx except between 0 and 90. If I put direx
to something in this interval, it seems that the point between cs and
cl are chosen.
Is there a better way to construct the paths not to get this problem?
Or some other way out?
/Mikael
\starttext
\startMPpage[offset=3bp]
u:=1cm;
path cl,cs,rl,p[];
z0 = (0,6/sqrt(3)*u);
z1 = z0 rotated 120;
cs := (fullcircle scaled 16u) shifted z1;
cs := cs cutafter point 1/6 along cs;
cl := (fullcircle scaled 4u) shifted z0;
cl := cl cutbefore point 1/6 along cl cutafter point 2/6 along cl;
p[0] = cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated
240) .. (cl rotated 240) .. cycle;
draw p[0];
drawarrow cs withcolor darkblue;
drawarrow cl withcolor darkred;
direx=300;
z11=directionpoint dir(direx) of p[0];
drawarrow ((-u,0)--(u,0)) rotated direx shifted z11;
\stopMPpage
\stoptext
More information about the ntg-context
mailing list