Better HN
topnewbestaskshowjobs
Log inSign up

raphlinus

14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions

I do research on fundamental UI technology and 2D graphics, with a focus on Rust and fonts. @raph@mastodon.online
Submissions

comment 7y ago · link · parent

I have done this, and just for reference, my Patreon currently brings in $203/month. I am very grateful to my supporters, but making this scale doesn't look easy.

comment 7y ago · link · parent

I'm with you. It would have to be well-run and not toxic, which is not the default in open-source, sadly. Perhaps I'm thinking about the world the way I want it to be, rather than the way it is.

comment 7y ago · link · parent

Thank you, Steve. You have personally done more to make the Rust community what it is today than possibly any other person. It speaks very poorly of Mozilla that they don't value your work.

Perhaps 2019 is the time to start the Rust Foundation, as mentioned by boats and others[0]. If so, you'd clearly be one of the founders. I would put my name into the ring for that as well, as we're now in somewhat similar circumstances. All it needs is some money, a lot for a pizza cook perhaps but a pittance by Silicon Valley standards.

Wherever our paths lead, I hope they continue to intersect!

[0]: https://boats.gitlab.io/blog/post/rust-2019/

comment 7y ago · link · parent

No, but I intend to use it as the foundational layer that I build the production implementation on top of.

comment 7y ago · link · parent

You need to integrate the square root of a quartic polynomial – the derivative of a cubic is a quadratic, then you square the norm of that, which gives a quartic. I spent a little time in Mathematica and it there is a solution, but it seems very unlikely to me it's going to be more efficient than numerical integration - it involves finding the roots of a quartic and has nine elliptic function evaluations. From a slide I found[0] it looks like it takes on the order of 100ns to compute an elliptic function, so at best it's still going to be slower than the adaptive quadrature even with an accuracy of 1e-12 or so. Plus there are a lot of divisions by differences of roots, and as each one of those approaches zero there will be numerical stability issues.

Long story short, it looks doable, but is a lot of work to get right and has almost no chance of beating out numerical integration in performance.

[0] http://arith22.gforge.inria.fr/slides/05-fukushima.pdf

comment 7y ago · link · parent

That is a beautiful memorial. Thank you Terry for writing it, and helping me appreciate Jean's life and work better.

comment 7y ago · link · parent

These quadrature techniques are strictly more powerful than adaptive sampling. Part of the motivation for this blog post was to raise awareness of quadrature, as it's an excellent general method when you want to numerically approximate an integral.

One reason to compute with excess accuracy is so that you can compute partial derivatives of arclength with respect to some parameter in the inner loop of an optimizer, to drive Newton or related solving. If the estimate has significant errors, then it can throw off the outer optimization loops. Of course, this only makes sense if it's cheap to compute the inner terms; if you have to pay dearly for accuracy, then use a more robust optimizer.

comment 7y ago · link · parent

You're really trying to nerd snipe, aren't you? I spent some quality time with elliptic functions as the solutions to the elastica, and also with the Fresnel integral which of course generates the Euler spiral. So yes, it wouldn't be surprising if there were a closed form solution, and that it might even be more efficient to compute.

So, this would be a good topic for someone else to show off their math skills :)

comment 7y ago · link · parent

The simple answer is that these days I go where the muse takes me. I'm basically on a year-long sabbatical after leaving Google this summer, where I'm not particularly worrying about making money. I did my PhD on tools for interactive curve design, and I was frustrated while I was at Google because IP issues made working on curves complicated. So when I had some new ideas, it was like the dam bursting, and I've been enjoying lots of motivation and creativity. I started the codebase for kurbo on Christmas and wrote 1300 lines of code that day. I'll keep doing it while it's fun.

1600.

How long is that Bézier?(raphlinus.github.io ↗)

164 points · by raphlinus · 7y ago · 18 comments

comment 7y ago · link · parent

"The Design of Everyday Things" is a great book, I enjoyed it.

Part of why I put it up with no instructions is to get feedback on how intuitive it is to use without any explicit instruction. I've gotten mixed response; some people seem to get it, others don't. So thanks for this bit of feedback. There's a basic help panel now.

comment 7y ago · link · parent

Thank you. As you note, the story here is very clear. It's under GPL so there is no friction for it being used in open source creative apps like Inkscape, and for uses outside GPL I want people to buy an exception[0]. I've had success with this licensing model in the past and am hopeful it can continue.

[0] https://www.gnu.org/philosophy/selling-exceptions.en.html

comment 7y ago · link · parent

It's not really a company, just me, but I'm making a music video game. And yes, the last few months have been a burst of creativity, after something of a slump the first half of the year. Leaving Google and going out on my own has been good for me. Now, if only I had a source of income...

comment 7y ago · link · parent

