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

Question: Color per face/vertex #114

Closed iimanu closed 4 years ago

iimanu commented 4 years ago

Hi there,

I'm not sure whether this feature exists or not, but I'm looking to plots meshes and point-clouds with a per-vertex or per-face vector of colors. Specifically, I'd like to supply to add_mesh: [number_faces x 3]/[number_vertices x 3] tensor of RGB values, allowing me to plot a point-wise function over the faces/vertices. This can be used for many applications, such as visualizing semantic mesh segmentation/differential operators/curvature and many more.

Currently, add_mesh does not receive a tensor of colors, as described. So, my requests are:

  1. Is there a quick workaround you can offer?
  2. I'd like to request this as a feature request.

-- Mano

github-actions[bot] commented 4 years ago

Hi and welcome! Thanks for posting your first issue in the PyVista project! Someone from @pyvista/developers will chime in before too long. If your question is support related, it may be automatically transfered to https://github.com/pyvista/pyvista-support

iimanu commented 4 years ago

Found "scalars" option

banesullivan commented 4 years ago

Hi there, @iimanu, I moved this to the pyvista-support repo as this is a usage question rather than an issue/feature request.

Just to be complete in case others stumble upon this question, here is an example of plotting RGB values on a mesh from the example gallery. You do this by using the rgb argument to add_mesh

@iimanu, it would be really great if you could share your solution with example data for others to reference when they have the same problem.