Continuity 101

04 Aug, 2009 by adam in theory, Tutorials
Tags: , , , , ,

I’d wager that 95% of CAD users don’t know what “Curvature” continuity really is in the mathematical sense, much less how it makes sense in the broader context of surfacing. Here we’ll look at the basic principles of “continuity”, and use these principles as the basis for a longer-term study on class a surfacing continuity. This video presentation isn’t just for geeks, it’s for real people who just want to understand what “G0″, “G1″, “G2″, “G3″, and “G4″ really mean in practical terms.

Continuity is something you?ll encounter a lot as a class-a surfacer. You?ll find it affects the aesthetics of the surface, your ability to build geometry from geometry, as well as to the weight and complexity of your model.

In this class-a we?ll be talking about G0, G1, G2, G3, and G4 continuity types, and exploring what they mean at a very basic level. This will be a very high-level overview, and in future tutorials we?ll delve more into the details of what these concepts mean in the context of class-a surfacing.

That brings me to ?G?. During the course of this class and elsewhere on class a surfacing dot com you?ll hear me talking about ?G0?, ?G1?, ?G2?, etc. ?G? in this case stands for ?Geometric Continuity?, and ?G0? stands for ?Geometric Continuity, Degree Zero.? You may also see similar notation substituting ?C? for ?G,? like ?C1?, ?C2?, etc. This notation has a slightly different meaning, but is mostly for programmers and mathematicians, so we will simply use the more commonly-used term, ?G.?

G0 refers to what we call ?point continuity,? meaning that the two curves in question touch each other. Mathematically it just means that if you solve the equations for each curve at a certain x and y, the solutions will be equal. Very simple.

G1 takes this a step further. It means that the two curves not only touch, but they go the same direction at the point where they touch. In calculus this would mean that the first derivative of the two curves is equal at the point where they touch, hence the name G1.

G2 builds on G1 by adding the stipulation that the curves not only go the same direction when they meet, but also have the same radius at that point. In calculus this would mean that both the first and second derivatives of the equations are equal at that point.

G3 continuity ads yet a third requirement to the continuity: planar acceleration. Curves that are G3 continuous touch, go the same direction, have the same radius, and that radius is accelerating at the same rate at a certain point. You calculus heads have already got this thing figured out: G3 continuous curves have equal third derivatives.

G4 continuity is very seldom used, but can be important in certain isolated cases. G4 continuous curves have all the same requirements as G3 curves, but their curvature acceleration is equal in three dimensions.

In review, we?ve got five levels of continuity commonly used in CAD. In G0, the curves touch. In G1, they touch and go the same direction. In G2, they touch, go the same direction, and their radii are equal at the contact point. In G3 their radii are equal and accelerating at the same rate, and in G4 the acceleration takes place in 3D space.

In this presentation, I?ve been using 2D curves to demonstrate different types of continuity, but you?ll be able to use the exact same principles and terminology when working with continuity between different surfaces.

But who cares? What difference does it make to you as a surfacer, designer, etc, when the result looks good enough to you? There are a few reasons.

Number one, what?s visible on screen is very low resolution, and does not give an accurate picture of the real curvature of a line. Using an appropriate level of curvature will help to ensure that you?re surfaces actually are as smooth as you expect them to be.

Secondly, glossy and/or reflective surfaces ?shine? differently on tangency-continuous blends than on curvature continuous ones. The difference is subtle, but can be important on surfaces of high aesthetic importance.

Finally, geometric degradation can cause problems when you build a model. I?ll be demonstrating this phenomenon in a future class, but for now suffice it to say that understanding continuity types will help you achieve the desired results when working in 3D space.

There are a few important notes before we end this class.

Firstly, continuity types only apply to appropriate curves. Curvature continuity is useless when one of the curves being compared is a line. Similarly, curvature plus acceleration is basically irrelevant if the curve in question has a constant radius, like an arc.

Class-A surfacing CAD packages allow the user to adjust the ?magnitude? or ?tension? of a blend curve, allowing you to control how much influence the parent curve has over the blend. This functionality can sometimes make a curve or surface look like it is curvature continuous, even when it is actually only tangent continuous. This trick is acceptable if the desired look is achieved, but does not help with the problem of continuity degradation, discussed in a future tutorial.

I hope this helps with a basic understanding of continuity types, what they are, and how they’re used in a theoretical sense. We’ll get into more practical examples soon. Until then, have fun!

about adam:
Adam O'Hern is an industrial design consultant specializing in visual brand languages, and has designed products ranging from laptops to power tools, classroom toys to bathroom fixtures, and robots to lint rollers. He has published with 3DWorld Magazine, CGTuts+, and Luxology, and works with Josh Mings of SolidSmack.com on EngineerVsDesigner.com.

