Hi Marco, i have been trying to visualize a mesh segmentation. That is: vertices with y-coordinate bellow y_n get a color/class c_1, vertices with y-coordinate between y_n and y_m get a color c_2, and so forth but no success. The "bands" feature does not work because the intervals have the same length.
Is there a way to accomplish this?
You can use cellColors() this way:
from vtkplotter import Sphere, settings
# settings.useDepthPeeling=True # not necessary if alpha=1
sv = Sphere().lw(0.1)
cols, alphas = [], []
for p in sv.cellCenters():
if p[2]>0.3:
cols.append([1,0,0]) #rgb
elif -0.2<p[2]<0.3:
cols.append([0,1,0])
else:
cols.append([0,0,1])
alphas.append(1)
sv.cellColors(cols, alpha=alphas, mode='colors')
sv.mapCellsToPoints() #optional
sv.show(axes=1, viewup='z')

Thanks! You saved my day!

Most helpful comment
Thanks! You saved my day!
