Learning the difference between SetScalars vs SetVectors

I am trying to add point data like density (scalar) and velocity (vector) to point data

I am trying to understand when to use which because the following example kind of threw me off.

A color to me is like a vector of 3 component but yet the SetScalars method is used.

Where can I read up more about the difference between SetScalars and SetVectors usage and the design behind it?

Thank you

Indeed, scalars have one component most commonly. That example uses “scalars” with 3 components because it uses direct coloring.
This can be used, for instance, for a model that shows different parts with different colors. So instead of using an integer part number and then color mapping that, you store the color directly.

This is the new site for VTK Examples.



Thank you @danlipsa , in a separate thread about multiple pointsdata array, I was made aware of this, I am now using AddArray() as it gives a consistent interface for my usecase.