ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metapost: directionpoint gives unexpected point(?)
@ 2021-02-05 16:48 Mikael Sundqvist
  2021-02-05 16:51 ` Mikael Sundqvist
  0 siblings, 1 reply; 10+ messages in thread
From: Mikael Sundqvist @ 2021-02-05 16:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-12 10:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 16:48 Metapost: directionpoint gives unexpected point(?) Mikael Sundqvist
2021-02-05 16:51 ` Mikael Sundqvist
2021-02-11 13:45   ` Mikael Sundqvist
2021-02-11 14:54     ` Hans Hagen
2021-02-11 16:41       ` Mikael Sundqvist
2021-02-12  8:35         ` Taco Hoekwater
2021-02-12  9:31           ` Mikael Sundqvist
2021-02-12  9:55             ` Taco Hoekwater
2021-02-12  9:53           ` Hans Hagen
2021-02-12 10:03             ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).