From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/111846 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: simplifying repeated macro calls in metafun Date: Tue, 22 Jun 2021 15:49:42 +0200 Message-ID: <903D410F-08FA-4DE4-AF01-96BAB59DF39F@gmail.com> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Content-Type: multipart/mixed; boundary="===============8583169982830467480==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40860"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 22 15:50:20 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvgnE-000ANX-Mp for gctc-ntg-context-518@m.gmane-mx.org; Tue, 22 Jun 2021 15:50:20 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1F5332849DA; Tue, 22 Jun 2021 15:49:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MmZvpW0rvCJE; Tue, 22 Jun 2021 15:49:48 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 51239284A46; Tue, 22 Jun 2021 15:49:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8D332284A42 for ; Tue, 22 Jun 2021 15:49:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zwf12q6MPpzC for ; Tue, 22 Jun 2021 15:49:45 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.49; helo=mail-wm1-f49.google.com; envelope-from=otared@gmail.com; receiver= Original-Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 129722849DA for ; Tue, 22 Jun 2021 15:49:44 +0200 (CEST) Original-Received: by mail-wm1-f49.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso1607114wmc.1 for ; Tue, 22 Jun 2021 06:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=3N14+llMwl119OeCwEkraIlFnrg+z3hvkfMUklBnE7Y=; b=Gq21QimoK7o7B5o6ErePZdheKdeZQdNTm6pxiurU09y6/QZnSkpY7lD/xEptGrFmLr Ph+X6/fJKU2MYmi6LpVlnRFvYeo4DCSpr2eifo7dLCmHHbRR1FpyFMNNpeEdXOHy9b3u LO669Nz0WqHRfTAw8I8PCXuM8YEaAOMoRL6eCyEFW+lqDwKnz6TLHDR9swT/L5EowSaj wecIgj2IuBCq8ZlP+iF6exUNmCaEqptyYUnjKietyXSw3cCS2Cl35Yzow/DU22BUh22v 2ZqyIBm9M42ZYoEWXGl812WWOHKi6C10SWhtv9A1So9sEm2ArQGghSPWAOSPBIypN4Nx ieZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=3N14+llMwl119OeCwEkraIlFnrg+z3hvkfMUklBnE7Y=; b=J8RdYo00nWjwx2Grtzuhhb/ON63hJRk5R/ermvrDqSN/mXxWNUZSbiay0IcnVbDoRv nl8vlEpkfxXe3rk+gREIeGN0J24HkA6BQwwiSec0SesG5+ih6Db1rnup/Utl4Zn+hiWD CD0dSuAB3ii+0kcLdZws55t+ywCPZq5QebTJb7WF2ixYZUd6QUkvj+mmIs8uWsQZ6ZiO rYq0AV0VW3JdCKwSl6mfjbA7Kv9jbGPB/eR7g+mNtJAmJFfLuxTgB47HPt9ehP7eP54E MWS0onH52+3wwlnOf5jRJs31Yr7eXTO2bebU2lNZU0BZL9W8RkwibUH9OlFjiwAzLp71 53Sw== X-Gm-Message-State: AOAM530He5ZLYPdNxiwUoBk3y1rnMvm8B6tW8lEXzuPl1+g15Pvy+hLD NxHt2kofBhMvoASzQJPM1D/X7MAdzgy+Mw== X-Google-Smtp-Source: ABdhPJzNIdVhs8D0AoOgINRQs3sRE/yBHeXQlSVIh1QQ0muUjtr7fy5aTBYOckKWcj0oEllaE79D1Q== X-Received: by 2002:a7b:cc09:: with SMTP id f9mr4483676wmh.104.1624369784543; Tue, 22 Jun 2021 06:49:44 -0700 (PDT) Original-Received: from pc-27.home (lfbn-orl-1-1670-151.w90-107.abo.wanadoo.fr. [90.107.218.151]) by smtp.gmail.com with ESMTPSA id o203sm2682859wmo.36.2021.06.22.06.49.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jun 2021 06:49:43 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.60.0.2.21) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:111846 Archived-At: --===============8583169982830467480== Content-Type: multipart/alternative; boundary="Apple-Mail=_7485FD21-5A79-4910-8E4C-62683DFCC941" --Apple-Mail=_7485FD21-5A79-4910-8E4C-62683DFCC941 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Dalyoung, dear Mikael Thank you both for your explanations: indeed this =C2=AB whatever =C2=BB = command in MetaPost is magic and very useful (I am not sure whether it = is a command only in MetaFun, or it exists also in the original = MetaPost). Regarding the way Aditya uses \startuseMPgraphic, it is also very = instructive.=20 Dalyoung, can you also share the animation example for the foldings ? I = am sure we are a few on the list to learn something=E2=80=A6 Best regards: Otared > On 21 Jun 2021, at 23:50, Jeong Dal wrote: >=20 >=20 > Dear Otared, >=20 > I received list mail in condensed form, I didn=E2=80=99t see your mail = before I sent one. >=20 > As Mikael explained, =E2=80=9Cwhatever=E2=80=9D is very nice to find = the intersection point of two lines. > You can see nice examples which use =E2=80=9Cwhatever=E2=80=9D in = MetaFun manual. >=20 > In my code, the next point is the intersection point of the edge and = the folding line which bisect the angle of the former folding line = [M,N]. >=20 > H :=3D whatever[N, N + dir(.5*angle(M-N))*u] =3D whatever[A,B]; >=20 > Enjoy the use of =E2=80=9Cwhatever=E2=80=9D! >=20 > I made an animation of the folding process using animation module and = \processMPbuffer. > But Woldgang=E2=80=99s code showed a way to make it using = \startuseMPgraphic. >=20 >=20 > Best regards, >=20 > Dalyoung > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_7485FD21-5A79-4910-8E4C-62683DFCC941 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = Dalyoung, dear Mikael

Thank you both for your explanations: indeed this =C2=AB = whatever =C2=BB command in MetaPost is magic and very useful (I am not = sure whether it is a command only in MetaFun, or it exists also in the = original MetaPost).

Regarding the way Aditya uses \startuseMPgraphic, it is also = very instructive. 
Dalyoung, can you also = share the animation example for the foldings ? I am sure we are a few on = the list to learn something=E2=80=A6

Best regards: Otared

On 21 Jun 2021, at 23:50, Jeong Dal <haksan@me.com> = wrote:


Dear Otared,

I received list mail in condensed form, I didn=E2=80=99t see = your mail before I sent one.

As Mikael explained, =E2=80=9Cwhatever=E2= =80=9D is very nice to find the intersection point of two = lines.
You can see nice examples which use = =E2=80=9Cwhatever=E2=80=9D in MetaFun manual.

In my code, the next point is the = intersection point of the edge and the folding line which bisect the = angle of the former folding line [M,N].

H :=3D whatever[N, N = + dir(.5*angle(M-N))*u] =3D whatever[A,B];

Enjoy the use = of =E2=80=9Cwhatever=E2=80=9D!

I made an = animation of the folding process using animation module and = \processMPbuffer.
But Woldgang=E2=80=99s code = showed a way to make it using \startuseMPgraphic.


Best = regards,

Dalyoung
____________________________________= _______________________________________________
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
_______________________________________________________________= ____________________

= --Apple-Mail=_7485FD21-5A79-4910-8E4C-62683DFCC941-- --===============8583169982830467480== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8583169982830467480==--