Hi!
I want to plot my STL-Model (or general 3D object) using VTK. For this, I used the STLReader.
My next step is to give some facets of the model different colors, so e.g.:
Face 1-10 shall be red
Face 11 - 20 shall be blue.
Since I am relatively new to VTK and the intellisense of my IDE is not giving me further interesting options, it’s hard for me to achieve this task.
I read a lot about color lookup tables and scalararrays which are applied to the mapper but somehow, all I’ve done so far does not work.
I am using Python for VTK.
from vtkplotter import *
s = load(datadir+'shuttle.stl')
cols, als = [], []
for i in range(s.NCells()):
cols.append(i) # i-th color
als.append(i/s.NCells()) #opacity
s.colorCellsByArray(cols, als).lw(1).show()