Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-25 Thread Jeong Dal
Dear Aditya, > A while back, I wrote some code to easily generate metapost animations. > > https://adityam.github.io/context-blog/post/metapost-animation/ > > I haven't used it much because I am mostly on linux, and its is a PITA to get > an older version of Adobe Reader to work under wine.

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-24 Thread Hans Hagen
On 6/24/2021 5:42 AM, Aditya Mahajan wrote: On Wed, 23 Jun 2021, Aditya Mahajan wrote: On Thu, 24 Jun 2021, Jeong Dal wrote: Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t the correct result yet. Using \startuseMPgraphic, and \dorecurse, the code is simpler.

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-23 Thread Aditya Mahajan
On Wed, 23 Jun 2021, Aditya Mahajan wrote: > On Thu, 24 Jun 2021, Jeong Dal wrote: > > > Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t > > the correct result yet. > > Using \startuseMPgraphic, and \dorecurse, the code is simpler. But, it > > seems to me that

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-23 Thread Aditya Mahajan
On Thu, 24 Jun 2021, Jeong Dal wrote: > Now, I am trying to do the same thing using \startuseMPgraphic, but I don’t > the correct result yet. > Using \startuseMPgraphic, and \dorecurse, the code is simpler. But, it seems > to me that \startanimation … \stopanimation is not working with >

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-23 Thread Jeong Dal
Dear Otared, > > 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… > 1. Here is the working sample of animation using

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-22 Thread Wolfgang Schuster
Otared Kavian schrieb am 22.06.2021 um 15:49: Dear Dalyoung, dear Mikael Thank you both for your explanations: indeed this « whatever » 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). You have

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-22 Thread Otared Kavian
Dear Dalyoung, dear Mikael Thank you both for your explanations: indeed this « whatever » 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

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-21 Thread Jeong Dal
Dear Otared, I received list mail in condensed form, I didn’t see your mail before I sent one. As Mikael explained, “whatever” is very nice to find the intersection point of two lines. You can see nice examples which use “whatever” in MetaFun manual. In my code, the next point is the

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-21 Thread Mikael Sundqvist
Hi, yes, sure, I should have copied my code from the geometry document where I do this kind of constructions over and over... /Mikael On Mon, Jun 21, 2021 at 4:31 PM Otared Kavian wrote: > > Hi Mikael, > > Thank you so much for the explanation: I am ashamed for not having read this > in the

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-21 Thread Jeong Dal
Dear Aditya, Your code works perfectly. Thank you for your help. 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 /

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-21 Thread Otared Kavian
Hi Mikael, Thank you so much for the explanation: I am ashamed for not having read this in the MetaPost manual. Just to make sure whether I am beginning to understand, in your example code > z3 = whatever[z1,z2] = z0+whatever*dir(angle(z1-z0)+90)); should the second « whatever » be z0 +

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-21 Thread Mikael Sundqvist
Hi, As is written in the MetaPost manual: Whatever generates a new anonymous variable each time it is used. It is very useful in cases where you are not interested in the value of a variable, but want to use it to (let MP) calculate something. Example you have three points z0, z1, z2 forming a

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-21 Thread Otared Kavian
Hi Aditya, Thanks for the detailed file you sent to answer Dalyoung’s question and file. And going through both files I have a question. I see that both of you use a function « whatever » (but is it a function ?): what does this do and where can it be used (actually I have seen Hans using this

Re: [NTG-context] simplifying repeated macro calls in metafun

2021-06-20 Thread Aditya Mahajan
On Mon, 21 Jun 2021, Jeong Dal wrote: > > Hi, > > I defined a macro definition in metafun, and draw figures using > \startbuffer[] … \stopbuffer and \processMPbuffer[]. > As you see in the attached code, the same macro definition is used repeatedly > by changing the numeric argument. > Is

[NTG-context] simplifying repeated macro calls in metafun

2021-06-20 Thread Jeong Dal
Hi, I defined a macro definition in metafun, and draw figures using \startbuffer[] … \stopbuffer and \processMPbuffer[]. As you see in the attached code, the same macro definition is used repeatedly by changing the numeric argument. Is there a better way to simplify the code, for example,