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 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…

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’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 intersection point of the edge and the folding line which bisect the angle of the former folding line [M,N].

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

Enjoy the use of “whatever”!

I made an animation of the folding process using animation module and \processMPbuffer.
But Woldgang’s 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
___________________________________________________________________________________