Houdini 20.5 Nodes Geometry nodes

Sweep 2.0 geometry node

Creates a surface by sweeping a cross section curve along a spine curve.

On this page
Since 18.0

Overview

This node takes a cross-section curve from the second input, distributes copies of it along a spine curve from the first input, and creates a surface between the distributed cross-section curves. It is an extremely versatile workhorse for generating procedural geometry.

This node will accept polylines, NURBS curves, or Bézier curves. By default the type of input curves determine the type of surface (for example, polylines produce polygons, NURBS curves produce NURBS surfaces), however you can override the surface type using the Primitive type parameter on the Construction tab.

Instead of using modeled cross-sections connected to the second input, you can use automatic circle, square, or line cross-sections using the Surface Shape parameter.

This node can handle multiple spines, and/or multiple cross-sections.

  • If there are multiple curves in the first (spine) input, the cross-section(s) is/are swept along each spine curve separately.

  • If there are multiple curves in the second (cross-section) input, the cross-sections are distributed along the curve length according to the Cross section order parameter on the Construction tab.

This node can handle closed spines and/or closed cross-sections. (Closed means that the curve is a loop — the first and last point of the curve are the same.)

  • If both the spine and cross-section are open, the node creates an open surface.

  • If either the spine or cross-section are closed, the node creates a tube.

    When one curve is open and the other closed, creating a tube, you can automatically add end-cap geometry using the End cap type parameter on the Surface tab.

  • If both the spine and cross-section are closed, the node creates a torus.

Positioning the curves

  • Spine curves can be anywhere in space.

  • This node assumes all cross section curves are modeled at the origin in the XY plane, with +Y up direction.

    Do not model the cross-section curve on (or at the beginning of) the spine curve.

  • When the curve is flat (planar), the node assumes it should orient the up direction of the cross-sections perpendicular to the curve plane.

    After construction, you can adjust the orientation of the cross-section curve(s) relative to the spine using the Roll and Yaw parameters.

Tip

This is a technical node. It is very useful for procedurally building surfaces from cross-sections. It is not as suitable for “artistic” curve-up modeling, since this node bases cross-section orientation and positioning on parameters and/or attributes, rather than where/how you modeled the curves.

Tips

Inputs

First (Backbone curves)

Should contain one or more spine curves. If the input has multiple curves, the cross-section(s) is/are surfaced along each spine separately.

Second (Cross section(s))

Should contain one or more cross-section curves. If the input has multiple curves,

Connecting modeled cross-section curves to the second input is optional. Instead, you can use automatic circle, square, or line cross-sections using the Surface Shape parameter.

Parameters

Backbone Curve Group

If this is blank, the node uses all curves from the first input, or you can specify a group or set of curves using group syntax. You can also click the Reselect button next to this field to select the curves in the viewport.

Cross Section Group

If this is blank, the node uses all curves from the second input, or you can specify a group or set of curves using group syntax. You can also click the Reselect button next to this field to select the curves in the viewport.

Surface

Surface Shape

What to use as the cross-section shape. The default is to use curves connected to this node’s second input.

Second Input Cross Sections

Use the curve or curves from the second input (taking into account the Cross section group field) as the cross-section(s).

Round Tube

Use a circle as the cross-section, producing a round tube. Scale the tube with the Radius parameter and set the number of sides the circle has with the Columns parameter.

Square Tube

Use a square as the cross-section, producing a boxy tube. Scale the tube with the Width parameter and set the number of subdivisions along each side with the Columns parameter.

Ribbon

Use a line as the cross-section, producing a ribbon shape. Scale the ribbon with the Width parameter and set the number of subdivisions across the line with the Columns parameter.

Surface Type

The surface topology of the generated surface.

The Columns option is useful for creating many curves from each input curve.

Points

Don’t create any primitives, only points.

Rows

Create a curve for each cross section in the grid.

Columns

Create a curve for each vertex around the grid, spanning the full curve.

Rows and Columns

Create curves corresponding with both the Rows option and the Columns option.

Triangles

Create triangles splitting the grid quads in a single direction.

Quadrilaterals

Create the grid quads as is.

