back
user profile
raphlinus
13,685karma·1,846submissions·March 7, 2014
about
I do research on fundamental UI technology and 2D graphics, with a focus on Rust and fonts.
@raph@mastodon.online
recent activity (1,846 total)
comment
Requiring the shift amount to be unsigned is very sensible. There are two other issues. One is when the shift amount is greater than or equal to the machine word size, for example 1u32 << 32. Ja…
comment
I'll give a concrete example. It's not the most compelling optimization in the world, but I think illustrates the tradeoffs clearly. The following is pseudocode, not any particular language,…
comment
The point of the C11 memory model is that it gives formal bounds on what optimizations the compiler is and is not able to do. In particular, it is free to reorder memory operations as if the program w…
comment
How does this work in practice? Is the behavior of a use-after-free defined? Data races? The latter even more so for objects that don't fit in one machine word, such as slices. While avoiding und…
comment
Thinking about this a bit more. If you want an interpolation compatible offset, reduce the search to a one dimensional problem by fixing the area. This gives a simple rational formula for the length o…
comment
It is optimizing for the shape, and the parametrization is not guaranteed to match at all. Whether this is a good thing or a bad thing depends on your application. If you just want the parallel curve,…
comment
Yes, and I should probably add those links. Quadratics get you O(n^4) scaling, which is pretty good. Figuring out where to put the control point is easy, there's basically only one place it can g…
comment
I would be quite flattered by an unethical scholar plagiarizing from my work, it would be far better than being ignored. The actual conversation about motivation to publish a paper is a fairly deep to…
comment
Yes. The core curve-fitting technique is very general and can be adapted to any scenario where you can sample the desired curve (with normals) and compute a couple of numerical integrals on it. I am c…
comment
Gotcha gotcha. I just coded this up, and averaging the two incident normals performs about the same as OG Tiller-Hanson, slightly worse. The original version (and my implementation) displaces the edge…
comment
I'm not sure "degeneracy" is the best way to think about this. If the curvature exceeds the inverse of the offset distance, you get a cusp, and in general you need to think about how to…
comment
I'm slightly confused by this. A point on a polyline doesn't have a single normal, as it's incident to two edges, and in general those edges have two different normals. If you push ou…
comment
I believe WebGL compute shader development has been halted[1], in favor of making WebGPU happen. Though it's possible to run it in dev builds in some cases, I'm pretty sure there's no b…
comment
Ah, my good friends the Fresnel integrals (functions plotting the Euler spiral, also known as clothoid and Cornu spiral) are there in Chapter 7. One of the things I'm proud of is having better te…
comment
Agree 100% and I spend a fair amount of time wondering why this hasn't happened. I built piet-gpu-hal because I couldn't find any abstraction layer over compute shaders that supports precomp…
comment
> PS, is your monoid work online, is it this https://arxiv.org/abs/2205.11659 ? I'm interested in monoids on GPUs. Yes, that's the draft on arXiv, and I have a blog …
comment
This topic is close to my heart. I do research on the fundamentals of 2D graphics, some of it cutting edge (especially GPU techniques), others just selecting the best known techniques (for example, ri…
comment
The first implementation will be in the kurbo codebase, in Rust, permissively licensed. If it works out as well as I'd like, the code will be only moderately complex, which I hope means others ca…
comment
This is exactly the hard part. If you have an intersection of even multiplicity, then they won't alternate. In addition, when you're using these things for path intersection, you also want t…
comment
An at least pretty good solution to computing parallel curves of Béziers is given in [1]. This can give very accurate results with a modest number of segments, using techniques that are fast to evalua…
comment
Yes, very happy to discuss; my email is raph.levien at the mail service operated by Google. I think my approach may be less difficult, as it's based on accepting numerical errors when curves are …
comment
I'm working on this as we speak. As as another commenter has mentioned, the "fat line" Bézier clipping algorithm is the current state of the art, but I'm confident at this point I …
comment
I have no idea why this popped up now. Overall I think it holds up reasonably well, though it's in a brasher and younger voice than I would use today. I went back and fixed the link rot. (Inciden…
comment
Also the mathematical basis of the Euler spiral, also known as Cornu spiral and clothoid, which is a beautiful curve and a very good basis for curvature-continuous splines. I wrote about that extensiv…
comment
https://raphlinus.github.io/xi/2020/06/27/xi-retrospective.h... …
comment
I still use vim for light editing tasks (mostly when I'm already in a command line), but VS Code is my main, largely because of its excellent rust-analyzer integration. At other times I have used…
comment
Maybe I haven't spent enough time digging into the academic literature, but I'm not aware of very much that's good. The original Elm paper[1] is quite good but interestingly enough Elm …
comment
I will confess, an editor doesn't feel quite right unless it's Inconsolata. Source Code Pro would probably be my second choice - it's the official Rust doc font, and feels good for that…
comment
It was pretty good, my son and I ordered Bangkok Thai on University here in Berkeley. The satay and tom kha gai were excellent, but the chu-chee salmon wasn't as good as the last time we had it. …