Manual/PartII/Curves

Wikipedia,自由的百科全书

User Manual: Contents | Guidelines | Blender Version 2.32

Contents

Curves|曲线

Curves and Surfaces are objects just as meshes are objects except they differ in that they are expressed in terms of mathematical functions, rather than as a series of points. 曲线和曲面是同网格一样的物体,不同点在于他们的数学表达式是不想同的,更象是一系列的点来表示。 Blender implements both Bézier and Non Uniform Rational B-Splines (NURBS) curves and surfaces. Both are defined in terms of a set of "control vertices" which define a "control polygon", though each follow a different set of mathematical laws. The way the curve and the surface are interpolated might seem similar, at first glance, to Catmull-Clark subdivision surfaces. The curve is interpolated while the surface is attracted. Blender实现了贝齐尔曲线和非均匀B样条曲线(NURBS)和曲面。他们都是用的一组“控制点”来定义的“控制多边形”来详细定义,只是服从于不同的数学规则。曲线和曲面的插值大概初看起来跟Catmull-Clark 的细分曲面没什么区别。曲线是“插值”,曲面是“吸附”。 When compared to meshes, curves and surfaces have both advantages and disadvantages. Because curves are defined by less data, they produce nice results using less memory at modelling time, whereas the demands increase at rendering time. 相对网格而言,曲线和曲面有自己的优点和缺点。因为曲线是用很少的数据来定义,在建模的时候他们用很少的内存显示出很好的效果,只是在渲染的时候需要增加一些时间。

Some modelling techniques, such as extruding a profile along a path, are only possible with curves. But the very fine control available on a per-vertex basis on a mesh, is not possible with curves. 很多建模技术,比如沿一条路径挤压一条轮廓,只能在曲线

There are times when curves and surfaces are more advantageous than meshes, and times when meshes are more useful. If you have read the chapter on Basic Mesh Modelling and Advanced Mesh Modelling, and you read this chapter, you will be able to choose whether to use meshes or curves.

This section describes both Bézier and NURBS curves, and shows a working example of the former.

Béziers

Bézier curves are the most commonly used type for designing letters or logos. They are also widely used in animation, both as paths for objects to move along and as IPO curves to change the properties of objects as a function of time.

A control point (vertex) of a Bézier curve consists of a point and two handles. The point, in the middle, is used to move the entire control point; selecting it also selects the other two handles, and allows you to move the complete vertex. Selecting one or two of the other handles allows you to change the shape of the curve by dragging the handles.

A Bézier curve is tangent to the line segment which goes from the point to the handle. The 'steepness' of the curve is controlled by the handle's length.

There are four types of handles (Types of Handles for Bézier curves):

  • Free Handle (black). This can be used in any way you wish. Hotkey: HKEY (toggles between Free and Aligned);
  • Aligned Handle (purple). These handles always lie in a straight line. Hotkey: HKEY (toggles between Free and Aligned);
  • Vector Handle (green). Both parts of a handle always point to the previous handle or the next handle. Hotkey: VKEY;
  • Auto Handle (yellow). This handle has a completely automatic length and direction, set by Blender to ensure the smoothest result. Hotkey: SHIFT-H.
Types of Handles for Bézier curves
Types of Handles for Bézier curves

Handles can be grabbed, rotated and scaled exactly as ordinary vertices in a mesh would. As soon as the handles are moved, the type is modified automatically:

  • Auto Handle becomes Aligned;
  • Vector Handle becomes Free.

Although the Bézier curve is a continuous mathematical object it must nevertheless be represented in discrete form from a rendering point of view. This is done by setting a resolution property, which defines the number of points which are computed between every pair of control points.

A separate resolution can be set for each Bézier curve (Setting Bézier resolution.).

Setting Bézier resolution.
Setting Bézier resolution.

NURBS

NURBS curves are defined as rational polynomials, and are more general, strictly speaking, than conventional B-Splines and Bézier curves inasmuch they are able to exactly follow any contour. For example a Bézier circle is a polynomial approximation of a circle, and this approximation is noticeable, whereas a NURBS circle is exactly a circle. NURBS curves have a large set of variables, which allow you to create mathematically pure forms (Nurbs Control Buttons.). However, working with them requires a little more theory:

Nurbs Control Buttons.
Nurbs Control Buttons.
  • Knots. Nurbs curves have a knot vector, a row of numbers that specifies the parametric definition of the curve. Two pre-sets are important for this. Uniform produces a uniform division for closed curves, but when used with open ones you will get "free" ends, which are difficult to locate precisely. Endpoint sets the knots in such a way that the first and last vertices are always part of the curve, which makes them much easier to place;
  • Order. The order is the 'depth' of the curve calculation. Order '1' is a point, order '2' is linear, order '3' is quadratic, and so on. Always use order '5' for Curve paths because it behaves fluidly under all circumstances, without producing irritating discontinuities in the movement. Mathematically speaking this is the order of both the Numerator and the Denominator of the rational polynomial defining the NURBS;
  • Weight. Nurbs curves have a 'weight' per vertex - the extent to which a vertex participates in the "pulling" of the curve.
Setting Nurbs Control polygon and weights.
Setting Nurbs Control polygon and weights.

Setting Nurbs Control polygon and weights. shows the Knot vector settings as well as the effect of varying a single knot weight. As with Béziers, the resolution can be set on a per curve basis.

Working example

Blender's curve tools provide a quick and easy way to build great looking extruded text and logos. We will use these tools to turn a rough sketch of a logo into a finished 3D object. The sketched logo shows the design of the logo we will be building.

The sketched logo
The sketched logo

First, we will import our original sketch so that we can use it as a template. Blender supports TGA, PNG, and JPG format images. To load the image, select the View>>Background Image... menu entry of the 3D Window you are using. A transparent panel will appear, allowing you to select a picture to use as a background. Activate the BackGroundPic button and use the LOAD button to locate the image you want to use as a template (3D window settings.). You can set the "strength" of the background pic with the Blend slider.

3D window settings.
3D window settings.

Get rid of the Panel with ESC or by pressing the X button in the panel header (Logo sketch loaded as background). You can hide the background image when you are finished using it by returning to the Panel and deselecting the BackGroundPic button.

Logo sketch loaded as background
Logo sketch loaded as background

Add a new curve by pressing SPACE>>Curve>>Bezier Curve. A curved segment will appear and Blender will enter EditMode. We will move and add points to make a closed shape that describes the logo you are trying to trace.

You can add points to the curve by selecting one of the two endpoints, then holding CTRL and clicking LMB. Note that the new point will be connected to the previously selected point. Once a point has been added, it can be moved by selecting the control vertex and pressing GKEY. You can change the angle of the curve by grabbing and moving the handles associated with each vertex (Bézier handles).

Bézier handles
Bézier handles

You can add a new point between two existing points by selecting the two points and pressing WKEY>>Subdivide (Adding a Control Point.).

Adding a Control Point.
Adding a Control Point.

Points can be removed by selecting them and pressing XKEY>>Selected. To cut a curve in two, select two adjacent control vertices and press XKEY>>Segment.

To make sharp corners, select a control vertex and press VKEY. You will notice that the color of the handles changes from purple to green (Vector (green) handles.). At this point, you can move the handles to adjust the way the curve enters and leaves the control vertex (Free (black) handles.).

Vector (green) handles.
Vector (green) handles.
Free (black) handles.
Free (black) handles.

To close the curve and turn it into a single continuous loop, select at least one of the control vertices on the curve and press CKEY. This will connect the last point in the curve with the first one (The finished outline.). You may need to manipulate additional handles to get the shape you want.

The finished outline.
The finished outline.

Leaving EditMode with TAB and entering shaded mode with ZKEY should reveal that the curve renders as a solid shape (Shaded logo.). We want to cut some holes into this shape to represent the eyes and wing details of the dragon.

Surfaces and Holes: When working with curves, Blender automatically detects holes in the surface and handles them accordingly to the following rules. A closed curve is always considered the boundary of a surface and hence rendered as a flat surface. If a closed curve is completely included within another one, the inner one is subtracted from the outer one, effectively defining a hole.
Shaded logo.
Shaded logo.

Return to wireframe mode with ZKEY and enter EditMode again with TAB. While still in EditMode, add a circle curve with SPACE>>Curve>>Bezier Circle (Adding a circle.). Scale the circle down to an appropriate size with SKEY and move it with GKEY.

