ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metapost - Seems like weird behavior. Is it a bug?
@ 2009-11-25  4:45 Curiouslearn
  2009-11-25  7:13 ` luigi scarso
  0 siblings, 1 reply; 6+ messages in thread
From: Curiouslearn @ 2009-11-25  4:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

end of thread, other threads:[~2009-11-25 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-25  4:45 Metapost - Seems like weird behavior. Is it a bug? Curiouslearn
2009-11-25  7:13 ` luigi scarso
2009-11-25  7:41   ` Taco Hoekwater
2009-11-25  7:47     ` Taco Hoekwater
2009-11-25 16:24       ` Curiouslearn
2009-11-25 16:58         ` Taco Hoekwater

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).