From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15365 invoked from network); 5 Jan 2024 09:00:39 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 5 Jan 2024 09:00:39 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E1F8B483E84 for ; Fri, 5 Jan 2024 09:59:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iDoyrAZiAKNp for ; Fri, 5 Jan 2024 09:59:16 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 2FBB9483F61 for ; Fri, 5 Jan 2024 09:57:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 393DD483C75 for ; Fri, 5 Jan 2024 09:57:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G3kueptdPOIu for ; Fri, 5 Jan 2024 09:57:06 +0100 (CET) Received: from outbound00.knthost.com (outbound00.knthost.com [45.13.66.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 595B1483C73 for ; Fri, 5 Jan 2024 09:57:06 +0100 (CET) Date: Fri, 5 Jan 2024 09:56:52 +0100 DKIM-Filter: OpenDKIM Filter v2.10.3 outbound00.knthost.com C445770B25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=labonneheure.ch; s=default; t=1704445012; bh=GBugI01II/xmgf6/aAmZLKRI+Z3EcHBdk2dzjmXpJ88=; h=Date:From:To:Subject; b=exaihWG26zCGyP55YpXpzAWStjgX0/bfnKsV/IskfRD7i3fMzBz+zuNSnHKEfgqQi 1YWstbwh7ehqsH/aoZtrV3V95j0VegZzc78SIN/I30UFc9+Edi4lx6eA3c6Lekyp5t wIZLETB315wOGqg8J2MO4pPZEYTSDP4wNbMsmAgNS2JQhgfAP7vziYhOomItAc5gtq 1Cpuv8i9P10x9gNGTxwpODhj+15BhZ+30R3UIH8fL9AWJZtojIjo7Fw1pQMbnZzU9c n3F+5LF8GEMjWHMB4eTnjxr7ULsxDfDsOfptTzhOKSOf5qcDYtYyqg2eMMhF0JtsuR Ri7UPXq9lXleQ== To: "=?utf-8?Q?ntg-context=40ntg.nl?=" Message-ID: <1995622A-7289-4011-97AF-C974A440AC2B@getmailspring.com> X-Mailer: Mailspring MIME-Version: 1.0 Message-ID-Hash: WJ3HYQDNX7KL3T2KI6LKSV5UODQ4K2FF X-Message-ID-Hash: WJ3HYQDNX7KL3T2KI6LKSV5UODQ4K2FF X-MailFrom: emanuel@labonneheure.ch X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Metapost: draw only subpath; changing thickness of line List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Emanuel Han via ntg-context Cc: Emanuel Han Content-Type: multipart/mixed; boundary="===============3429692030887871374==" --===============3429692030887871374== Content-Type: multipart/alternative; boundary="6597c454_6b8b4567_133ae" --6597c454_6b8b4567_133ae Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I have this MWE. Now I want to draw only the subpath of S between gong6 and gong7 with a red line which is narrower at the two ends and thicker in the middle part. How to achieve this? Thanks! Emanuel \setuppapersize[A4,landscape] \starttext \startMPcode numeric u; u=1cm; %equiangular spiral numeric a, k ; a = 2.3; %scaling factor k = 8.61722335; path S; S = right for t=1 upto 360: .. a ** (t/50.2) * dir (-k*t) endfor; draw S; z1 = 8 dir -14; path A; A = origin -- z1 scaled 0.7u ; draw A; pair AEndPoint; AEndPoint = point 1 of A; pair gong[], times; numeric n; n = 0; for i = 1 upto length(A): for j = 1 upto length(S): times := subpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S; if xpart times > -1: gong[incr n] = 1/2[point xpart times of subpath (i-1,i) of A, point ypart times of subpath (j-1,j) of S]; fi endfor endfor dotlabel.rt ("$gong6$", gong6); dotlabel.rt ("$gong7$", gong7); %Now I want to draw only the subpath of S between gong6 and gong7 with a red line which is narrower at the two ends and thicker in the middle part \stopMPcode \stoptext --6597c454_6b8b4567_133ae Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi all,

I have this MWE. Now I want to draw only the = subpath of S between gong6 and gong7 with a red line which is narrower at= the two ends and thicker in the middle part. How to achieve this=3F
Thanks=21
Emanuel

=5Csetuppapersize=5BA= 4,landscape=5D

=5Cstarttext

=5CstartMPcode
numeric u; u=3D1cm;
%equiangular spiral
numer= ic a, k ;
a =3D 2.3; %scaling factor
k =3D 8.6172233= 5;
path S;
S =3D right for t=3D1 upto 360: .. a ** = (t/50.2) * dir (-k*t) endfor;
draw S;

z1 =3D 8 di= r -14;
path A; A =3D origin -- z1 scaled 0.7u ; draw A;
pair AEndPoint; AEndPoint =3D point 1 of A;
pair gong=5B=5D,= times; numeric n; n =3D 0;
for i =3D 1 upto length(A):
 for j =3D 1 upto length(S):
   times :=3D su= bpath (i-1,i) of A intersectiontimes subpath (j-1,j) of S;
&nbs= p;  if xpart times > -1:
     gong=5B= incr n=5D =3D 1/2=5Bpoint xpart times of subpath (i-1,i) of A,
=             &= nbsp;        point ypart times of subp= ath (j-1,j) of S=5D;
  fi
 endfor
endfor
dotlabel.rt (=22=24gong6=24=22, gong6);
= dotlabel.rt (=22=24gong7=24=22, gong7);

%Now I want to draw= only the subpath of S between gong6 and gong7 with a red line which is n= arrower at the two ends and thicker in the middle part

=5Cs= topMPcode

=5Cstoptext
--6597c454_6b8b4567_133ae-- --===============3429692030887871374== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============3429692030887871374==--