Skip to content

Possibility of per cell point colors? #427

Answered by marcomusy
johncbowers asked this question in Q&A
Discussion options

You must be logged in to vote

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 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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcomusy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants