pyvista / pyvista-support

[moved] Please head over to the Discussions tab of the PyVista repository
https://github.com/pyvista/pyvista/discussions
60 stars 4 forks source link

Different color/opacity or independent control of "scalars" for each side of a surface #297

Open fzag opened 3 years ago

fzag commented 3 years ago

Hello,

I was wondering if there is a way to control the color/opacity of both sides of a cell separately (i.e. for a PolyData object).

This would, for example, be useful to check the validity of a mesh, ...or one could want to control the appearance of the normal side of cells with cell_arrays scalars, while keeping the other side with a constant color...

Maybe something like BasePlotter.update_scalars_front() + update_scalars_back(), instead of only update_scalars() could be conceivable?

I would be happy to hear about any solution or idea :)

Thank you,

FZ

banesullivan commented 3 years ago

I don't think this is possible with VTK, sorry :/

fzag commented 3 years ago

Thank for your reply !

I am not an expert of VTK, but it seems that VTK does enable that (see BackfaceProperty of the class vtkActor classvtkActor).

As an example, the python library vedo (which is also basically a VTK wrapper for Python) implemented such features (see vedo/mesh.py).

banesullivan commented 3 years ago

Huh, thanks for pointing that out! I'm unaware of any support for what you're asking for... I typically thought the backface property stuff was for culling and improving rendering performance.

I will see if we can look into this a bit further! There is a lot of overlap between PyVista and vedo so I'll try to take a look at that example and see if we can also support that.