Continuity 101

04 Aug, 2009 by Adam OHern 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 OHern

Adam O'Hern is an industrial design consultant, designing products ranging from laptops to power tools, classroom toys to bathroom fixtures, and pro audio gear to guitar tuners. In 2008 he founded cadjunkie.com, and in 2010 co-founded EvD Media with Josh Mings of SolidSmack.com, and the two collaborate on the EngineerVsDesigner.com podcast.

Adam on google+

  • Victor

    I think that in calculus what you have explained is C continuity not G one.
    the exact definition of G continuity is:
    the curves are Gn continues iff there exist parametrization of curves in which they are Cn continues.

    From this definition you can mathematically derive that:
    G1 – same first derivative direction, but not necessary the same norm (magnitude)
    G2 – same normal curvature ( second derivative projection on curve normal )
    and so on …

    • Adam

      Hi Victor,

      Thanks for that! I am sorry to say that you’ve surpassed my understanding of the topic, so I’m not sure I’ll be able to discuss it intelligently from here. I will throw out for discussion that my understanding has been the opposite; i.e. that ‘G’ continuity is based on dumb geometric coincidence, while ‘C’ continuity has to do with parameterization and boundary conditions (or some other buzz word stuff!). That’s why you’ll hear Rhino users talk about G continuity, while SolidWorks users talk about C continuity.

      If you understand better than I do, please enlighten us all!

      Adam

      • Victor

        Ok, I’ll do it only for G1.
        For G2, G3 and e.t.c. I won’t,
        since there’s an appetite of CAD companies for these,
        I do not want to supply them here for free.

        G1 in real life:

        A car goes at a speed of 40 mph.
        Another car goes behind it faster and hits (clashes) the first one.
        The first car continues to go but at speed of 50 mph.
        Attention:
        It has changed its speed from 40 to 50 in no time,
        but it hasn’t changed the direction.

        As you might know in physics the velocity is actually the fisrt derivative of the path.
        In the example above you do not have C1
        since 40 != 50,
        but you do have G1
        because the directions before the “crash” and after are the same.
        (just for example I’ve chosen them to be the same,
        in the real life I hope there will be no crashes)

        Now let’s go to the mathematics.

        Let’s A and B be the curves in R3 ( Euclidean space)
        and they meet at some point P (they have G0 or C0 – here it is the same)

        Definition:
        A and B are G1 continuous at P iff
        there exist parametrization (u(t) and v(t) ) such that A(u(t)) and B(v(t)) are C1 continuous at P.

        Now I’ll show how to extract the condition regarding the same direction of the derivatives ( which I meant in the previous comment):

        two curves are G1 to each other iff their derivatives are parallel.

        Let’s say we have the parameterization u(t) and v(t) and we demand C1 continuity:
        A’(u(t))*u’(t) = B’(v(t))*v’(t)
        I omit the parameter t since we deal with a point P and not with hole curves:

        A’(u) * u’ = B’(v) * v’

        Here you can see vectors A’ and B’ in 3D space
        and the derivatives of parameterization u’ and v’ in R ( scalars)
        That means that there is no parametrization which can change directions of A’ and B’ ( except for negation). And since we have demanded C1 – they are parallel.
        (I’m omiting u’ and v’ zero case – if there’s a need I will explain this case,
        but I think it is a triveal one).

        I hope it is clear.

        For G2, G3 … you actually do in the same way.
        But there will be a need of knowledge in differential geometry.

        Victor.

        • Adam

          Wow, that just… my brain juice just got all runny and slurped into my neck hole. Yikes.

  • luchino

    Thanks Adam, your explanations are awesome and clearly

  • http://www.facebook.com/profile.php?id=100004491394842 ??

    mnugkch

    • Adam

      I may be wrong about this, but my (probably simplistic) understanding is that since ‘tangency’ merely means that a curve is running the same *direction* as another curve at their point of intersection, and that in 3D tangency only really works in the direction of the isoparms on the surface. If you intersect a plane parallel to the isoparms (i.e. direction) of the surface, the resulting curve should be tangent-continuous as per the surface definition. BUT, if you intersect a plane at any non-parallel angle to the isoparms, there is no guarantee that the surface will be tangent, at least not within the desired tolerance. By creating an angled flange out from a cross-grade intersection curve, I was able to amplify the this tolerance problem to make it visible on-screen.

      I think there is no sure way of predicting when this kind of thing will become a problem. It’s just good to know that it can happen, so that when it does happen you’ll know how to fix it!

  • Perumal

    I did not go into calculus but I clearly understood what is G0, G1, G2, G3 & G4 continuty. Great explanation, Thank you!

    • adam

      Glad to hear it! You’re welcome. :)

      Adam

  • ragesh

    Hello Adam,
    I m basically new to surfaces and am gonna work on V6 platform. Just love your way of explaining things. Would really be great if you could demonstrate the V6 environment and new features and a touch into V6 basics. Not the tool but the basics

  • Sevacro

    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!

    • http://cadjunkie.com adam

      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

  • http://www.landscapinghockessinde.com Topsoil

    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

      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

  • adam

    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.

  • http://www.nelsondesignbrooklyn.com Dennis Nelson

    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.

  • adam

    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!

  • http://www.nelsondesignbrooklyn.com Dennis Nelson

    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.

  • adam

    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!

  • http://www.nelsondesignbrooklynwa.com Dennis Nelson

    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.

  • http://www.nelsondesignbrooklynwa.com Dennis Nelson

    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.

  • http://www.nelsondesignbrooklynwa.com Dennis Nelson

    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

      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