By Ali Ismail
Why Learn NURBS
Until recently, and like many others, I thought I was doing fine with polygons, and never got around modeling in NURBS proficiently. When I needed to model high quality reflective models (Class A surfaces, E.g. a car body with accurate reflections), I realized there was no way to escape investing the time in learning it, afterwards I felt that it can be a very useful knowledge to speed up my modeling process in general, although at the time of writing this tutorial, I can't say I am providing you with information based on long experience, but I hope sharing my fresh understanding would help to clarify the topic with a different light.
What is NURBS
NURBS is a way of using curves to create rectangular patches that can be trimmed and aligned*.
Wait! that's it? I always thought NURBS (Non-uniform rational basis spline) was much more complicated than the line above! actually it is not. This is of course a practical definition, and there are many tools or a combination of tools to do different forms of the same thing, which can take a while to get used to, but the principles are quite straight forward.
We will demonstrate below how all NURBS tools fall into one of these categories:
2-Rectangular surface creation/modification.
5-Measurement and evaluation tools.
*An alignment that could make 2 patches or curves appear to be blended seamlessly in one.
NURBS vs. Polygons
Polygons use points, called vertices, to define positions in 3D space. These points are connected by straight lines called edges, forming faces (triangles).
To avoid the jagged look of those straight lines or an angular mesh structure; Gouraud shading trick was devised. Only changing how faces look like and not the geometry. You can smooth the mesh by changing geometry using a subdivision algorithm such as Catmull-Clark.
While these methods work well in many areas, especially if all what you need is to render, or view an image of the model. You will not find it of great use if you want high accuracy to machine build an object to the tolerance* of a 0.01 of a millimeter; to achieve that in polygons, you would need to subdivide the mesh an large amount of times to get a vertex point definition enough to accommodate that level of accuracy.
You can see from the image above, having polygon subdivision can be good for an image, but if you wanted a 3 meter radius cylinder manufactured, you are going to need a lot more subdivisions, really a lot more. Just imagine, rubbing your finger along the side of a big cylinder, and consider how many vertices you would need to make the feeling smooth without bumps.
If you still have any doubts, please don't forget that Gouraud shading is what makes the surfaces look acceptable, remove that, and you will see the facets, realizing how many subdivisions you need to make a smooth surface. (below image demonstrates Gouraud shading effect)
There are of course different ways to handle subdivision, or to convert a mesh into a NURBS surface to be able to build it smoothly (check nPower Software SUBD-NURBS). Sometimes you don't even need it to be on a high level of accuracy, as in the case of 3D printing a sculpture you created.
At present, though, the standard pipeline for creating and manufacturing high quality products, requires the use of NURBS surfaces/solids**. Tight fitting parts with very small tolerances require great accuracy. In addition, the tools you have in advanced NURBS and class A surfacing software are unparalleled by polygon modeling ones; allowing trims, projections, alignments and measurements that can't be easily achieved in polygons, but maybe later on we could see a more advanced form of accurate product modeling that incorporates a subdivision approach within it popularized.
*If you are familiar with scientific terms such as (accuracy/margin of error), you can easily know what tolerance refers to. For example a tolerance of a 1 millimeter means that the margin of error or inaccuracy is no more than 1 millimeter.
**To avoid confusion and put it in simple terms, a solid is just any grouping of surfaces/patches that has no holes in it, or you could think of it as something that has substance inside and isn't merely a shell. The term water tight is sometimes used to describe a solid.
Meet The NURBS Curve
Its perfectly smooth, accurate and you can pin point a dot anywhere on the curve and you will get its position by the 0.0001 millimeter if you want to!
But how? unlike polygon subdivision, which relies on ever increasing iterations to get the next level of accuracy. NURBS curves use a simple mathematical equation to define the curve, for now its enough to know that with only placing few points you get a very accurate smooth curve that doesn't require a lot of computation. Even the file size of a NURBS surface, is very small compared to a mesh file, the large file size of a mesh, results from the structure table of each and every vertex position and how its connected.
A NURBS curve, is controlled by points, called control vertices, with corresponding ones on the curve itself called edit points. these control vertices pull the curve and behave as a magnet would, each control vertex pulling it a little towards it. The position of the dots the curve is made out of, is determined by the sum of neighboring control vertices.
To learn more about the mathematics behind NURBS you can check these links:
Clear Basics | Old lecture on B-Splines | Computer graphics principles and practice free chapter | Simple video on bezier curves (last link is not exactly what we want here, but just to take the heat off of the previous links)
You can check some of the resources listed inside the MacTech page by J.Schneider as well, generally speaking; if you want to know the basic math behind anything your software does or how to code it, starting with any graphics reference book (the sort a render engine or 3D game coder studies), is always a good start.
Curve + Extrude = Surface
If we take the precise curve we have, and extrude it along an axis or another curve, we will get a similarly accurate surface.
The surface we've just created is the basis for All* NURB surfaces creation; rail, loft, skin, square and revolve, can all be seen as one form or another, of an extrusion along a curve with some interpolation or averaging between the generation curves and/or rails. They all result in what you can describe as a curvy rectangular surface with 2 axis coordinates (UV). One coordinates axis (U) is taken from a curve or a set of curves, and the coordinates for the (V) axis from a different curve or set of curves.
*A somewhat convenient simplification, different surfacing tools have different algorithms, but at first look they do feel like an extrude.
Now, Let's examine some of the tools you will encounter in any NURBS modeling software, they will usually fall into one of those categories:
One thing, that could potentially shun off polygon modelers from a NURBS modeling technique, is the tool set, which seems a lot different than the one they are used to, and when they try to test some of the tools; nothing happens or a statement indicating a failure pops up.
While it seems there are a lot of tools for curve creation and manipulation, for now we are just interested in creating a curve.
Its good to note, a lot of these tools are simply the same tool, only a different way of doing things or one that includes more than one process, for example; fillet is a way of trimming a curve, creating a new one in the cut area and aligning it to the edges. All of these tools are one way or another of creating the good old NURBS curve made out of CVs.
These tool sets usually contain:
-Basic curve creation tools (creating a curve using control points, edit points, or handles are all the same tool, only a different way of creating it).
-Primitive curves (arcs, circles, squares, etc..).
-Ways of cutting/trimming/extending a curve.
-Copying/duplicating curves (from trimmed edges and surfaces as well).
-Curve properties modification/fitting/simplifying/planarizing.
Rectangular surface creation/modification
After you have your curves ready, you are set to create a surface. Below are some examples of the typical tools you will find to create a surface and how similar surfaces could be created with different tools:
Depending on the software you are using; this tool can be called, extrude along a curve, sweep, rail or bi-rail.
The extrusion path, is what you can call a rail, if you had 2 rails then you will use a bi-rail, the shape or curve you extrude is called a generation curve. Using more than one curve to define the extrusion shape allows for changing the form along the rail/rails.
Skin or loft is probably one of the most simple algorithms, you create 2 or more curves and a surface is blended in between.
-Patch/Square/Cap Holes/Network Surface
I am lumping here, completely unrelated tools, this is only for the sake of minimizing space and of simplification.
These tools, somehow, interpolates the boundaries and create a surface. All NURBS surface tools are similar in basic principle, to consider 2 tools as an example, take the square tool and the bi-rail algorithm; the bi-rail blends the generation curves and sweeps across the rails while the square blends 2 curves in the U direction and 2 in the V direction.
I presume you are familiar with the revolve tool. Interesting to note that it's only a special case of an extrude along a path or a single rail tool; the path being of course a circle or part of it.
- A gentle reminder that all NURBS surfaces are actually patches, you can look at what happens when you miss around with the pole control vertices of a NURBS sphere primitive in Alias Automotive. (notice the hole on top created by simply moving the vertices away from meeting point/pole, In general, it would be better to avoid any patch which squeezes into one end forming a triangle, instead, create a rectangular patch and trim it.)
But wait, a lot of 3D models created with NURBS don't look like square patches!
The ability to quickly AND accurately intersect and subtract objects, project and trim curves, is unique to NURBS modeling software and is very powerful, especially when used with fillet and chamfer tools.
Polygon modeling tools have improved boolean tools, ZBrush has a very handy boolean feature with dynamesh, and it is probably a matter of time until we have a trim feature similar to NURBS inside a polygon modeling tool. but so far, they fall short of NURBS booleans accuracy level and easy controls for fillets and blends.
3D modeling operations are almost invariably a combination of simpler procedures, in the case of booleans, the procedures can be put as following: an intersection, a splitting based on the intersection, then deleting any parts not wanted and joining them back together. (I got this simplification from Robert McNeel Wiki)
In the beginning of the learning process, it can be a hurdle to figure out all the boolean operations necessary to create a simple surface, but once you figure out a few, it will be a quicker process.
Beat that polygons!
Before talking about alignment, it is best to explain the term continuity. Because NURBS creates one large surface/solid out of patches trimmed and intersecting, there is always a concern if they are connected or have any gaps in between.
Another concern, is not only gaps, but how patches blend between one another, and how reflection streaks look like and transition, which gets us into continuity terms and definitions explained below. All of these continuity levels measure to a specified tolerance level that you set; such as 0.01 of a millimeter for distance or 0.1 degree of an angle.
As explained in the preceding continuity section, to achieve G0 continuity you need to have the curve or surfaces connecting at every point with no gaps at all, but what about G1,G2, etc..?
The process of alignment and surface blending is quite simple in principle:
What we call a tangent, represents the slope or how a curve or surface is changing at any point.
when you align a curve/surface to another with G1 continuity, the alignment tool will attempt to move the control vertices of the curve, so that its tangent matches the original one at the end points. And both would seem as if blending seamlessly
For achieving continuity levels of G2,G3 etc... it's not enough to only have the tangents matching, but you need to have the tangent sloping smoothly, which results in moving some of the control vertices further away from the curves/surfaces meeting points.
Combination of two or more tools
I would like to point out that tools like fillet, chamfer, blend and freeform blend or any tool that seems to do quite a lot with little effort, is usually only a combination of few basic tools. Knowing this, really helps demystify some of the magic surrounding the process.
Luckily, I can save my typing effort and link two short videos that show how in Alias Automotive, the freeform blend tool is just a combination of trim, skin and align and similarly with blend curves:
Alias Blend Curves - Free Form Blend. If you are just starting out with NURBS, it might be too early to to check these videos now, but later on you could watch it to see how blend curves are simply a combination of simpler tools.
Measurement and Evaluation Tools
I am demonstrating here some of the measurement and evaluation tools found in Alias Automotive:
Measurement: distances, radii and angles can all be measured accurately.
Curve Curvature: also known as a comb plot, it shows how a curve is curving, calculates a circle radius at a segment of a curve. Good to know how smooth a curve is and where you have breaks in curvature. (more here)
Surface Curvature in Cross Sections and Colors: similar to curve curvature only applied to surfaces. Using colors could come in handy to see how your surface is flowing in different directions. (more here)
Reflection Maps/Lines and Iso Angles: Probably the most intuitive way to quickly judge how good is your surface, and if you have any obvious breaks or distortions, as an alternative you can use a reflection map in any modeling software. (more here)
I compiled quick steps of creating different simple models in NURBS, These don't show any specific tools or step by step instructions, but are just to show you how things are generally modeled in NURBS and give you an idea.
So far, all has been theoretical, the best way to learn of course is to start creating forms directly into any NURBS modeling software. This was merely a brief introduction for modelers out there who still haven't incorporated NURBS modeling into their workflow, and to give a general idea on the whole process.
I used Alias automotive and Rhinoceros when making my study and examples. Please feel free to explore any software on your own. Fusion 360 is pretty good and If you are interested in a simpler software you can also consider MOI 3D.
One final note on wireframes and topology. You can't use NURBS if you are creating a model for real-time use or for animating deformations, but if you can handle a high poly count, you probably don't need to worry about the messy wireframe that NURBS produces.