13 Responses

  1. Sevacro says:

    Hello Adam, thank you very much for this and other highly educational videos you bring us. :)

    About geometric degradation mentioned above, i found this video of yours on youtube (http://www.youtube.com/user/ClassASurfacing#p/u/40/QyD9YWfS9Qo) but lacks sound. Since I’m very interested on the subject I was wondering if you are going to make a new video in the future.

    Another video that I found interesting is the one on conics (also on the class-a subject). How do you make conics in Rhino?

    Hope that’s not too much, regards!

    • adam says:

      Hi Sevacro:

      I hope to get around to doing a follow-up theory video sometime, but I’m not sure how long it will take to get to the front of the pipeline.

      Conics are just “degree 2″ surfaces. In Rhino you can define a surface as degree 2 and then use the “weight” tool to define the Rho for the conic. The downside is that Rhino has very weak spine control, so it isn’t as straightforward as in Catia or NX. I’ll try to get a “conics in Rhino” video into the pipeline as well.

      Keep in touch!

      Adam

  2. Topsoil says:

    I can’t find how to subscribe to the comments via feedburner. I want to keep up to date on this, how do I do that?

    • adam says:

      Hi Topsoil:

      Honestly I’m not sure. I’m using WordPress to publish the site, but I’m not sure if there’s a way for you to subscribe to the comments for a single page without installing a particular plug-in. If it’s of interest to readers, I’d be happy to install a plug-in for that.

      Adam

  3. adam says:

    For me there was a big ah-ha moment when I took college level calculus. At that point I’d already been using CAD for years, and suddenly it all became clear. It was like “ooooh, so THAT’S how CAD programs work…”

    If you haven’t had calculus, and you’re interested in understanding CAD topology on a deeper level, I recommend taking a crash course in Calc I.

  4. Thanks. Yeah after I read my question, I realized that there probably wasn’t a very easy answer as it would get into the complex mathematics of how a NURBS curve is defined. I just thought it was interesting, from my stand point of not knowing that much about it, when I watched the video on NURBS that it looked like the math defining the degree was evaluating each point along that curve to make sure they met the similar criteria as a “G” continuity. Thanks.

  5. adam says:

    Great, glad to help. I’m not sure how to answer your first question. Don’t worry about relating G2 with degree-3; they are separate concepts really. They are related, but their relationship is complex. The main thing to know is that G2 means exactly what you said: at the point of intersection, two curves have equal value, slope, and curvature (radius).

    As for degree, just stick with 2 or 3 unless you have some specific reason for going higher. Use degree-2 when you want a purely-convex curve or surface, and degree-3 when you need more complex curvature across the curve/surface. Most spline tools default to degree-3. Many CAD tools only support degree-3.

    CAD packages all really do the same things mathematically. There are some relatively important mathematical differences (e.g. is a cube defined as an origin, width, height and depth, or is it defined as six individually-defined planes?), but in reality the differences in CAD packages have more to do with user interface preferences than actual math. Mathematically speaking, a spline is defined as a polynomial, and solved for display using basic 3D calculus. From the user standpoint, however, a spline can be defined a million different ways. You just have to choose the method that works best for you.

    Good luck!

  6. Thanks for the reply. You did a pretty good job of interpreting my question. So is the math that defines G2 continuity, they intersect, are tangent and have the same radius, looked like the same math that is used to define a degree 3 curve from your nurbs series of videos?

    As for my “true” NURBS comment now that I wiser and more educated I probably wouldn’t have made it. Although now that understand what makes up a NURBS curve better you can see where some programs,like Autocad, have a spline tool, and if you look at the help menu it says “Create splines, which are NURBS curves, with SPLINE” but don’t allow you to control the degree of the curve like other NURBS packages do.

  7. adam says:

    You are correct: bezier and NURBS are different math, but the resulting control structure of a bezier curve is very, very similar to a 4-point degree-3 NURBS curve.

    Your question about the difference between G1,G2 etc and degree 1, 2, etc is valid. “G1″ refers to the relationship between two different curves at a point (i.e. they have the same direction at said point). “Degree 1″ refers to the interpolation method by which a given curve is drawn. ‘G’ values refer to relationships between curves or surfaces, where ‘degree’ values refer to how a curve itself is drawn.

    The two concepts (‘G’ and ‘degree’) are related, but not in any easy-to-explain way. It is theoretically possible for two degree-2 curves to have G3 continuity at the point of intersection (albeit highly unlikely). It’s also easy to have two degree-7 curves that end up with only G0 continuity at the point of intersection.

    As for the definition of a “true” NURBS modeler, I don’t buy into those kinds ill-defined labels. Any modeling package that utilizes Non-Uniform Rational B-Splines in 3D space is a NURBS modeler. You’ll choose the tool that’s right for you depending on what feature/interface/price trade-offs you’re willing to make.

    Don’t become a victim of the “more is better” mindset when it comes to continuity. I use good ol’ tangency with good ol’ degree-2 curves whenever I can possibly get away with it. I’ll only add geometric complexity (i.e. higher order curves or G2, G3, etc) if I absolutely have to in order to achieve the desired visual result. KISS method!

  8. After doing some reading I realize that my first question shows that I definitely fall into the 95% of cad users. Correct me if I wrong but a bezier curve and nurbs curve have different math behind them. A nurbs curve being, like you said more powerful, but more overhead. Another question what is the difference between G1,G2…ect continuity and the degree setting (1,3,5,7) of a curve. Is the continuity G1,G2,G3… used to define a blend between curves, and the degree used to define the curve itself, because the look to be defining the same thing? Hope that makes sense.

  9. Thanks. I was curious because it seems that quite of few packages out there offer some kind of beizer curve, or b-spline curve but they don’t allow you set the degree or continuity of the curve. I guess that what makes a true nurbs modeler is the ability to control the continuity of the surface or curve.

  10. Thanks for the videos. I enjoyed them very much. The helped shed light on something I always see but didn’t fully understand. I am curious how does a biezer curve that you see a lot of cad packages fit into the continuity schemes.

    • adam says:

      Glad it’s helpful info, Dennis. Most CAD packages use Bezier controls simply as a means of generating a NURBS curve. When you think about it, a Bezier curve is really just a series of degree-3 NURBS curves that happen to be tangent to one another.

      Sometime try this exercise: draw a degree 3 NURBS spline with exactly 4 points: 2 end points, plus two middle points. Then draw a bezier spline with two control points (2 end points, 2 control points). Notice that the two curves behave pretty much identically.

      So when you think about it, a Bezier curve is just a watered-down NURBS curve that’s easier to understand, but ultimately less powerful. Hope that helps!

      Adam

Leave a Reply

You must be logged in to post a comment.