Crop T3D¶
Summary¶
The Crop T3D keeps the part of a volume inside a box and discards the rest, reducing the resolution, as the Crop TOP does in 2D. The box's six faces are Crop Left and Crop Right along X, Crop Bottom and Crop Top along Y, and Crop Back and Crop Front along Z, in the Unit chosen: voxels, fractions of each axis, or fractions of the width on every axis (Fraction Aspect, so a cube stays a cube).
The output is the box's size, truncated to whole voxels, and with whole-voxel edges it is an exact copy of that part of the input. A box reaching past the input is filled according to Extend. With Output Resolution Custom on the Common page, the box is resampled to Resolution instead.
Switching Unit converts the six edges so the box stays where it is (0.5 in Fraction becomes 32 in Voxels on a 64-voxel axis) and sets the sliders' ranges to the input in the new unit. A box of more than eight times the input's voxels (at least 256³) is resampled down to that many, keeping its proportions, so a mistyped edge cannot exhaust GPU memory.
In a script, apply the unit before writing edges in it: setting Unit converts the edges at the end of the frame.
c.par.Unit = 'voxels'
c.op('unit_change').module.onValueChange(c.par.Unit, None) # converts now
c.par.Cropright = 12
Parameters - Crop Page¶
Crop Left Cropleft - Position of the left edge of the crop box along X, in Unit. Beyond the input (below 0 or past 1 in Fraction), Extend fills the box.
Crop Right Cropright - Position of the right edge of the crop box along X, in Unit. Beyond the input (below 0 or past 1 in Fraction), Extend fills the box.
Crop Bottom Cropbottom - Position of the bottom edge of the crop box along Y, in Unit. Beyond the input (below 0 or past 1 in Fraction), Extend fills the box.
Crop Top Croptop - Position of the top edge of the crop box along Y, in Unit. Beyond the input (below 0 or past 1 in Fraction), Extend fills the box.
Crop Back Cropback - Position of the back edge of the crop box along Z, in Unit. Beyond the input (below 0 or past 1 in Fraction), Extend fills the box.
Crop Front Cropfront - Position of the front edge of the crop box along Z, in Unit. Beyond the input (below 0 or past 1 in Fraction), Extend fills the box.
Unit Unit ⊞ - Units of the six edges: Voxels of the input; Fraction, 0 to 1 of the input along each axis; or Fraction Aspect, a fraction of the input's width on every axis (a cube stays a cube).
- Voxels
voxels - Fraction
fraction - Fraction Aspect
fractionaspect
Extend Extend ⊞ - What fills the parts of the crop box outside the input: Hold continues the edge voxels, Zero is transparent black, Repeat tiles the input, Mirror tiles it mirrored.
- Hold
hold - Zero
zero - Repeat
repeat - Mirror
mirror
Parameters - Common Page¶
Output Resolution Outputresolution ⊞ - Where the output's width, height and depth come from. With nothing connected to the first input the operator always uses Resolution, whichever option is set.
- Use Input
useinput- The first input's width, height and depth. - Custom
custom- The Resolution parameter.
Resolution Resolution1 Resolution2 Resolution3 ⊞ - Width, height and depth of the output in voxels. Used when Output Resolution is Custom, or when the first input is not connected. Memory is width × height × depth × bytes per voxel of the Pixel Format: 256³ at 16-bit float RGBA is 128 MiB.
Input Smoothness Inputfiltertype ⊞ - Filtering of the internal GLSL TOPs' input samplers, as TouchDesigner's Input Smoothness. Inputs are read at normalised coordinates, so this matters whenever the input and output resolutions differ or an input is transformed. Nearest Pixel returns voxels unblended; Interpolate Pixels is trilinear.
- Nearest Pixel
nearest - Interpolate Pixels
linear - Mipmap Pixels
mipmap
Passes Npasses - Passes of the internal GLSL TOPs, as TouchDesigner's Passes parameter.
Pixel Format Format ⊞ - Pixel format of the output. Use Input takes the first input's format. With nothing connected, Use Input resolves to 8-bit fixed (RGBA), which clamps values to 0–1 and quantises them to 1/255: set a float format for signed distances, densities above 1, velocities or anything else outside 0–1.
Bypass Bypass - Passes the first input through unchanged and skips the operator's work. With nothing connected the output is a single black voxel.
Version Version - T3D version of this operator. Read-only information; include it when reporting a problem.
Copyright Copyright - Author and licence information. Read-only.
Operator Inputs¶
- Input 0: Input
T3D_in1- The volume to crop.
Operator Outputs¶
- Output 0: Output
T3D_output- The crop box, at its own size in voxels (truncated), or resampled to Resolution when Output Resolution is Custom.
Performance¶
GPU time when the operator recooks: 0.010 ms at 64³, 0.042 ms at 128³, all of its passes summed (GeForce RTX 4090, TouchDesigner 2025.33230). An operator whose inputs and parameters are unchanged does not recook and costs nothing.