question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Coloring faces of imported meshes

See original GitHub issue

Hi @marcomusy, I am trying to use your library to visualize data from thermal comfort studies. I have several manikins like the one shown below and I intend to color individual polygons based on the amount of thermal radiation incident on them (as shown in the screencapture in the second picture) vtk picture1 The part about loading the geometry is super simple due to the methods in your vtkPlotter class. I could not find a way to interact with the individual faces of the obj through any of the methods. I also tried to understand the methods and attributes available at runtime through the debugger in Pycharm but could not get much far. Any suggestions?

Thanks, Sarith

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
marcomusycommented, Aug 16, 2020

various possibilities…: if the points are projectable onto a plane (which seems to be the case) you can discard the existing triangles and recreate a new mesh with delaunay2D or try to recreate it with recoSurface() besides you can use clean(tol=0.01) to preprocess and reduce the points and/or use smoothMLS2D() to make the surface smoother.

finally - once you have the mesh - you can color the outside and inside differently with color() and backColor()

1reaction
marcomusycommented, Feb 27, 2020

Hi @LogWell this looks related to a transparency problem in vtk… though I must say I don’t understand exactly why that happens… This works for me:

from vtkplotter import *

settings.useDepthPeeling = True

m = load('00000.obj').texture('registered_tex_1_m.png')
m.show(axes=4)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Three.js - Changing color of a face from an imported mesh?
In three.js, I can't seem to find out how to target/change the color of a mesh imported from Blender. Any help would be...
Read more >
color faces of mesh with python - Blender Artists
how can you color the individual faces of my mesh depending on distance to e.g. a different object? This is possible with bpy...
Read more >
Easy and Quick Way to Import Models WITH COLOR from ...
Easy and quick way to cleanly import colors onto your meshes from Blender to Roblox Studio.Here is the link for a good color...
Read more >
Select Individual faces from an imported mesh or custom ...
Select Individual faces from an imported mesh or custom made mesh by blender ... Another solution was to use vertexData but i could...
Read more >
Color individual faces after modifier - Blender Stack Exchange
Once you use a Generate Modifier (decimate counts as well) you don't have much control over the mesh anymore. Since modifiers are by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found