Maya: Trimmed Surfaces for NURBS



Pencil Trim Tutorial

In the Modeling module
Choose Create NURBS Primitives->Cylinder->option.jpg
Select Axis  Z
Input Height 12
Input Number of Sections  18
Select Caps none
Click on Create

Pick the select by component type button scomponent.jpg and point components point_component in the status line near the top.

Hold down the Shift key and draw a box to pick every third group of CVs around the circular part of the cylinder, from the front view.

Select the Rotate Tool buttonmrotate.jpg from the side tool box.  Interactively rotate the active CVs counter clockwise until they are close to the neighboring CV.

Click the background of any view to select nothing.

Hold down the Shift key and draw a box to pick every third group of CVs. (see arrows on diagram)

pencilpickcvs.jpg        pencilprofile.jpg

Select the Rotate Tool  mrotate.jpg  and interactively rotate the active CVs clockwise until they are close to the neighboring CV.

Pencil Tip
Select Create->NURBS Primitives->Cone->option.jpg
Select Axis  Z
Input Radius 1.2
Input Height 4.8
Input Number of Sections  6
Click on Create

Pick the select by object type button. sobject.jpg

Select the Move Tool button.  mmove.jpg

Move the cone down the Z axis so it intersects the pencil body closer to the tip.



Use detach to cut a pencil tip, this will save a lot of memory compared to using trim.
In object type  mode, select the cone.

Move the mouse over the cone, hold down the right mouse button to bring up the object menu, select isoparm. Click and drag on one of the vertical isoparms to select it and move it to where you want the tip.

Select Surfaces->Detach

Intersect the Pencil Body and the Cone

Pick both the pencil body and the cone.

Use Surfaces->Intersect->option.jpg
     Input Tolerance:   .0001

Curves on surface
are created on both surfaces.

Click the pencil body
Use Surfaces->Trim Tool

Click the region you wish to keep, pick towards the back, a yellow marker will appear.
Hit Enter
Trim will hide the front.

Repeat this for the cone.

Create a linear curve and use Surfaces->Revolve around the Z axis to create the eraser barrel.

Create Cubic curve and use Surfaces->Revolve to create the eraser.

Convert the NURBS shapes to polygons for Unity
Select all the NURBS surfaces

Select Modify->Convert NURBS to Polygons->option.jpg
     Choose Quads

     Choose Tessellation method: General
     Change U type to: Per span # of iso params
     Change V type to: Per span # of iso params
     Input Number U: 3   (If this is too jaggy, increase)
     Input Number V:  1
     Hit Apply

Move the converted Polygon obects over along an axis, the NURBS surfaces are still there.

You can individually select the items such as the cone and change the divisions to 1 along the straight axis,
Channel editor
     Open nurbsTesselate
          set U Number to 1
(The eraser barrel uses 1 in the V Number.)

Hide the NURBS surfaces in a layer

Select all the Poly surfaces and choose Mesh->Combine to group everything together into one poly shape.

Select the sharp edges of the barrel and use Mesh Display->Harden Edge


Another Trim Method to try: Project:
Perhaps the best analogy for the projection trim would be the cookie cutter and cookie dough. The cutter is projected into the dough (object) in order to produce the desired form.

Place a sphere in the scene. Scale it up a bit.

Draw a closed curve in the front window that will be our cookie cutter shape. This curve should overlap the sphere.

Pick the sphere and the curve from the front window, this will designate the front view as the axis to project along.

Use Surfaces->Project Curve on Surface
A couple of curves on surface were created on the sphere.

Click the sphere
Use Surfaces->Trim Tool
Click the region you wish to keep. Trim will hide the rest.
Hit Enter

Things to try:
  Try this with more than one projecting curve. Compare open curves versus closed. Project down different axes by picking different views before projecting. Try moving the projecting curve after trimming. The trim hole will update or change as you move the curve around.

*** Warning: Trim's history uses a lot of calculation, use Edit->Delete by Type->History to clear this up. Otherwise, Maya will grind to a halt eventually.