diagrams / diagrams-contrib

User-contributed extensions to diagrams
BSD 3-Clause "New" or "Revised" License
27 stars 31 forks source link

Metafont velocity function #50

Closed kuribas closed 8 years ago

kuribas commented 9 years ago

I found out by spending to long time debugging, that metafont has set 4 as an upper limit to the velocity function. I compared my code with yours, and I found that your code doesn't have the limit either (if I am not mistaken).

bergey commented 9 years ago

Yes, I remember that. I figured most users wouldn't be trying to precisely duplicate Metafont's behavior, and that magic constants cause more confusion. But if you think it's important, I'll merge a PR.

kuribas commented 9 years ago

Why do you think the constants cause confusion? This constant would prevent control points from becoming arbitrarily large, since it limits the size of the control points to 16/3 times the length between the endpoints. I try to maintain compatibility with metafont. I think it is beneficial for users when the hobby splines are consistent across implementations. And Prof. Knuth must have had a good reason to use these.

bergey commented 9 years ago

Your geometric interpretation of keeping the control points "near" the endpoints makes sense. I can see how that would make the system more pleasant to use.

I like to think that if Knuth had a good reason for this limit, he would have included it in the copious documentation of Metapost. My point was that in general, I get confused, and I see others confused, when changing the input doesn't change the output at all.

But as I said, I don't feel too strongly about this either way. I'm happy to merge a PR; I'm unlikely to make time to change this myself unless it's causing someone a real problem.

On Fri, May 1, 2015, at 07:11 PM, Kristof Bastiaensen wrote:

Why do you think the constants cause confusion? This constant would prevent control points from becoming arbitrarily large, since it limits the size of the control points to 16/3 times the length between the endpoints. I try to maintain compatibility with metafont. I think it is beneficial for users when the hobby splines are consistent across implementations. And Prof. Knuth must have had a good reason to use these.

— Reply to this email directly or view it on GitHub[1].

Links:

  1. https://github.com/diagrams/diagrams-contrib/issues/50#issuecomment-98259453
kuribas commented 9 years ago

Are you referring to the tension-limit of 3/4?

I think the idea is:

I don't feel strongly about it either. Though I do think that having consistent implementations is a good thing.