Alternating Triangles

Create triangles splitting the grid quads in alternating directions.

Reverse Triangles

Create triangles splitting the grid quads in a single direction opposite that of the Triangles option.

Scale Cross Sections

When Surface shape is “Second Input”, this uniformly scales the size of all cross-sections. For finer control, you can also use the scale ramp below to scale along the length of the curve, or a pscale or scale point attribute on the spine curve to scale the cross sections (when Transform Using Curve Point Attributes is on).

Columns

When Surface shape is “Round tube”, “Square tube”, or “Ribbon”, this controls the density of the cross-section shape. For round, this is the number of sides the circle has. For square, this is the number of subdivisions along each side. For ribbon, this is the number of subdivisions across.

Radius

When Surface shape is “Round tube”, the radius of the tube.

Width

When Surface shape is “Square tube” or “Ribbon”, the width of the tube/ribbon.

Reverse Cross Sections

Turn this on to reverse the normals of the generated surface.

When this is on, the node treats cross section primitives as if they were reversed, which reverses normals on the generated surface.

Stretch Around Turns

Stretch cross-sections in the direction of curvature around turns in the spine. (Default on.) This avoids the cross-section appearing squished in turns. This is usually what you want, unless you have set Surface type to “rows” or “columns”.

Max Stretch

When Stretch Around Turns is on, the maximum amount that cross sections will be stretched. The default is 10 (maximum 10× stretch). This prevents the cross-section from scaling wildly if, for example, the spine curve doubles back on itself.

End Caps

End Cap Type

When the spine curve is open and the cross-section curves are closed, the generated surface is a tube. The node can automatically create end-caps on the open ends of the tube.

None

Do not generate end-caps.

Single Polygon

Cap the ends with a single N-gon.

Grid

Cap the ends with a surface, controlled by the parameters below.

Side Single Polygon

When the spine is closed but the cross-sections are open, the sides of the generated surface are open rather then the ends. This closes the sides with an N-gon.

Cap Divisions

When End Cap Type is Grid, the number of rows in the end-cap surfaces.

Triangular Poles

When End Cap Type is Grid and this is on, the poles of end caps are made with triangles. When this is off (the default), the poles are made with quads with duplicate vertices.

End Cap Scale

When End Cap Type is Grid, this is the amount each end-cap “bulges out” from each end of the tube. Set this to 0 for no bulge, or to a negative number for an inward bulge.

End Cap Roundness

When End Cap Type is Grid, and End cap scale is not 0, this controls the curvature of the bulge. 1 is convex circular, 0 is linear, and -1 is concave circular.

End Caps Group

When this is on, the output geometry includes a group by this name, containing all end-cap geometry. This lets you treat the end-caps separately if necessary in down-stream nodes.

Scale

Tip

You can also use a pscale or scale point attribute on the spine curve to scale the cross sections (when Transform Using Curve Point Attributes is on).

Apply Scale Along Curve

Scales the generated surface across the length of the spine curve according to the Scale ramp parameter.

Scale Ramp

When Apply scale along curve is on, this ramp lets you interactively scale the surface inward and outward along the length of the spine curve.

Rotation

Rotate Order

The order in which to apply the Pitch (around X/out), Yaw (around Y/up), and Roll or Twist (around Z/tangent) options below, when more than one can apply.

Pitch and Yaw may be useful to effectively apply a pre-transform to the cross sections before using them if they are not in the XY plane in the cross section input, which is why they default to being applied before the Roll or Twist.

These rotations are effectively applied to the cross sections before the transforms from the backbone curves, having the net effect of them being rotations in the space of the backbone curve frames.

Apply Roll or Twist

Apply the Roll and Twist parameters below to the cross-section curves.

Roll

A rotation, in degrees, around the spine curve direction, applied equally to every cross-section. You can use this to correct the orientation of the cross-section in relation to the curve.

Full Twists

A convenience to add full twists (for each interval set in the Twist per parameter). This node multiplies this by 360 and adds it to the number in Partial twist.

Partial Twist

The number of degrees of twist to add (for each interval set in the Twist per parameter).

Twist Per

