Trimming NURBS Surfaces

Trim curves can be used for cutting NURBS meshes. For example, one can drill a hole in a NURBS mesh using a circular trim curve. There are several ways to create a trim curve. You can select various trim curve tools from the NURBS tool tab. Also, you can use the Unified tools from the Tools - Unified menu, like shown in the following examples.

The unified creation tools create trim curves with a freeform, circular or rectangular shape.

To create a freeform trim curve:

1. Create a NURBS mesh using the Sweep tool, or simply use the NURBS rectangle tool and set the U and V parameters to a value of 8.

2. Select the mesh and activate the Tools/Unified/Create curve tool from the menu. As usual, you can now see the curve tool specific options in the control bar. Set the Class option to Trim Curve and make sure the Closed option is checked.

Set the Class option to Trim Curve to create a trim curve

3. Click the mouse over the mesh to define control points for the trim curve. When done, accept the tool.

[Note] Note
A trim curve is an object whose geometry is defined in the parameter space (also called the uv space) of the parent mesh. Therefore, when creating trim curves, the position of the mouse pointer must be within the borders of the parent mesh.
A trim curve created for the selected mesh
A trimmed mesh

The mesh now consists of three curves: the original construction curves plus one trim curve.

[Note] Note
If you created the first mesh using the NURBS rectangle tool, the hierarchy consists of only the mesh and the trim curve.

Modifying trim curves

Trim curves can be modified just like ordinary NURBS curves. For example, to move the trim curve to the left top edge of the mesh, just select the trim curve and use the Move tool as usual.

[Note] Note
In order to transform a trim curve, you always have to click the mouse over the mesh. Otherwise, the transformation tool will not be able to compute the necessary transformation in the parameter space of the mesh.

Switch on the bounding box through 'w' compass menu

You can also use the standard transformation handles to modify trim curves. As usual, you can switch transformation handles on and off using the 'w' compass menu. For example, you can modify trim curves through their bounding box. To be able to see the bounding box, select the trim curve and right click in the view window, to get the pop-up menu. Select Handles/Bounding box. Then use the 'w' compass menu like shown here. If the planar mesh is flat, the bounding box has a rectangular shape.

Move the trim curve by dragging the bounding box

Just like regular NURBS curves, also trim curves can be single point edited in the edit mode. As usual, hit the space bar to enter the edit mode and drag points to move them. You can also multi select any number of control points and apply standard transformation tools, such as move, scale and rotate, to the selected points.

When you select a trim curve, the control bar shows you a number of tools which can be used for manipulating the curve. We have already demonstrated most of these tools in the context of NURBS curves.

A trim curve in the Edit mode
Trim curve specific tools

Trim curves can be duplicated in the same way as any geometric objects. For example, just hold down the copy modifier (Ctrl) while moving the trim curve.

You can copy trim curves using standard Edit/Cut, Paste and Duplicate tools. For example, cut a trim curve from one mesh and paste it inside another mesh. Or, use simple drag&drop in the select window to move trim curves in the object hierarchy. Because trim curves are defined in the parameter space of the mesh, all deformations you apply to the mesh will also deform the trim curve accordingly. For example, if you modify either of the two sweep curves, the trim curve gets modified with the mesh accordingly.

Tutorial project: tutorprojects\modeling\nurbs\trim curves\trimmed mesh

Ctrl+drag to duplicate a trim curve like any other geometric object

Boolean operations of trim curves

The general Boolean operations work also for trim curves. The difference is that since trim curves are defined in the two dimensional uv space', also the Boolean operations are applied in a two dimensional space.

All the three standard Boolean operations are supported: Union (OR), Intersection (AND) and Exclusive Or (XOR).

Boolean operation is an attribute of the actual NURBS mesh. You can select the desired Boolean operation method from the property window's Spec tab.

The Boolean attribute of the mesh

The following three images demonstrate the effect of different Boolean operations.

Difference (XOR)
Intersection (AND)
Union (OR)

Just like you can invert the Boolean operation of a regular 3D Boolean object, you can invert the Boolean operation between the trim curves of a mesh. Just check the Invert Boolean option through the property gadget of the NURBS mesh.

The Invert Boolean option inverts the inside/outside property of trim curves so that what was inside before becomes outside.

The property window for the NURBS mesh: Boolean operation set to Union and result Inverted

In addition to inverting the top level Boolean operation of trim curves associated with a mesh, you can invert an individual trim curve.

Trimming side inverted

To do this, select the trim curve and go to the property window's Gen tab. Check the Volume Inverted property (see the Boolean operations between true 3D objects).

These three attributes give you total control over Boolean operations between trim curves.

Trim curve 1 AND NOT trim curve 2

Converting trim curves to regular NURBS curves

Let's assume you have a trim curve and you need to convert it to a standard NURBS curve. The To 3D tool does this. Just select a trim curve and click the To 3D tool to map the trim curve to 3D space.

This tool creates a regular NURBS curve, which passes through the control points of the trim curve. As a result, the shape of the 3D curve changes! The reason is that the uv space of a mesh is usually curved whereas the 3D model space is neatly linear. The more control points the trim curve has, the more accurately the curves match.

Converting NURBS curves to trim curves

It is also possible to map the control points of a regular NURBS curve to the parameter space of a mesh.

To create a trim curve from a NURBS curve:

1. Create a NURBS mesh using, for example, the NURBS/Rectangle tool.

2. Create a closed NURBS curve over the mesh. In the select window, drag & drop the curve inside the mesh. You now have a NURBS mesh, which includes one NURBS curve.

Create a NURBS curve inside a mesh

3. Select the NURBS curve. The control bar now shows you a number of NURBS curve specific tools. Click the Trim tool.

[Note] Note
Use the Trim Parent tool in the second row of the toolbar, not the icon of the Create Trimmed Surface tool described in the next example.

[Note] Note
In this operation, the shape of the created trim curve does not usually match the shape of the original curve exactly. The more control points the curve has, the more accurately the trim curve follows the original NURBS curve.

Projecting curves to trim curves

It is also possible to convert a NURBS curve to a trim curve by using the current transformation of a view window. In this method, the control points of a NURBS curve are not snapped to the nearest surface points. Instead, they are projected to the surface behind them.

1. Create a curved NURBS mesh and a closed NURBS curve, as shown in the next picture.

2. Select the mesh and the curve. Then rotate the view window to find a desired projection.

3. Then select the Tools/Nurbs Construction/Create Trimmed Surface tool and click Accept.

A NURBS surface and a NURBS curve
Rotate the view window until the curve is in right place over the mesh
A NURBS curve projected onto a mesh