pointavg
expression function
Returns the average of an attribute across all points in a geometry.
Usage
pointavg(surface_node, attribute, index)
This function works much like the point function, except that it returns the average value of the attribute for all points in the specified surface node.
index is the component number (0, 0 to 3, or 0-4, depending on the datatype of the attribute) to read if the attribute is a vector or vector4. For floats, the index argument is ignored (just use 0). For example, for a color value, 0 means red, 1 means green, and 2 means blue. To read the all three (red, green, and blue) components, you would need to call the function three times with 0, 1, and 2 as the values for index.