Possibility of per cell point colors? #427
-
I have data that is defined on a per cell per point basis on a mesh, which may be discontinuous at the edges between cells, but is linearly interpolated across each cell of the mesh that I want to visualize. The same point may be one color in one of its incident cells but a different color altogether in another of its incident cells, but a cell will not have a constant color. Is it possible to color each point of each cell of a mesh with a different color to get a per cell version of the linear interpolation that point colors provides? I do not see this in the API, but I may be missing it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You have all the possibilities: from vedo import *
settings.interpolateScalarsBeforeMapping = True
m = Sphere(res=5).lw(1)
scalars = m.points()[:,2]
m.cmap("bone", scalars, on="points").addScalarBar()
# scalars = m.cellCenters()[:,2]
# m.cmap("rainbow", scalars, on="cells").addScalarBar()
show(m, axes=1) the |
Beta Was this translation helpful? Give feedback.
You have all the possibilities:
the
interpolateScalarsBeforeMapping
flag decides whether the interpolation is made purely on the rgb colors of a face vertices (False
), or based on the color mapping (True
). In the above example the difference is negligible but should become more evident in case of discontinuities.