[NTG-context] Re: [NTG-context]metapost prblem
Severin Obertuefer [EMAIL PROTECTED] writes: thanks for your answer it works, but only with a normal circle. if the circle is xyscaled the same thing seems to bee much more complicate... here is the mp-code once again: beginfig(2); path c; pair A, B; c := fullcircle scaled 2 cm xyscaled(1.3,.8); A := (origin--(3cm,2cm)) intersectionpoint subpath (0,2) of c; B := (origin--(-5cm,1cm)) intersectionpoint subpath (2,4) of c; draw c; draw origin--B; draw origin--A; endfig; how can i clip the part of the path c between A and B in this case?? Isn't it easier to use arctime and the specify A and B as lengths instead of points? For example: A := 1cm; B := 1cm; draw subpath (arctime A of c, arctime (arclength c) - B of c) of c; The code is not tested. Regards, -- Emil Hedevang Lohse http://home.imf.au.dk/emil/ Alle spørgsmål er lige dumme. Og spørgsmålet Kan ænder flyve? er ikke dumt. ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: [NTG-context]metapost prblem
that works!! thanks for the hint severin - Original Message - From: Jens-Uwe Morawski [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 22, 2003 2:50 PM Subject: Re: [NTG-context] Re: [NTG-context]metapost prblem On Mon, 22 Sep 2003 13:37:47 +0200 (MEST) Severin Obertuefer [EMAIL PROTECTED] wrote: it works, but only with a normal circle. if the circle is xyscaled the same thing seems to bee much more complicate... here is the mp-code once again: beginfig(2); path c; pair A, B; c := fullcircle scaled 2 cm xyscaled(1.3,.8); A := (origin--(3cm,2cm)) intersectionpoint subpath (0,2) of c; B := (origin--(-5cm,1cm)) intersectionpoint subpath (2,4) of c; draw c; draw origin--B; draw origin--A; draw (c cutbefore B)--(c cutafter A) withcolor red ; endfig; Jens ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Re: [NTG-context]metapost prblem
thanks for your answer it works, but only with a normal circle. if the circle is xyscaled the same thing seems to bee much more complicate... here is the mp-code once again: beginfig(2); path c; pair A, B; c := fullcircle scaled 2 cm xyscaled(1.3,.8); A := (origin--(3cm,2cm)) intersectionpoint subpath (0,2) of c; B := (origin--(-5cm,1cm)) intersectionpoint subpath (2,4) of c; draw c; draw origin--B; draw origin--A; endfig; how can i clip the part of the path c between A and B in this case?? thanks for help severin On Sun, 21 Sep 2003 21:24:04 +0200 (MEST) Severin Obertuefer [EMAIL PROTECTED] wrote: how can I cut the the part of the path c between A and B, so that the result is like a cheese :) path cheese ; cheese := c rotated angle B ; cheese := cheese cutafter (origin--A) ; Jens ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context -- +++ GMX - die erste Adresse für Mail, Message, More! +++ Getestet von Stiftung Warentest: GMX FreeMail (GUT), GMX ProMail (GUT) (Heft 9/03 - 23 e-mail-Tarife: 6 gut, 12 befriedigend, 5 ausreichend) Jetzt selbst kostenlos testen: http://www.gmx.net ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: [NTG-context]metapost prblem
On Mon, 22 Sep 2003 13:37:47 +0200 (MEST) Severin Obertuefer [EMAIL PROTECTED] wrote: it works, but only with a normal circle. if the circle is xyscaled the same thing seems to bee much more complicate... here is the mp-code once again: beginfig(2); path c; pair A, B; c := fullcircle scaled 2 cm xyscaled(1.3,.8); A := (origin--(3cm,2cm)) intersectionpoint subpath (0,2) of c; B := (origin--(-5cm,1cm)) intersectionpoint subpath (2,4) of c; draw c; draw origin--B; draw origin--A; draw (c cutbefore B)--(c cutafter A) withcolor red ; endfig; Jens ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Re: [NTG-context]metapost prblem
On Mon, 22 Sep 2003 13:37:47 +0200 (MEST) Severin Obertuefer [EMAIL PROTECTED] wrote: it works, but only with a normal circle. if the circle is xyscaled the same thing seems to bee much more complicate... additionally, a more general solution: %%% \setupoutput[pdftex] \setupcolors[state=start] \startMPinclusions vardef cutbetween (expr p,a,b)= if (xpart (p intersectiontimes a)) (xpart (p intersectiontimes b)): ((p cutbefore b) cutafter a) else: (p cutbefore b)--(p cutafter a) fi enddef; \stopMPinclusions \starttext \startMPpage save c, A, B ; path c, A, B; A := (origin--(3cm,2cm)) ; B := (origin--(-5cm,1cm)) ; draw B ; draw A ; c := fullcircle scaled 2cm xyscaled(1.3,.8) ; clip currentpicture to c ; draw c withpen pencircle scaled 1.4pt withcolor .7white ; drawarrow cutbetween(c,B,A) withcolor .7green ; drawarrow cutbetween(c,A,B) withcolor green ; c := reverse c xyscaled (0.3,0.9) ; draw c withpen pencircle scaled 1.4pt withcolor .7white ; drawarrow cutbetween(c,B,A) withcolor .7red ; drawarrow cutbetween(c,A,B) withcolor red ; \stopMPpage \stoptext %%% Jens ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context