The interval along each of which the total twist specified by the Full twists and Partial twist parameters is applied to the surface.

See the descriptions and image below.

Per Edge

The twist applies along each edge (the distance from each point in the curve to the next point).

Per Unit Distance

The twist applies each “world unit” of distance along the curve.

Scale by Attribute

The twist value is multiplied at each vertex by the value in the attribute named in the Twist ramp attribute parameter (this can be a vertex, point, primitive, or detail attribute). This product is applied as a roll at each vertex, not as an accumulating twist.

Per Full Curve by Edges

Applies the twist value once across the entire curve, divided equally among each edge.

Per Full Curve by Distance

Applies the twist value once across the entire curve, with the amount proportional to the distance along the curve.

Twist Ramp Attribute

When Twist Per is “Scale By Attribute”, this is the name of the vertex, point, primitive, or detail attribute to multiply by the total twist amount (full twists combined with partial twist). This product is applied as a roll at each vertex, not as an accumulating twist.

Apply Yaw

Apply the Yaw parameters below to the cross-section curves. Yaw is a rotation around the cross-section’s “up” vector, usually thought of as “turning left or right”.

Yaw

A rotation, in degrees, around the cross-section’s “up” vector, applied equally to every cross-section. (This is usually thought of as “turning left or right”.) You can use this to correct the orientation of the cross-section relative to the curve.

Incremental Yaw

A rotation, in degrees, around the cross-section’s “up” vector (usually thought as “turning left or right”), to apply along each interval set in the Yaw per parameter.

Yaw Per

The interval along each of which the total rotation specified by the Incremental Yaw parameter is applied to the surface.

Per Edge

The yaw applies along each edge (the distance from each point in the curve to the next point).

Per Unit Distance

The yaw applies each “world unit” of distance along the curve.

Scale by Attribute

The yaw value is multiplied at each vertex by the value in the attribute named in the Yaw ramp attribute parameter (this can be a vertex, point, primitive, or detail attribute). This product is applied as a yaw at each vertex, not as an accumulating yaw.

Per Full Curve by Edges

Applies the yaw value once across the entire curve, divided equally among each edge.

Per Full Curve by Distance

Applies the yaw value once across the entire curve, with the amount proportional to the distance along the curve.

Yaw Ramp Attribute

When Yaw Per is “Scale By Attribute”, this is the name of the vertex, point, primitive, or detail attribute to multiply by Incremental Yaw. This product is applied as a yaw at each vertex, not as an accumulating yaw.

Apply Pitch

Apply the Pitch parameters below to the cross-section curves. Pitch is a rotation around the cross-section’s “out” vector, usually thought of as “tilting up or down”.

Pitch

A rotation, in degrees, around the cross-section’s “out” vector, applied equally to every cross-section. (This is usually thought of as “tilting up or down”.) You can use this to correct the orientation of the cross-section relative to the curve.

Incremental Pitch

A rotation, in degrees, around the cross-section’s “out” vector (usually thought as “tilting up or down”), to apply along each interval set in the Yaw per parameter.

Pitch Per

The interval along each of which the total rotation specified by the Incremental Pitch parameter is applied to the surface.

Per Edge

The pitch applies along each edge (the distance from each point in the curve to the next point).

Per Unit Distance

The pitch applies each “world unit” of distance along the curve.

Scale by Attribute

The pitch value is multiplied at each vertex by the value in the attribute named in the Yaw ramp attribute parameter (this can be a vertex, point, primitive, or detail attribute). This product is applied as a pitch at each vertex, not as an accumulating pitch.

Per Full Curve by Edges

Applies the pitch value once across the entire curve, divided equally among each edge.

Per Full Curve by Distance

Applies the pitch value once across the entire curve, with the amount proportional to the distance along the curve.

Pitch Ramp Attribute

When Pitch Per is Scale By Attribute, this is the name of the vertex, point, primitive, or detail attribute to multiply by Incremental Pitch. This product is applied as a pitch at each vertex, not as an accumulating pitch.

Construction

Cross Sections

Cross Section Order

How the node decides what cross section(s) to use a each point along the spine curve.

