# Curvesect SOP

## Summary

The Curvesect SOP finds the intersections or the points of minimum distance between two or more faces (polygons, Bziers, and NURBS curves) or between faces and a polygonal or spline surface.

## Parameters - Curvesect Page

Face Group `leftgroup` - A subset of faces (NURBS, Bzier, polygons) to act upon. Accepts patterns, as described in Pattern Matching.

Cutter Group `rightgroup` - A subset of faces or spline surfaces to intersect with. Accepts patterns, as described in Pattern Matching.

Find All Intersections `xsect` - Compute intersection points if the faces touch the cutter primitive. If the button is unchecked, only the point of minimum distance will be found. Currently, finding the minimum distance between a face and a surface is not available.

Tolerance `tolerance` - Determines the precision of the intersection.

Method `method` - - Choose between 'Cut' or 'Extract' operations.

• Cut `cut` -
• Extract `extract` -

Left Face Pieces `left` - - Choose what parts of the left faces to keep:

• Keep All `lkeepall` - All the face segments generated by the intersection(s).
• Keep Odd-numbered Ones `lkeepodd` - The odd face segments: 1, 3, 5...
• Keep Even-numbered Ones `lkeepeven` - The even face segments: 0, 2, 4...
• Keep None `lkeepnone` - Delete the entire face.

Right Face Pieces `right` - - Choose what parts of the right faces to keep:

• Keep All `rkeepall` - All the face segments generated by the intersection(s).
• Keep Odd-numbered Ones `rkeepodd` - The odd face segments: 1, 3, 5...
• Keep Even-numbered Ones `rkeepeven` - The even face segments: 0, 2, 4...
• Keep None `rkeepnone` - Delete the entire face.

Affect `affect` - - Choose which input to operate on:

• Left Input `left` - Extract from the left input faces.
• Right Input `right` - Extract from the right input (face or surface).
• Both Inputs `both` - Extract from both left and right inputs.

Extract Point `extractpt` - If the right input is a surface, choose between point and isoparm extraction; only points are extracted if the right input is a face.

Keep Original `keeporiginal` - When using Extract method, turning this on will keep the original geometry connected to the first input (input0).

## Examples

### Circles

1. Place two NURBS Circle SOPs, one of them slightly offset in X and Y (not Z).
2. Pipe their outputs into a Curvesect SOP, make it the display SOP.
3. Method: Cut. For the Left Face, select Keep Odd-numbered Ones.
4. You can extract the inside (even) or outside (odd) portion of the curve where they intersect.

### Star

1. Model a closed NURBS curve in the shape of a star (use a Model SOP).
2. Place a NURBS Circle SOP.
3. Pipe them into a Curvesect SOP, make it the display SOP.
4. It produces five independent NURBS curves based on their intersection with the NURBS circle.
5. You could append a Join SOP to reconnect the individual NURBS curves into a new continuous curve. It smoothly connects the remaining segments.

### Creeping behaviour along a Path

1. Place a new Font SOP and then a Circle SOP. Circle SOP - Type: NURBS, Radius 0.1, 0.1; Centre -3, 0.3, 0.2. Font SOP - Text: "Creep Along Me".
2. Append a Curvesect SOP with the Font and Circle SOPs feeding into the first and second inputs respectively. Change the Tolerance to `1.0`, and enable the Extract operation. Turn off Find All Intersections. Make it the display SOP.
3. Enable the template flags on the Font and Circle SOPs (use S click).
4. Home the view, and enable the Point display in the Viewport options.
5. As you change the Circle's X value from -3.0 to 3.0, you will notice that a number of points will creep along the paths of the curves within the text. Using a Copy SOP to copy geometry to each of these points gives you a simple way of creating an irregular "flocking behaviour" along predetermined paths. This works, because as the circle moves above the curves in the text, the points in the curves that are closest to the circle move also.
6. Use a Model SOP instead of a Font SOP to model several NURBS curves which are the paths to follow for more precise control over the motion.

• Input 0 -
• Input 1 -

## Info CHOP Channels

Extra Information for the Curvesect SOP can be accessed via an Info CHOP.

### Common SOP Info Channels

• num_points - Number of points in this SOP.
• num_prims - Number of primitives in this SOP.
• num_particles - Number of particles in this SOP.
• last_vbo_update_time - Time spent in another thread updating geometry data on the GPU from the SOP's CPU data. As it is part of another thread, this time is not part of the usual frame time.
• last_meta_vbo_update_time - Time spent in another thread updating meta surface geometry data (such as metaballs or nurbs) on the GPU from the SOP's CPU data. As it is part of another thread, this time is not part of the usual frame time.

### Common Operator Info Channels

• total_cooks - Number of times the operator has cooked since the process started.
• cook_time - Duration of the last cook in milliseconds.
• cook_frame - Frame number when this operator was last cooked relative to the component timeline.
• cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
• cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
• cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
• cooked_this_frame - 1 if operator was cooked this frame.
• warnings - Number of warnings in this operator if any.
• errors - Number of errors in this operator if any.

TouchDesigner Build:

Add • Alembic • Align • Arm • Attribute Create • Attribute • Basis • Blend • Bone Group • Boolean • Box • Experimental:Box • Bridge • Cache • Cap • Capture Region • Capture • Carve • CHOP to • Circle • Experimental:Circle • Clay • Clip • Convert • Copy • CPlusPlus • Creep • Curveclay • Curvesect • DAT to • Deform • Delete • Divide • Extrude • Face Track • Facet • File In • Fillet • Fit • Font • Force • Fractal • Grid • Experimental:Grid • Group • Hole • Import Select • In • Introduction To s Vid • Inverse Curve • Iso Surface • Join • Joint • Kinect • Lattice • Limit • Line • Line Thick • LOD • LSystem • Magnet • Material • Merge • Metaball • Model • Noise • Null • Object Merge • Oculus Rift • OpenVR • Out • Particle • Point • Polyloft • Polypatch • Polyreduce • Polyspline • Polystitch • Primitive • Profile • Project • Rails • Raster • Ray • Rectangle • Experimental:Rectangle • Refine • Resample • Revolve • Script • Select • Sequence Blend • Skin • Sort • Sphere • Experimental:Sphere • Spring • Sprinkle • Sprite • Stitch • Subdivide • Superquad • Experimental:Superquad • Surfsect • Sweep • Switch • Text • Texture • Torus • Experimental:Torus • Trace • Trail • Transform • Trim • Tristrip • Tube • Experimental:Tube • Twist • Vertex • Wireframe • ZED