Squircles

(linebender.org)

75 points | by raphlinus 14 hours ago ago

26 comments

  • mosura 19 minutes ago

    Generally speaking curves that avoid having discontinuities in their derivatives become hugely interesting the moment you want to interact with physical reality, since they are what enable smoothness. Squircles are just part of this.

  • 0x4e 36 minutes ago

    This is the kind of wholesome content HN needs more of.

    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!

  • scarecrw 31 minutes ago

    Squircles are an excellent shape, slightly outdone in my opinion by their dimensional older brother the sphube. Both thoroughly described here: https://arxiv.org/abs/1604.02174

    • PhunkyPhil 2 minutes ago

      Squircular, Squelched mapping, Squircular Ellipsoid, Squircular Cylinder (sqylinder), Non-Uniform Squircular Cylinder, Squircular Cone, Non-Uniform Squircular Cone, Squircular Cushion, Sphylinder... Good stuff :^)

  • terhechte 2 hours ago

    PaintCode! Here's a name I haven't heard in a long time. I had a license for this and one of my Mac apps (InstaDesk, later, PhotoDesk) used it a lot for all kinds of UI elements.

  • fasterik 2 hours ago

    For those who are confused by the plot like I was, the horizontal axis is arc length, and the vertical axis is curvature.

    • croisillon 29 minutes ago

      and the axis zooms from a maximum of 2 to a maximum of 200

  • xg15 2 hours ago

    Can someone explain the difference to me between a rounded rectangle and a squircle?

    • layer8 2 hours ago

      The sides of a squircle never become completely straight, they are curved at every point.

      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.

    • alanbernstein an hour ago

      On a rounded rectangle, the shape of the corner is continuous, but the curvature is not - it jumps from 0 to R. Rounded rectangles look fine, but if you're attuned to it, this subtle discontinuity can look just a little bit off.

      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.

    • YuechenLi an hour ago

      A regular rounded rectangle is G1 continuous while a squircle (superellipse) is G2 continuous, which means that it is not only continuous on position and tangent for its outline, but the curvature rate of change for the outline is also continuous, so it's smoother and doesn't have hard difference between "line" and "rounded corner" on the shape.

    • flowerlad 2 hours ago

      A standard rounded rectangle has quarter-circle corners. A squircle starts curving earlier and more gently, with a gradual transition from its flatter sides into its corners.

      Personally, I prefer regular old round rectangles. Squircles are ugly.

    • prideout 36 minutes ago

      Like Raph's post says: squircles do not have a single agreed-upon mathematical definition. I don't think "rounded rectangle" does either.

      • raphlinus 25 minutes ago

        I think a rounded rectangle is defined as 4 straight line segments joined with G1 continuity to quarter circle arcs. I'm unaware of any other definition. The only variation I know is whether the radii have to be the same or can be different. Flexible implementations do allow the latter.

    • TobTobXX 2 hours ago
      • snug an hour ago

        I like that he asked this question because that was not a question I thought to even ask

    • wolttam 2 hours ago

      Rounded rectangle is a rectangle with fixed radius corners, a “squircle” is some shape where the corner’s radius is not constant.

      (My interpretation)

  • vindex10 42 minutes ago

    I came here expecting squirrels, haha)

  • pampas 42 minutes ago

    The maths is elegant but I'm really tired of squircle icons. I find them ugly and I want to go back to the good old days where every icon could have it's own distinctive shape which makes that one app much easier to find. The human brain is great at quickly recognizing shapes and angles so why throw it away. Someone got a promotion for squircles.

  • ex1fm3ta an hour ago

    The new Apple product HomeView is a Squircle https://www.apple.com/ca/shop/buy-home/apple-homeview/apple-...

  • MitPitt 2 hours ago

    Too bad squircle corner shape (along with scoop, notch, bevel) are only available on chrome as a CSS feature, but not firefox or safari. I hate rounded corners in UI, with a passion.

    • layer8 2 hours ago

      I dislike rounded corners as well, but also when they are squircles.

      • whoishiding an hour ago
      • somat 8 minutes ago

        Firefox recently went hard on really rounded corners in a recent version, and me being an antique interface connoisseur went "Oh hey, project athena is back" an aesthetic I find hideously ugly.

        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

  • xunil2ycom 2 hours ago

    If anything never needed to be examined, it is this.