Trace POP
Summary
The Trace POP reads a TOP image and traces it, generating line strips around areas exceeding a certain brightness threshold. You can control the threshold using the Threshold parameter, and compare it with the pixel value determined by the Channel menu, by default the brightness.
The line strips can be triangulated into triangular surfaces, ore left in its basic (fastest but least useful) form as 2-point lines.
The resolution of the resulting line strips or triangle meshes can be reduced using the Resolution Multiplier parameter.
You can smooth the line strips using the Smooth Edge Distance parameter which is similar to the snoothing in the Line Smooth POP.
The Extend menu determines is the line strips continue around the border or are separates as open line strips.
The Winding will make outer line strips that are counter-clockwise, and line strips enclosed in them to be clockwise.
The output is -.5 to .5 in X (P(0)) but it can be re-ranged with the ReRange P parameters.
You may need to adjust the Max Num Line Strips parameter or the Max Num Verts parameter (since these numbers need to be pre-determined for the GPU to avoid overflows).
See also Polygonize POP, Triangulate POP, Extrude POP
Parameters - Trace Page
inputattrscope - When using a POP with dimension 2 as an input, the attribute scope to sample.
posattrib - When using a POP with dimension 2 as an input, whether to use the P attribute to position the threshold lines.
top - TOP to sample.
channel - ⊞ - When using a TOP input, the color channel to sample.
- Luminance
luminance-
- Red
red-
- Green
green-
- Blue
blue-
- Alpha
alpha-
- RGB Average
rgbaverage-
- RGBA Average
average-
- RGB Maximum
rgbmax-
- RGBA Maximum
max-
resmult - Resolution multiplier to apply to the input.
threshold - The threshold value to determine what is inside the surface and what is outside (empty).
inside - ⊞ - Whether values above the threshold or below or equal the threshold are considered inside. For contours, that determines the direction of the segments.
- Below/Equal to Threshold
below-
- Above Threshold
above-
extend - ⊞ - How to sample outside the boundaries, which is needed to determine what happens at the boundaries. Zero returns 0, Hold returns the boundary value.
- Hold
hold-
- Zero
zero-
twodimensions - ⊞ - Whether to output a contour, lines or line strips, or a surface made of triangles.
- Contour (Lines)
contour-
- Contour (Line Strips)
contourls-
- Surface (Triangles)
surface-
uniquepoints - When outputting Lines, whether the points are shared between the lines or unique to each line.
winding - ⊞ - When outputting line strips, by default the closed line strips will be oriented counterclockwise around surfaces, and clockwise around holes. Counterclockwise reverses the line strips around holes so they're counterclockwise as well.
- Natural
natural-
- Counter ClockWise
ccw-
smooth - ⊞ - When outputting line strips, smoothes the line strips, averaging neighboring points positions, using the distance value.
- Smooth Edge Distance
smooth-
- Smooth Edge Distance
filterdist-
rerangep - Whether to ReRange P.
tolow - ⊞ - The low value of the new range in X and Y.
- Map to Low
tolow0-
- Map to Low
tolow1-
tohigh - ⊞ - The high value of the new range in X d Y.
- Map to High
tohigh0-
- Map to High
tohigh1-
normal - ⊞ - Whether to output a Normal (N) attribute.
- None
none-
- Point
point-
- Primitive
prim-
normaldirection - ⊞ - Chooses the normal direction when outputting normals.
- Default
default-
- +Z
z-
texture - Whether to output a point Texture Coordinates attribute (Tex)
allocfract - This POP doesn't know in advance how much GPU memory it will need, but except in rare cases (very high amount of detail, a lot of variation in neighboring pixels in the source) it doesn't need the maximum allocation. This allows to save GPU memory. If points and primitives are missing or the info popup shows the max numbers are reached, it means the fraction is too low.
setmaxnumls - ⊞ - Optional toggle, saves some GPU memory when set correctly.
- Max Num Line Strips
setmaxnumls-
- Max Num Line Strips
maxnumls-
setmaxnumvertsperls - ⊞ - Optional toggle, can help prevent the GPU being stuck in infinite loops, doesn't save memory.
- Max Num Verts per Line Strip
setmaxnumvertsperls-
- Max Num Verts per Line Strip
maxnumvertsperls-
cpureadback - Copy back the point count info and topology info held on the GPU back to CPU. Causes a stall for discrete GPUs.
Parameters - Common Page
bypass - Pass through the first input to the output unchanged.
freeextragpumem - Free memory that has accumulated when output memory has grown and shrunk.
delinputattrs - Only output which attributes you specify in this POP - helps isolate attributes into a separate branch.
Operator Inputs
- Input 0: -
Info CHOP Channels
Extra Information for the Trace POP can be accessed via an Info CHOP.
Common POP Info Channels
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: