Close

POP Dimension

A POP’s point list may have an implied structure within it. For example, a Grid POP is a list of points arranged in columns and rows that are not known if they are connected as a set of triangles, quads or point primitives. A Grid POP has two "dimensions" by default (the rows and columns), and three dimension if you increase the number of slices. When you pass a POP to another POP, you may want to preserve what is known about its structure.

Dimension is the metadata that describes the structure and is passed from POP to POP.

NOTE: This replaces the concept of meshes in SOPs.

For example, when converting a POP to a TOP, you want to create the corresponding width and height of pixels in the TOP. The dimension is used for this. When converting a TOP to a POP, you will want to preserve its width and height resolutions, again generating the correct dimensions.

Dimension” is the concept of points organized as columns and rows of points, or cols/rows/slices, or generally N-dimensions, where each dimension has some number of "elements". For example, you get three dimensions when you copy a 2-dimensional grid onto each point of a circle.

Middle-click on a POP to see its popup info: You will see numbers for Dimension, for example,

dimension 20 40 12

indicating a 12 x 40 x 20 point arrangement. If you multiply them you will always get the total number of points in the POP.

Some generator POPs are multi-dimensional (Torus POP (2 dimensions), Tube POP (2 dimensions), Grid POP (2 or 3), sometimes Sphere POP….).

Some POPs always preserve the dimensions (Math POP), some POPs increases the number of dimensions (Copy POP, Trail POP and sometimes Merge POP).

Some POPs destroy multi-dimensions (Delete POP). A Grid POP is no longer 2-dimensions if you, for example, delete a point. It becomes a 1-dimension whose size simply is the total number of points.

All POPs have at least 1 dimension with the number of elements being the number of points.

Built-In Attributes for Dimensionedit

You can use the dimensions when working with attributes like in Math Mix POP or Lookup Channel POP. Here are built-in attributes, accessible on any attribute parameter menu.

_NumDim is the number of dimensions of the input.

_DimSize[0] would be the number of columns in a grid or torus or tube. _DimSize[1] is the number of rows.

_DimI[1] is the column number of a point, _Dim[1] is the row number.

_DimU[0] is the point’s column represented as a normalized number between 0 and 1. _DimU[0] is 1 for the last point in an a grid columns. These numbers are useful for all the Lookup* CHOPs.

pro tip: _DimCy[0] is similar to _DimU[0] but is cyclic: The last point has _DimU[0] == 1, but the last point has DimCy[0] == ( 1 - 1/numcols), so with 10 columns, the last column has DimCy[0] == .9. Therefore if you give a Lookup POP an index value of 1 and it’s cyclic, it’s referring to the first point.

Python for Dimensionedit

In python, OP.dimension is the list of sizes of each dimension, for example [10, 20, 8]. It is the map of points arranged in memory.

len(OP.dimension) is the number of dimensions, 3 in this case. Always the number of points in a POP is the product of all the dimensions.

NOTE: We use the term “array” to define attributes with more than one float3 for instance.

For the Grid POP, in python, POP.dimension[0] is the number of columns, POP.dimension[1] is number of rows, POP.dimension[2] is number of slices if there is more than 1 slice.

And if you copy this 3D grid to points of a circle, POP.dimension[4] is the number of circle points you stamped to.

POP.numPoints = POP.dimension[0] * POP.dimension[1] * POP.dimension[2] * POP.dimension[3]