Adding a circle.
Adding a circle.

Shape the circle using the techniques we have learned (Defining the eye.). Remember to add vertices to the circle with WKEY>>Subdivide.

Defining the eye.
Defining the eye.

Create a wing cutout by adding a Bézier circle, converting all of the points to sharp corners, and then adjusting as necessary. You can duplicate this outline to save time when creating the second wing cutout. To do so, make sure no points are selected, then move the cursor over one of the vertices in the first wing cutout and select all linked points with LKEY (Defining the wings.). Duplicate the selection with SHIFT-D and move the new points into position.

Defining the wings.
Defining the wings.

To add more geometry that is not connected to the main body (placing an orb in the dragon's curved tail for example), use the SHIFT-A menu to add more curves as shown in Orb placement within the tail..

Orb placement within the tail.
Orb placement within the tail.

Now that we have the curve, we need to set its thickness and beveling options. With the curve selected, go to the EditButtons (F9) and locate the Curves and Surface panel. The Ext1 parameter sets the thickness of the extrusion while Ext2 sets the size of the bevel. BevResol sets how sharp or curved the bevel will be.

Bevel settings shows the settings used to extrude this curve.

Bevel settings
Bevel settings
From Curves to Meshes: To perform more complex modelling operations, convert

the curve to a mesh with ALT-C>>Mesh. Note that this is a one-way operation: you cannot convert a mesh back into a curve.

When your logo model is complete, you can add materials and lights and make a nice rendering (Final rendering.).

Final rendering.
Final rendering.

Extrude Along Path

The "Extrude along path" technique is a very powerful modelling tool. It consists of creating a surface by sweeping a given profile along a given path.

‘路径挤压’技术是一个非常强大的建模工具。 它通过由给定的轮廓线沿着指定的路径伸展,就能创建一个面。


Both the profile and the path can be a Bézier or a NURBS curve.

轮廓线和路径可以是贝兹曲线或者是NURBS曲线。


Let's assume you have added a Bézier curve and a Bézier circle as separate objects to your scene (Profile (left) and path (right).).

让我们假设你已经把一条曲线和一个圆作为分别的物体加入到你的场景了(左为轮廓线 右为路径)。


Profile (left) and path (right).
Profile (left) and path (right).

Play a bit with both to obtain a nice 'wing-like' profile and a fancy path (Modified profile (left) and path (right).). By default, Béziers exist only on a plane, and are 2D objects. To make the path span in all three directions of space, as in the example shown above, press the 3D button in the EditButtons (F9) Curve and Surface panel (3D Curve button.).

对两个做一些编辑,这样得到一个漂亮的类翼轮廓线和一个有趣的路径(修改后的轮廓线(左)和路径(右))。一般情况下,贝兹曲线只待在平面上,是2d 对象。 要让路径在三维空间伸展, 就像下面例子展示的, 点EditButton(f9) curve and surface 面板里的 3D button

Modified profile (left) and path (right).
Modified profile (left) and path (right).
3D Curve button.
3D Curve button.

Now look at the name of the profile object. By default it is "CurveCircle" and it is shown on the NKEY panel when it is selected. You can change it by SHIFT-LMB on the name, if you like (Profile name.).

现在看下轮廓线对象的名字, 缺省值为 "CurveCircle" 当它被选中时显示在NKEY面板上。 你可以在名字上 shift-lmb 来改变它的值, 如果你愿意.

Profile name.
Profile name.

Now select the path. In its EditButtons locate the BevOb: Text Button in the Curve and Surface panel and write in there the name of the profile object. In our case "CurveCircle" (Specify the Profile on the path.).


Specify the Profile on the path.
Specify the Profile on the path.

The result is a surface defined by the Profile, sweeping along the path (Extrusion result.).

Extrusion result.
Extrusion result.

To understand the results, and hence obtain the desired effects it is important to understand the following points:

  • The profile is oriented so that its z-axis is tangent (i.e. directed along) the path and that its x-axis is on the plane of the path; consequently the y-axis is orthogonal to the plane of the path;
  • If the path is 3D the "plane of the path" is defined locally rather than globally and is visually rendered, in EditMode, by several short segments perpendicular to the path (Path local plane.);
  • The y-axis of the profile always points upwards. This is often a source of unexpected results and problems, as we'll explain later on.
Path local plane.
Path local plane.
Tilting: To modify the orientation of the local path plane select a control

point and press TKEY. Then move the mouse to change the orientation of the short segments smoothly in the neighborhood of the control point. LMB fixes the position, and ESC reverts to previous state.

With the y-axis constrained upwards, unexpected results can occur when the path is 3D and the profile being extruded comes to a point where the path is exactly vertical. Indeed if the path goes vertical and then continues to bend there is a point where the y-axis of the profile should begin to point downwards. If this occurs, since the y-axis is constrained to point upwards there is an abrupt 180° rotation of the profile, so that the y-axis points upwards again.

Extrusion problems due to y-axis constraint. shows the problem. On the left there is a path whose steepness is such that the normal to the local path plane is always upward. On the right we see a path where, at the point circled in yellow, such a normal begins to point down. The result of the extrusion presents an abrupt turn there.

Extrusion problems due to y-axis constraint.
Extrusion problems due to y-axis constraint.

The only solutions to this problems are: To use multiple - matching - paths, or to carefully tilt the path to ensure that a normal always points upwards.

Changing profile orientation: If the orientation of the profile along the curve is not as youexpected, and you want to rotate it for the entire path length, there is a better way to do so than tilting all path control points. You can simply rotate the profile in EditMode on its plane. This way the profile will change but its local reference will not.

Curve Taper

Taper is a tool for bevelled curve objects. In the Edit panel (F9) you have a TaperOb field where you put the name of the curve that will define the width of extrusion of the 'Bevel Object' (BevOb) along the curve. The 'Taper Object' curve typically is horizontal, where the height (local Y) denotes the scale of the width. Here a 'CurveCircle' was used to bevel, another 'Curve' to taper (Curve and Surface panel).

Curve and Surface panel
Curve and Surface panel
Important rules:
  • Only the first curve in a TaperOb is evaluated (if you've got several separate segments).
  • The first width is left, last width is right.
  • Negative widths (negative local Y of the Taper Curve) are possible too, but rendering can cause artifacts.
  • It scales the width of normal extrusions based on evaluating the taper curve, which means sharp corners in taper curve won't be easily visible.
Taper example 1
Taper example 1

In Taper example 1 you can clearly see the effect the left taper curve has on the right curve object. Here the left taper curve is closer to the object center and that results in a smaller curve object to the right.

Taper example 2
Taper example 2

In Taper example 2 a control point in the taper curve to the left is moved away from the center and that gives a wider result to the curve object on the right.

Note:

The curve object is extruded with a curve circle. (See Extrude Along Path for more on curve extruding).

In Taper example 3, we see the use of a more irregular taper curve added to a curve circle.

Taper example 3
Taper example 3

Skinning

Skinning is the fine art of defining a surface using two or more profiles. In Blender you do so by preparing as many curves of the the desired shape and then converting them to a single NURBS surface.

As an example we will create a sailboat. The first thing to do, in side view (NUM3), is to add a Surface Curve. Be sure to add a Surface curve and not a curve of Bézier or NURBS flavour, or the trick won't work (A Surface curve for skinning.).

A Surface curve for skinning.
A Surface curve for skinning.

Give the curve the shape of the middle cross section of the boat, by adding vertices as needed with the Split button and, possibly, by setting the NURBS to Endpoint both on 'U' and 'V' (Profile of the ship.) as needed.

Profile of the ship.
Profile of the ship.

Now duplicate (SHIFT-D) the curve as many times as necessary, to the left and to the right (Multiple profiles along ship's axis.). Adjust the curves to match the various sections of the ship at different points along its length. To this end, blueprints help a lot. You can load a blueprint on the background (as we did for the logo design in this chapter) to prepare all the cross section profiles (Multiple profiles of the correct shapes.).

Note that the surface we'll produce will transition smoothly from one profile to the next. To create abrupt changes you would need to place profiles quite close to each other, as is the case for the profile selected in Multiple profiles of the correct shapes..

Multiple profiles along ship's axis.
Multiple profiles along ship's axis.
Multiple profiles of the correct shapes.
Multiple profiles of the correct shapes.

Now select all curves (with AKEY or BKEY), and join them by pressing CTRL-J and by answering Yes to the question 'Join selected NURBS?'. The profiles are all highlighted in Joined profiles..

Joined profiles.
Joined profiles.

Now switch to EditMode (TAB) and select all control points with AKEY; then press FKEY. The profiles should be 'skinned' and converted to a surface (Skinned surface in edit mode.).

Note: As should be evident from the first and last profiles in this example, the cross-sections need not be defined on a family of mutually orthogonal planes.
Skinned surface in edit mode.
Skinned surface in edit mode.

Tweak the surface, if necessary, by moving the control points. Final hull. shows a shaded view. You will very probably need to increase ResolU and RelolV to obtain a better shape.

Final hull.
Final hull.
Profile setup: The only limitation to this otherwise very powerful technique is that all profiles must exhibit the same number of control points. This is why it is a good idea to model the most complex cross section first and then duplicate it, moving control points as needed, without adding or removing them, as we've shown in this example.

Curve Deform

Curve Deform provides a simple but efficient method of defining a deformation on a mesh. By parenting a mesh object to a curve, you can deform the mesh up or down the curve by moving the mesh along, or orthogonal to, the dominant axis. The Curve Deform works on a dominant axis, X, Y, or Z. This means that when you move your mesh in the dominant direction, the mesh will traverse along the curve. Moving the mesh in an orthogonal direction will move the mesh object closer or further away from the curve. The default settings in Blender map the Y axis to the dominant axis. When you move the object beyond the curve endings the object will continue to deform based on the direction vector of the curve endings.

A Tip:

Try to position your object over the curve while moving it around. This gives the best control over how the deformation works.

Interface

When parenting a mesh to a curve (CTRL-P), you will be presented with a menu, Make Parent menu.. By selecting Curve Deform you enable the Curve Deform function on the mesh object.

Make Parent menu.
Make Parent menu.

The dominant axis setting is set on the mesh object. By default the dominant axis in Blender is Y. This can be changed by selecting one of the Track X, Y or Z buttons in the Anim Panel, Anim settings panel., in Object Context (F7).

Anim settings panel.
Anim settings panel.

Cyclic curves work as expected where the object deformations traverse along the path in cycles. CurveStretch provides an option to let the mesh object stretch, or squeeze, over the entire curve. This option is in Edit Context (F9) for the curve. See Curve and Surface panel..

Curve and Surface panel.
Curve and Surface panel.

Example

Let's make a simple example.

  • Remove default cube object from scene and add a Monkey! (SHIFT-A -> Add -> Mesh -> Monkey, Add a Monkey!).
Add a Monkey!
Add a Monkey!
  • Now press TAB to exit EditMode. Now add a curve. (SHIFT-A -> Add -> Curve -> Bezier Curve, Add a Curve.).
Add a Curve.
Add a Curve.
  • While in EditMode, move the control points of the curve as shown in Edit Curve., then exit EditMode, (TAB).
Edit Curve.
Edit Curve.
  • Select the Monkey, (RMB), and then shift select the curve, (SHIFT-RMB). Press CTRL-P to open up the Make Parent menu. Select Curve Deform. (Make Parent menu.). The Monkey should be positioned on the curve as Monkey on a Curve..
Monkey on a Curve.
Monkey on a Curve.
  • Now if you select the Monkey, (RMB), and move it, (G), in the Y-direction, (the dominant axis by default), the monkey will deform nicely along the curve.
A Tip:

If you press MMB while moving the Monkey you will constrain the movement to one axis only.

  • In Monkey deformations., you can see the Monkey at different positions along the curve. To get a cleaner view over the deformation I have activated SubSurf with Subdiv 2 and Set Smooth on the Monkey mesh. (F9 to get Edit options).
A Tip:

Moving the Monkey in directions other than the dominant axis will create some odd deformations. Sometimes this is what you want to achieve, so you'll need to experiment and try it out!

Monkey deformations.
Monkey deformations.


Previous: Manual/PartII/Advanced Mesh Modelling Contents Next: Manual/PartII/Surfaces
Personal tools