Add SOP
Summary[edit]
The Add SOP can both create new Points and Polygons on its own, or it can be used to add Points and Polygons to an existing input.
If an input is specified, this SOP adds points and polygons to it as specified below. If no input is specified, then it generates the points and polygons below as a new entity. It can read points and vertices from DATs. See also DAT to SOP.
Contents
Parameters  Points Page
Points DAT pointdat
 Path to a Table DAT containing point data. By default, x, y, z, and w can be defined in the first 4 columns of the table using unnamed columns.
If the Named Attributes
parameter below is turned on, the following attributes can be defined in the Points Table DAT using named columns:
P(0) P(1) P(2) P(3)
N(0) N(1) N(2)
Cd(0) Cd(1) Cd(2) Cd(3)
uv(0) uv(1) uv(2)
Any other columns are added as singlefloat attributes.
NOTE: Turn off Compute Normals
on the Polygon parameter page when supplying N(0) N(1) N(2)
in the Points Table DAT.
Named Attributes namedattribs
 Allows extra attributes to be defined in the Point Table DAT above.
Point 0 usept0

Point 0 pt0
 ⊞  The three input fields represent the X, Y and Z coordinates of the point. These values can be constants (numbers) or variables. Below are three examples:
0.2 0.42 1.3
0.2 op('xform1').par.tx 1.36
# read the sixth point (first point is 0) from the SOP, grid1
op('grid1').points[5].x op('grid1').points[5].y op('grid1').points[5].z
 X
pt0x

 Y
pt0y

 Z
pt0z

W weight0
 The spline weight of the point. If the point is later used to create a spline (nurbs or Bezier) primitive, the weight will influence the shape of the primitive and may cause that primitive to become rational. Polygons and metaballs are not affected by this weight.
Point 1 usept1

Point 1 pt1
 ⊞ 
 X
pt1x

 Y
pt1y

 Z
pt1z

W weight1

Point 2 usept2

Point 2 pt2
 ⊞ 
 X
pt2x

 Y
pt2y

 Z
pt2z

W weight2

Point 3 usept3

Point 3 pt3
 ⊞ 
 X
pt3x

 Y
pt3y

 Z
pt3z

W weight3

Point 4 usept4

Point 4 pt4
 ⊞ 
 X
pt4x

 Y
pt4y

 Z
pt4z

W weight4

Point 5 usept5

Point 5 pt5
 ⊞ 
 X
pt5x

 Y
pt5y

 Z
pt5z

W weight5

Delete Geometry, Keep Points keep
 Use this option to remove any unused points. When checked, existing geometry in the input are discarded, but the polygons created by this SOP are kept, as well as any points in the input.
Parameters  Polygons Page
Parameters  By Pattern Page[edit]
Polygons Table polydat
 Path to a Table DAT containing polygon data. Accepts rows of polygons specified by point number in the first column. The second column indicates if the polygons are closed (1) or open (0).
Polygon prim0
 Create a fixed number of polygons by specifying a point pattern for each polygon. Enter connection lists here to add polygons. These consist of a list of point numbers to define the order in which the points are to be connected. The form is: {from}{to}[:{every}][,{of}].
Examples of Valid Connection Lists:
1 2 3 4
 Makes a polygon by connecting point numbers 1,2,3,4.1 315 16 8
 All points from 315 are included.1234 820410 235409
 Points from 1820 are included, in the specified order.015:2
 Every other point from 0 to 15 is included.015:2,3
 Every 2 of 3 points are included (i.e. 0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15).!4
 Every point except 4 is included.!100200
 Every point <100 and >200 is included.*
 Include all points.90
 The first ten points are included in reverse order.!90
 All but the first ten points are included in reverse order.
Closed closed0
 To create a closed polygon, check the Closed button.
Polygon prim1

Closed closed1

Polygon prim2

Closed closed2

Polygon prim3

Closed closed3

Polygon prim4

Closed closed4

Polygon prim5

Closed closed5

Parameters  By Group Page[edit]
Create as many polygons as determined by the group field and by the grouping / skipping rules.
Group group
 Subset of points to be connected.
Add add
 ⊞  Optionally join subgroups of points.
 All Points
all
 Adds all points just as if you added them manually in the Points page.
 Groups of N Points
group
 Adds only the number of points specified.
 Skip Every Nth Point
skip
 Adds points, buts skips every Nth one.
 Each Group Separately
sep
 Creates separate polygons for each group specified in theGroup
parameter. For example, if you have a Group SOP creating a group called group1 and using theCreate Boundary Groups
option, you can connect this to an Add SOP and enter group1__* in theGroup
parameter. IfEach Group Separately
is chosen, polygons will be created for each boundary on the surface.
Tip: The Each Group Separately option is useful when pasting surfaces. Boundary groups can be created for the boundaries of two adjacent surfaces, and then the PolyLoft SOP (using the Points option) can be used to stitch these surfaces together.
N inc
 Increment / skip amount to use for adding points.
Closed closedall
 Closes the generated polygons.
Remove Unused Points remove
 Keep only the connected points, and discard unused points.
Compute Normals normals
 Creates normals on the geometry.
Uses
Used in conjunction with a point expression, the Add SOP can be useful for extracting a specific point from another SOP. For example, to extract the X, Y and Z value of the fifth point, from a Grid SOP in geo1:
op('geo1/grid1').points[5].x
op('geo1/grid1').points[5].y
op('geo1/grid1').points[5].z
Points added in this way are appended to the end of the point list if a Source is specified. Middlemouse click on the SOP node to find out how many points there are. For example, if you have added two points and there are 347 points (from 0 to 346), you have added the last two point numbers: 345 and 346.
Operator Inputs
 Input 0 
TouchDesigner Build:
SOPs 

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 
An Operator Family that reads, creates and modifies 3D polygons, curves, NURBS surfaces, spheres, meatballs and other 3D surface data.
An Operator Family that manipulates text strings: multiline text or tables. Multiline text is often a command Script, but can be any multiline text. Tables are rows and columns of cells, each containing a text string.
Information associated with SOP geometry. Points and primitives (polygons, NURBS, etc.) can have any number of attributes  position (P) is standard, and optional are normals (N), texture coordinates (uv), color (Cd), etc.
A form of DATs (Data Operators) that is structured as rows and columns of text strings.
Each SOP has a list of Points. Each point has an XYZ 3D position value plus other optional attributes. Each polygon Primitive is defined by a vertex list, which is list of point numbers.
The 3D data held in SOPs and passed for rendering by the Geometry COMP.
The 3D data held in SOPs and passed for rendering by the Geometry COMP.