It's very good, but I think the problem is "too many parameters." In some contexts that's fine (animators are used to it) but in others it might not be ideal. People don't use that spline for font design work; why? The Hobby spline has a tension parameter, which is said to be "very useful" in the paper, but when Apple adapted it for Pages, they left it out of the UI. Was that a mistake, or did they make an informed user experience tradeoff? (Incidentally, I believe tension is in there, as part of the illusion of extensibility, but deeply hidden)

So whether this spline is better for, say, animation, is what I consider a fascinating research question. Hopefully putting it out there will start to get answers.

comment 7y ago · link · parent

This is very similar to the "Minimum Energy Curve" fairness metric, which minimizes sum of of bending energy, which in turn is proportional to curvature squared. And, thanks to basic physics, curvature is proportional to the centripetal force given a constant velocity.

The problem with MEC is that it tends to optimize for low tension; for inputs that are not well behaved, it sometimes optimizes for infinitely low tension, ie an infinitely long road. So there are other metrics, like Minimum Variation of Curvature, that work better for actual spline use, even though they have an energy metric that's "worse."

These curves are absolutely useful for path planning. A lot of the literature on "clothoids" from a hundred years or so ago is on transition curves for railroads. The G2 continuity condition basically means that you never have to suddenly turn the steering wheel to follow the curve, it's always moving continuously.

comment 7y ago · link · parent

I'll add curvature combs in a future revision. I'll also point out that you can see a curvature plot of the underlying 2-parameter curve family by playing with beztoy.html in the linked github repo, which is one of the main ways I evaluated this.

Higher degree Béziers illustrate the "curse of too many parameters." Yes, they're very expressive, and yes you can have very high degrees of continuity, but it's also easy to make very wiggly or lumpy curves. I don't know of anyone who uses them, certainly not for font design.

comment 7y ago · link · parent

It's likely it could be reworked to not make those spikes. The reason it happens is tricky. The basic curve family (what you get when you don't add explicit tangents) has a π-periodicity in the angles. Essentially it cares about the slope of the tangent but not the signed direction, and reverses the sign as needed. The curvature blending uses the same family but the sign reversals don't always "make sense" in terms of producing a smooth result. It's not obvious it would be better, as what you'd get would be more "twisty," and it's also possible the twistiness would snap as you rotated the handles. So making a direction reversal might be one of the less visually objectionable ways to handle the problem.

This is one of those "deep UX" questions I find fascinating.

comment 7y ago · link · parent

I tweaked the language, thanks for pointing that out. Obviously JavaScript is capable of very real systems and many of the potential applications of this work. Regarding the timeline, I'm hoping soon, but it's going to depend on where I want to take this codebase; I still haven't really decided, and it will depend in large part on what kind of interest I see. The multiple subpaths question is of course not a problem with the spline itself but whether the test app has a sophisticated enough document model to manage multiple path objects.

comment 7y ago · link · parent

Well, there's my thesis :)

There has been some work on this. Apple's Pages uses an implementation of the Hobby spline, demonstrating that it can be used in real consumer products. I think if you put these two side-by-side though, mine comes out quite a bit better; when you push the Hobby spline you get curvature extrema quite a distance from the control points, and mine doesn't do that.

Hobby's work has of course been an inspiration for mine for a long time, and it holds up academically quite well too - it has just the right blend of practical and aesthetic considerations and theoretical analysis; his solver runs in linear time and there's a proof it always converges (as long as tension values are within a reasonable range).

And of course there's the k-Curve work from Adobe. I think it is a step forward from Hobby in some ways (more robust) but a step back in others (it's not as smooth and most especially doesn't form true inflections).

comment 7y ago · link · parent

Thanks, that's music to my ears! A major focus of this work was making a primitive that would be intuitive and that you could build a good UX around. Considering the nontrivial learning curve for Béziers, I think your report is significant.

comment 7y ago · link · parent

Done, thanks for the suggestion.

1612.

Show HN: A new spline(raphlinus.github.io ↗)

341 points · by raphlinus · 7y ago · 72 comments

comment 7y ago · link · parent

Fair point, though it certainly was try at one point. In any case, doesn't detract from the point I was trying to make.

comment 7y ago · link · parent

I just want to say, it's slightly mind-boggling to see two Googlers on a thread talking about how to adapt legal work done for a mostly Apple-owned project to improve the licensing of a Microsoft product.

comment 7y ago · link · parent

We're still trying to figure out the best way to implement those. There's a prototype, but it hasn't landed in master. It's definitely on the roadmap though.

comment 7y ago · link · parent

I agree this could be very interesting.

comment 7y ago · link · parent

RIP Tim. I remember him as one of the guiding forces of the early Cypherpunks.

comment 7y ago · link · parent

I believe that's an extremely subtle meta-joke on how popularizations of clinical trials always manage to mis-state what can actually be concluded from the trial. If so, well done. If that wasn't an intentional joke, even better.

comment 7y ago · link · parent

Heh no. Its origins go way back before webkit started: https://www.levien.com/gzilla/

Probably very little of that original code in the current version though.

1
535455
63