The code below shows a cyclic path that I am interested in creating
(it is in red if you run the code). The example works fine as long as
I have, u:=1cm, as in the code below. But if I replace it by ,
u:=0.6cm, there is no output. There is an error saying that paths 4
and 3 do not intersect. Is this a bug?

Thanks for your help.

\setuppapersize[letter][letter]
\setuplayout[leftedge=0in,leftmargin=1in,leftmargindistance=0in,rightmargin=1in,rightmargindistance=0in,rightedge=0in,leftedgedistance=0in,rightedgedistance=0in,topspace=0.5in,width=6.5in,height=10in]

\setupcolors[state=start]


\starttext

\startuseMPgraphic{buildS22}
        numeric u;
        u := 1cm;
        w:= 2pt;
        path xaxis; path yaxis;
        xaxis := (0,0)--(12,0) scaled u;
        yaxis := (0,0)--(0,12) scaled u;
        path stLine;
        path Curve;
        stLine :=
                        function (1,"x","10-x",0,10,1) scaled u;
        Curve :=
                        function(1,"x","2+8/x",1,10,0.1) scaled u;
        drawarrow xaxis withpen pencircle scaled w;
        drawarrow yaxis withpen pencircle scaled w;     
        draw stLine withpen pencircle scaled w withcolor 0.5red;
        draw Curve withpen pencircle scaled w withcolor 0.5green;
        pair Lint[];
        Lint[1]:=yaxis intersectionpoint stLine;
        Lint[2]:=stLine intersectionpoint Curve;
        Lint[3]:=reverse stLine intersectionpoint Curve;
        Lint[4]:=stLine intersectionpoint xaxis;
        path cyclicPath;
        cyclicPath := buildcycle(Lint[1]--Lint[2],Curve,Lint[3]--Lint[4],reverse
xaxis,yaxis);
        draw cyclicPath withpen pencircle scaled 5pt withcolor red;
\stopuseMPgraphic
\useMPgraphic{buildS22}

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to