All Cross Sections at Each Curve Vertex

Within a single curve’s output grid, at every single vertex, all cross sections will be used.

This is useful for if the cross sections collectively form a unit that should appear at each vertex within each grid, for example, to create a bulge at each vertex.

Each Cross Section At All Curve Vertices

Every curve will be separately surfaced once for each cross section.

This is useful if the cross sections should effectively act like a single, disconnected cross section, for example, to create multiple tubes for each curve.

Cycle Through Cross Section Primitives per Vertex

Within each single curve’s output grid, the cross section selected for each vertex will cycle through the cross sections, starting from the first cross section.

This is useful if the cross sections form all cross sections to be used along the curves in order, for example, if the cross section input contains all cross sections for a corridor in order.

Cycle Through Cross Section Primitives per Primitive

For each curve’s output grid, a single cross section will be selected, selecting the next cross section for each next curve.

This is useful if each curve has a different cross section to be used for it.

Choose Cross Section Primitives by Attribute

For each vertex, select a cross section to use based on the attribute specified in the Cross Section Attribute parameter.

Cross Section Attribute

When Cross Section Order is “Choose Cross Section Primitives by Attribute”, this is the name of the attribute to use for selecting cross sections.

This can be a point, vertex, primitive, or detail attribute on the spine curve, or a primitive attribute on the cross-sections.

  • If this is an integer attribute on the spine, it will select cross sections by primitive number.

  • If this is an integer or string attribute present on both inputs, it will select a cross section with a matching value.

Primitive Type

The type of primitive to output (when Surface Type is not “Points”). “Automatic” generates the same type of surface as the input curves (for example, polylines create a polygon surface, NURBS curves produce a NURBS surface).

Ensure Unique Seam Vertices

If Surface Type is “Rows”, “Columns”, or “Rows and Columns”, and the spine curve or cross-section is closed, this adds an extra vertex (if needed) to each curve to ensure that there are separate vertices for parametric curve u or v coordinate values 0 and 1.

If any output primitives are polygon soups, NURBS surfaces, Bezier surfaces, or bilinear mesh primitives, this option similarly also adds any extra vertices that would be needed to ensure that all uv seams are paramerized correctly.

Swap Rows and Columns

Adjusts the order of the points and primitives in the generated surface(s) to be column-major, having all points/primitives of one column before those of the next column, instead of the default (row-major, having all point/primitives of one row before those of the next row). Changing this also reverses normals, so you may also want to turn on Reverse Cross Sections to keep the current normals.

Close Implicit Backbone Curve if No Curve Input

If the node finds no spine curve in the first input, the node sweeps the cross sections in the second input as if there is a single curve with one vertex per cross section and all positions at the origin. When this is on, the node makes that implicit curve closed, treating the cross sections as forming a loop, instead of a line.

Up Vectors

Target Up Vector

The initial orientation of the cross-section around the direction of the curve. You can use the roll, yaw, and pitch parameters on the Surface tab to further adjust the orientation of the cross-sections on top of this.

Curve Normal

Match the cross-section up-vector to the curve normal. This is useful when the curve is planar, it orients the cross-sections perpendicular to the plane.

X/Y/Z Axis

Match the cross-section up-vector to the X, Y, or Z axis.

Attribute

Get the up-vector from a per-curve value in a primitive attribute, or a shared value in a detail attribute. Set the attribute name in the Start up attribute parameter.

Custom

Match the cross-section up-vector to a custom vector. Set the custom vector in the Start up-vector parameter.

Target Up Vector at Start (else Average)

When this is on, at each point the node tries to get closest to the initial up-vector, while staying perpendicular to the spine curve tangent. When this is off, it tries to get closest to the average of all vertex up-vectors, instead of the initial up-vector.

Use Target End Up Vector

When Target up-vector at Start is on, and this is on, the node adjusts any twist along the spine to ensure the final up-vector is as close as possible to the target up-vector, without affecting the initial up-vector.

If Target up-vector is “Attribute” or “Custom”, there are separate End Up Attribute and End Up Vector parameters, in order to specify different end up-vectors from the start up-vectors.

Start Up Attribute

