Working with Lines & Line Metrics
Curriculum Navigator:
If you’re viewing this page from the TouchDesigner curriculum explorer, you can use the buttons below to interact with this topic.
Overview:
Working effectively with lines can sometimes be challenging, but POPs provides a selection of operators designed to simplify this process. Line Strips are primitives that are made of multiple points, and can be created via most generator POPs or via the Primitive POP.
The Line Smooth POP can be used for smoothing and resampling lines; it smooths line strips by blending the positions of adjacent points along the line strip. It can also be used to resample a line strip when there are a limited number of initial points to work with.
If you need to divide a single line into multiple segments, you can utilize the Line Break POP. It creates new line strips from the points and line strips of its input. We can use this POP to break a single line strip into many smaller strips, creating the effect of a dotted or dashed line.
The Line Metrics POP can be used for several different calculations both across a line strip and between its neighbors. The Line Metrics POP analyzes the line structure to compute spatial attributes for every point. It calculates data between neighboring points like Displacement to Next (DispNext), Direction to Next (DirNext), Tangent vectors (Tan), and Curvature (Curv). For the entire line strip, it can be used to calculate metrics like Distance from the Start (DistStart), Distance from End (DistEnd) and Line Strip Length (LineStripLeng). This information is essential for downstream operations, allowing you to modulate attributes based on the precise topology of your lines.
References:
- Line POP – Derivative Wiki
- Line Metrics POP – Derivative Wiki
- Line Smooth POP – Derivative Wiki
- Line Break POP – Derivative Wiki
- Copy POP – Derivative Wiki
- POP to CHOP – Derivative Wiki
- Normalize POP – Derivative Wiki
- Lookup Texture POP – Derivative Wiki
