chore(ClipClosedSurface): fix surface colors not showing - #3585
Conversation
|
Can you please explain why changing to direct scalar mode fixes the problem? Could it be the active attribute field that is not correctly set? |
From my understanding, it's necessary because we set the colors as the scalars directly, rather than use a lookuptable. |
|
To be more complete: There's 2 coloring modes: colors and labels If we are in color mode, we can have only 3 colors: base, clip and active. The example didn't use the colors correctly because we didn't tell the mapper to use the scalars as colors directly, so it tried to use the colors as scalars, reading their first component as a float scalar resulting in the binary blue/red we saw due to saturation of the default lut that maps from 0 to 1 (colors are in uint8 so we could only get both ends). In label mode, we have the same issue if we don't change the LUT because the filter uses labels 0, 1 and 2 arbitrarily without allowing to change these values: So if we want to be able to still show scalars, we would need to be able to use default scalars instead of this overwrite for "base" right ? |
Context
Surface colors are incorrect in ClipClosedSurface example
Results
The sphere and plane colors are now correct.
Changes
Added
mapper.setColorModeToDirectScalars();in the example to use the scalars set by the filter.npm run reformatto have correctly formatted code