When Target Up Vector is Attribute, this is the name of the primitive or detail attribute to use for each curve’s target up-vector.

End Up Attribute

When Target Up Vector is Attribute and Use Target End Up Vector is on, this is the name of the primitive or detail attribute that provides the target up-vectors at the end of the curve.

Start Up Vector

When Target up-vector is “Custom”, this is the target up-vector at the end of the curve.

End up-vector

When Target up-vector is “Custom” and Use Target End Up Vector is on, this is the target up-vector at the end of the curve.

Tangents

Tangent Type

How to compute the spine curve’s tangent direction at each point. If Transform using curve point attributes is on and the spine curve has the required attributes, this is ignored.

(The Stretch Around Turns option always computes the stretch and stretch direction based on the “Average of Edge Directions” tangent, regardless of this setting.)

Average of Edge Directions

Average of the normalized directions of the previous and next edge.

Central Difference

Average of the non-normalized previous and next edge vectors.

This is similar to the “Central Difference” option for Velocity Approximation on the Trail node.

Previous Edge

Previous edge direction.

Next Edge

Next edge direction.

Z Axis (Ignore Curve)

The tangent will be chosen as the Z axis, regardless of the curve.

This can be useful if the cross sections have already been rotated to the desired orientation.

Make Closed Curve Orientations Continuous

Any extra rotation required to make the start and end orientations match (either because the curve is non-planar, or you applied a total amount of twist that wasn’t an even multiple of 360) is spread out along the entire curve, instead of possibly coming suddenly along the last edge.

Extrapolate End Tangents

Extrapolate the tangent for the last edge from the previous two edges. When this is off, the tangent for the final edge is just the edge direction.

This is most useful when a backbone curve is intended to represent a circular arc, so the end cross sections will be rotated as expected.

Transform Using Curve Point Attributes

You can also scale the cross-section using pscale or scale point attributes on the spine curve, and orient the cross-sections using the point attributes P, N, up, orient, rot, trans, pivot, and/or transform on the spine curve.

  • If N is present and none of up, orient, rot, or transform are present, the node uses N as the curve tangent and computes the rest of the rotation as usual.

  • If up is present and none of N, orient, rot, or transform are present, the node computes the tangent as usual, and uses up as the up-vector at each vertex (before any roll or twist is applied).

UVs and Attributes

UV Coordinates

Compute UVs

Generate a uv vertex attribute on the generated surface. If the input curves already have uv attributes, the node uses the values from those attributes (U corresponds to the cross sections, and V corresponds to the spine curve).

(If Surface Type is “Points”, this will generate a point attribute.)

Override Any Existing UVs

When Compute UVs is on, compute new UVs for the surface, even if the input curves already had uv attributes.

Length-Weighted UVs

Scale the U and V coordinates based on proportional edge lengths so they're even across the whole surface, rather than bunching up where edges bunch up.

(If Normalize Computed Us and/or Normalize Computed Vs are on, the coordinates are still normalized to be within the 0 to 1 range.)

Normalize Computed Us

Normalize computed U coordinates to be in the range 0 to 1 (before applying UV scale). When this is off, U corresponds to the average distance around the cross sections on the mesh (ignoring any stretch applied by Stretch Around Turns).

When this is on and Normalize Computed Vs is off, the node scales V such that U and V appear scaled similarly in space (depending on the Use Max Cross Section Length per Curve for Proportional Scale setting).

This is especially useful for things like applying repeating rope textures, where the texture should be applied isotropically.

Normalize Computed Vs

Normalize computed V coordinates to be in the range 0 to 1 (before applying UV scale). When this is off, V corresponds to the average distance along the surface in V, or the distance along the spine curve, depending on the Use Mesh Edge Lengths instead of Curve Edge Lengths parameter.

When this is on and Normalize Computed Us is off, the node scales U such that U and V appear scaled similarly in space.

Flip Computed Us

Reverse the direction of the computed U values (same as replacing each U value with max(U values) - U). Use this if a texture appears backward when applied to the surface.

This should be on for textures to appear correct on surfaces viewed from the front, (normals pointing toward the camera), and should be off for textures to appear correct on surfaces viewed from the back, (normals pointing away from the camera).

