It's just a giant stack of edge case exceptions that mostly does the thing you'd expect it to, sorry about the UI, it's very much just in the exploration stage.
there are a lot of edge cases that don't have an obvious analytical solution that's easy to state, so it's on me to encode an aesthetic fallback
Some hate it, some love it.
My perspective on this post is, great! Another idea I can add to my bookmarks for when I’m designing.
Appreciate the OP!
It worked great. I could feed it a line drawing, and it would emit the core graphics code to reproduce the drawing in realtime. You could easily create one of those animations that show the shape being drawn.
One interesting detail I noticed: in Apple's squircles the rounded corners are slightly pushing outwards from the flatness of a side. But the absolute value is very low, so the effect isn't visible unless you specifically look for it.
There's a wonderful book about it: https://link.springer.com/book/10.1007/978-3-031-13783-9
And how long until we get these squircles in CSS?
One consequence of that is that they scale more nicely for nesting: https://thatsmaths.com/wp-content/uploads/2016/07/squircles-... (right half of the image)
Of course, Apple’s squircles deviate from that by inserting straight line segments. What remains is that the corners still have a non-constant curvature.
In digital graphic design curvature discontinuities don’t usually cause mechanical issues, but discontinuities in curved shapes can still look jarring – for whatever reason the visual system is rather good at detecting such sudden changes in shapes, even those that naively "should" look smooth.
This is one of my pet fascinations (nerd snipe pits) - deciphering transition curve markings along railway tracks while travelling by train, preferably peeling an orange [*]. These transition curves are usually some approximation of an Euler Spiral (aka Cornu Spiral, Clothoid), typically a cubic parabola. To compute the Euler spiral as a closed form one gets into Fresnel integrals. Cubic parabolas are a lot easier to compute and for short arc lengths almost indistinguishable.
These get used in roller-coasters too, for pretty much the same reason (to avoid the "jerk")
What is not so well known is that Markov (of Markov chains) worked on the problem of optimal curves for joining straight railway tracks constrained by steering dynamics of trains. I think this was before his work on chains. His formulation was later rediscovered independently by Dubins.
[*] I am so glad you asked why an orange https://arxiv.org/html/1202.3033v1
A squircle is one (actually several variations) approach to making the curvature continuous.
I would say it's still a subjective aesthetic difference, but you can use math jargon to explain why you like one better than the other.
Personally, I prefer regular old round rectangles. Squircles are ugly.
(My interpretation)
The fun thing is athena toolkit widgets can actually be made to look halfway decent. Put a "*shapeStyle: rectangle" in your xresources. My xmessages have never looked sharper. [1]
1. A blatant lie, I have it themed to look like an old amber monochrome monitor. But "if" I had employed some tasteful pastels my xmessages would look sharp. https://nl1.outband.net/image/xmessage.png
> Added support for the corner-shape property.
https://developer.apple.com/documentation/safari-release-not...
Amazing.