logoalt Hacker News

G0-G3 corners, visualised: learn what "Apple corners" are

117 pointsby dgroshevlast Sunday at 6:16 PM59 commentsview on HN

Comments

sfpottertoday at 5:41 PM

One interesting and sort of unhappy artifact of CAD is the adoption of B-splines and NURBS as the primal basis for modeling. The whole point of B-splines is that they are the obvious basis for maximally continuous splines of a certain degree (i.e., degree n gives C^{n-1}). This is much more than G continuity. But in CAD, it's often the case that all you care about is just G continuity.

So you run into a weird situation where CAD software may pass around NURBS or B-splines with multiply inserted (or even fully inserted) knots, seriously reducing the need for using splines in the first place.

The problem is that splines are a really inconvenient and even unstable basis for doing numerical work... which is what all of CAD is.

show 1 reply
Duanemclemoretoday at 7:11 PM

Rhino3d [0] is one of the state-of-the-art programs (along with Alias) for the drawing of nurbs and modeling with them. The result is the industry standard "Class A" surfaces. Rhino has amazing "BlendCrv" and "BlendSrf" commands that allow you to combine curvatures between the two curves / surfaces being blended. EG, you can interactively choose G0 at one side and G3 at the other, etc.

Rhino also has really nice and performant curvature analysis tools, and a whole host of other tools for implementing Nurbs.

Alias is at least $5,000 / year per seat. Rhino is $995 for a perpetual license, with new versions coming out every 2.5 - 3 years and significant functionality upgrades each time.

McNeel also maintains OpenNurbs [1], an open source library [2] for the construction and use of Nurbs. This powers Rhino of course and is used in other software. I'm still waiting for someone to implement OpenNurbs natively and robustly on Linux. But I like the Rhino platform and McNeel as a company so much that I run it using wine.

[0] https://www.rhino3d.com/ Developed by McNeel Software [1] https://www.rhino3d.com/features/developer/opennurbs/ [2] https://github.com/mcneel/opennurbs

show 1 reply
junontoday at 9:38 AM

If anyone wants a good primer into curves, Freya Holmér has an amazing deep dive into continuity.

https://youtu.be/jvPPXbo87ds?si=7IbeklF4p9qg1F6X

show 3 replies
aziaziazitoday at 12:49 PM

This page has images that clarify the subject: https://help.autodesk.com/view/ALIAS/2024/ENU/?guid=continui...

show 1 reply
ZiiStoday at 8:55 AM

I wanted to play with this in OpenSCAD; here is G1 vs G2

  include <BOSL2/nurbs.scad>
  $fn=16;
  back(400) cuboid([200,200,100],rounding=50,edges="Z");
  pts=subdivide_path(square([200,200],center=true),8);
  linear_extrude(100) polygon(nurbs_curve(pts,2,splinesteps=$fn/4,type="closed"));
ricardobeattoday at 9:16 AM

One thing they don’t mention is that smooth G2/G3 corners will print horribly (with FDM) if added to vertical corners, there just aren’t enough layers even with a 0.2mm nozzle. You can see they use a straight chamfer on the example piece.

While dreaming up Apple-like objects I quickly discovered 3D-printing them with good surface finish is nearly impossible. Best we can do is Mac mini-like flat tops. Like most other manufacturing methods, its limitations heavily influence the design.

show 2 replies
LiamPowelltoday at 7:55 AM

These corners are so close that they're going to have no practical difference when 3D printing them, the maximum deviation between G1 and G3 is only 0.1mm. You need to exaggerate the effect much more to show the difference.

> G3 continuous corners mean that the print head experiences smooth acceleration while printing such corners.

Axial acceleration is the key here, not just acceleration, that however does not matter if the controller does not output feedrate profiles with smooth acceleration to go along with it.

show 3 replies
manoDevtoday at 1:57 PM

I remember reading somewhere that these curves were based on the curves that naturally occur on smooth pebbles due to the abrasion of water, but can’t find a link now (searching “apple” and “pebble” only gives me results about the smartwatch)

show 1 reply
atoavtoday at 9:14 AM

As someone who modeled surfaces like this for a living:

  G0 Positional Continuity: The surfaces touch without gap, but there may be a sharp corner. Example: the corners of a cube  
  
  G1 Tangential Continuity: G0 but additionally the surfaces have the same slope (are tangential) at the point where they touch. Example: adding a circular fillet to the corners of a cube  
  
This is where most basic CAD modellers would stop. The problem with just putting a cylindrical or a spherical fillet in a corner is that you basically go from a flat surface (zero curvature) to a surface with some curvature on a whim. If your surface is reflective that means you go from a flat mirror to a strongly distorting one instantly, this will visually appear as a edge even if there is none. Curvature btw. is just the reciprocal of radius (1/r)

If we talk about forces (e.g. imagine a skateboard ramp) you go flat (no centripetal force) to circular (constant centripetal force) without any transition inbetween. In effect this will feel like a bump that can throw inexperienced skateboarders of their feet.

This means tangential transitions often do not cut it.

  G2 Continuity: In addition to being G0 and G1 you additionally ensure the curvature is the same where both surfaces meet. This usually means instead of going from a flat surface into a circle you go into a curve that starta out flat and then bends slowly into a radius.  
  
Now the curvature of a curve can be drawn as a curvature comb. You basically take the curvature at any point of the curve and draw the value as the length of a line that is perpendicular to the curve.

G1 is if the perpendicular lines at the ends of the two curves align. G2 is if the curvature comb at the end of the two lines additionally has the same height (indicating the same curvature at the transition point).

G3 is basically just ensuring that the two curvature combs are tangential at the point where they meet. G4 is ensuring that the curvature combs are not only tangential, but have the same curvature. G5 is taking the curvature of the curvature...

By this point you may be able to sense a pattern.

show 4 replies
EZ-Etoday at 9:04 AM

I thought this was going to talk about all the competing, different corners radiuses on MacOS windows

(is plural of radius radiuses? or radii?)

show 1 reply
owobeidtoday at 10:14 AM

Are there good ways of achieving this in tools like Blender and Illustrator? My best result so far in Illustrator was to round corners first and then apply a small amount of smooth but it looks a bit wonky.

show 1 reply
d--btoday at 9:38 AM

This is also what's happening in an elevator. You not only want the speed to increase slowly, you also want the acceleration to increase slowly, cause that's what actually makes your guts go down. And the best way to do this is to have the acceleration of the acceleration continuous.

In the end the position of the elevator is 3-continuous (why is it called G3? in France we call this C3). And the apple corner is just a graph of the position of an elevator wrt time. Mind blowing

show 3 replies
fennecfoxytoday at 10:21 AM

It's just a corner with a huge radius...idk why the cult has suddenly attributed this to Apple. Perhaps because of the ridiculous court case.

show 2 replies