UV Scale

UV Scale

A scale on the generated UV coordinates. This is applied after any normalization.

This is applied before the adjustments made by Make Computed Us Wrap Seamlessly and/or Make Computed Vs Wrap Seamlessly, so the texture will still wrap correctly.

Use Mesh Edge Lengths Instead of Curve Edge Lengths

When this is on and Length-Weighted UVs is on, the averages of the output mesh edge lengths in the curve direction are used as the lengths in the V direction, instead of the original curve edge lengths.

  • This is useful when, for example, a curve has coincident points with different cross sections, such as a door jamb in a hallway, so that the surface between the two cross sections gets a non-zero area of texture space.

  • It is also useful for generating UVs for grid end caps. However, it can be less stable, when changing rotations, than using the original curve lengths.

Use Max Cross Section Length per Curve for Proportional Scale

When Normalize Computed Us is on and Normalize Computed Vs is on, this controls whether the node uses the maximum cross section length for computing the V scale, instead of the average of the previous and next cross section lengths for each V edge.

If the cross section length varies significantly, this can make the texture appear stretched in some places, but can also avoid instability and inconsistency in the V scale along the curve.

UV Seams

Snap U to Nearest Boundary

When Normalize Computed Us is off and this is on, the node rounds the range of U to the nearest positive integer, so textures wrap correctly in the U direction. This node applies this rounding after the UV Scale.

Snap V to Nearest Boundary

When Normalize Computed Vs is off and this is on, the node rounds the range of V to the nearest positive integer, so textures wrap correctly in the V direction. This node applies this rounding after the UV Scale.

Attributes

From Backbone Curves

Space-separated list of attributes to copy from the backbone curve onto the generated surface. You can use patterns here.

By default, P, N, up, pscale, scale, orient, rot, pivot, trans, and transform are not copied, to avoid copying attributes used for computing transforms.

From Cross Sections

Space-separated list of attributes to copy from the cross-section curves onto the generated surface. You can use patterns here.

The transforms attributes that have a transform type (position, vector, normal, quaternion, or transform matrix) appropriately.

Output attributes

Point Row Attribute

Create an integer point attribute with this name on the generated surface, containing the row number.

Point Col Attribute

Create an integer point attribute with this name on the generated surface, containing the column number.

Prim Row Attribute

Create an integer point attribute with this name on the generated surface, containing the quad row number.

Prim Col Attribute

Create an integer point attribute with this name on the generated surface, containing the quad column number.

Cross Section Num Attribute

Create an integer point attribute with this name on the generated surface, containing the primitive number of the cross section curve used to create the point.

Curve Num Attribute

Create an integer point attribute with this name on the generated surface, containing the primitive number of the spine curve used to create the point.

Examples

SweepBasic Example for Sweep geometry node

This example demonstrates how the Sweep SOP copies geometry onto the points of a curve.

The Sweep SOP is unique in that it automatically places the copied geometry perpendicular to the backbone it is copied to. Variations such as the Cross Section’s scale can be adjusted using expressions.

SweepCurve Example for Sweep geometry node

This network contains an example of the Sweep SOP. A NURBS curve and NURBS circles are used as the backbone and the cross section geometries of the sweep operation respectively.

By controling the scaling of the cross section geometry in the Sweep SOP various effects can be acheived. Finally, a Skin SOP completes the form by using the swept geometry as a kind of skeleton.

SweepDome Example for Sweep geometry node

In this example the Sweep SOP a grid is used as the backbone of a sweep operation with arcs (created by a Circle SOP) as the hull (cross sections) of the sweep object.

The final sweep object is then skinned with a Skin SOP to create the dome geometry.

WigglyWorm Example for Sweep geometry node

This network demonstrates how the Sweep SOP can be used to construct geometry that is easily deformable. The Sweep SOP requires a backbone and cross section geometry.

Through a sin() function an expression is created to animate the backbone for a slithering effect. Then the circles are copied at every point on the backbone to create the skeleton of the worm. Finally, a simple skin operation completes the worm body.

See also

Geometry nodes