Extrude SOP

From TouchDesigner 088 Wiki

Summary

The Extrude SOP can be used for:

  • Extruding and bevelling Text and other geometry
  • Cusping the bevelled edges to get sharp edges
  • Making primitives thicker or thinner

In order to do so, it uses the normal of the surface to determine the direction of extrusion. In the case of planar or open polygons, the normal is difficult to determine, and may not always provide the result that you expect. Turn on the Primitive Normals display in the Viewer display options to see the normals.

PythonIcon.png extrudeSOP_Class

Parameters

Source Group /sourceGrp - If there are input groups, specifying a group name in this field will cause this SOP to act only upon the group specified for the source. Accepts patterns, as described in Pattern Matching.

X-Section Group /xsectionGrp - If there are input groups, specifying a group name in this field will cause this SOP to act only upon the group specified for the cross-section. Accepts patterns, as described in Pattern Matching.

Parameters - Value Page

Fuse Points /doFuse - This should almost always be turned on when cross-sections are used. It consolidates points of polygons that would otherwise cross or overlap when the bevel takes place.

Front Face /frontType - Control how the front face of the extrusion should be built. You may wish to have a "No Output" because some faces are never actually seen when doing animation and, therefore, would only take up additional overhead if left on.

  • No Output - No face is created.
  • Output Face - Faces are created.
  • Convex Face - Create faces built with Convex Polygons (use this option if faces are to be deformed, i.e. Twist SOP, Lattice SOP).

Back Face /backType - This value controls whether or not the back of the extruded object will have a face or not. The options are the same as the Front Face options above.

Side Mesh /sideType - Controls how the cross-section(s) will be extruded. If the input cross-section is a Bzier or NURBS curve, the surface will be constructed with a patch of the same geometry type.

  • No - Output No mesh is created.
  • Rows - Creates horizontal lines.
  • Columns - Creates vertical lines.
  • Rows & Cols - Both Rows and Columns. Looks like Quads in wire frame display, but all polygons are open (if the primitive type is polygon). Compare them in the Model Editor.
  • Triangles - Build the grid with Triangles.
  • Quadrilaterals - Generates sides composed of quadrilaterals (default).
  • Alternating Triangles - Generates triangles that are opposed; similar to the Triangles option.

Initialize Extrusion /initExtrude - If the cross-section face that you created doesn't match up nicely to the size of the geometry you are extruding, this command will scale and translate it so that it fits nicely.

The reason it might not be nice to begin with is that the curve wasn't drawn exactly on the world-axis in Model-mode and/or was drawn at a grossly different scale than the object it is extruding.

Thickness /thickxlate /thickscale - The first value controls the scale of the cross-section profile. There is no effect if a straight (default) cross-section is used. The second value controls the height of the extrusion. Negative scaling values are valid.

Why Two Parameters? Internally, the two Thickness parameters control the individual scale and offsets for the X and Y values of the cross-section. So if the X points = 0 (vertical) then the /thickscale parameter doesn't have any affect.

Depth /depthxlate /depthscale - The first value moves the entire extrusion forward or backwards in the direction of the extrusion. The second value controls the distance between the cross-section and the source input curves.

Vertex /vertex - Translates the cross-section such that the vertex specified is at the cross-section origin.

Cusp Polygonal Sides /doCusp - Determines whether or not sides are to be smooth-shaded or faceted using the angle value in Side Cusp Angle field.

Cusping lets you specify at which angle between adjacent polygons, a sharp edge (faceted edge where vertices are un-shared) should be displayed instead.

Side Cusp Angle /cuspangle - When checked, this value will control the angle at which faceting of the sides will occur. A value of 20 is default.

Consolidate Faces To Mesh /shareFaces - If selected the extrusion will share points between the front face and the first row of the side mesh and between the last face and the last row of the side mesh.

Remove Shared Sides /removeSharedSides - Prevents the creation of duplicate sides.

Parameters - Group Page

Create Output Groups /newg - When this option is checked, it causes the Extrude SOP to generate three new groups representing the primitives belonging to the front faces, back faces, and the side bevel/extrusion. The name of the groups are determined by the three option fields below.

  • Front Group /frontgrp - Output group name to create for front face geometry.
  • Back Group /backgrp - Output group name to create for back face geometry.
  • Side Group /sidegrp - Output group name to create for side bevel/extrude geometry.

Inputs / Geometry Types

Source Input - Input the SOP containing the curves that you want to extrude. The input can be polygons, Bzier curves, NURBS curves, or any combination of the three types.

Cross-Section - Input The SOP on this input will be used to define a cross-section. If not specified, a straight line is used to extrude the object. This cross-section should be an open Bzier, NURBS, or polygon drawn in the XY Plane.

Production Tips

This SOP is mainly used for generating bevels and extrusions of text where the input cross-sections are fed from a Font SOP. Any curve or group of curves can also be used as input.

Offsets - This SOP can be used for generating two offsetting curves where the distance between the two curves remains constant. To do this, make sure that you set Side Mesh to No Output, the first thickness to zero and adjust the second to increase or decrease the distance of the offset.

Fixing Stray Normals - If your geometry contains normals that are pointed in many directions (say after reading geometry from a File In SOP, or if you have a lot of open or non-planar polygons), you can fix it so that they are suitable for extrusion.

Do this by appending a Group SOP to the SOP that contains your geometry, enable Normal, and reduce the Spread Angle to something less than 180. Then append a Primitive SOP, which should work on the group made in the Group SOP. In the Face/Hull page, set the Vertex menu to Reverse.

Now the normals in your geometry will all be oriented in the roughly the same direction, and ready for extrusion. To narrow the tolerance, decrease the Spread Angle further.