Make edges of elements visible when viewed by side

Hi all!

I have recently noticed that when plate elements are exactly viewed from the side, the elements are no more visible, even if the vtkActor property have EdgeVisibilityOn().
Here is an example of what I say and what I would like to have :

I don’t exactly know when the problem appeared but I am sure that it worked in the past. I don’t know if it is a change in a vtk version or maybe an update of my display drivers…
So my question is do you know if any parameter can be used to ensure that edges remain visible when viewed exactly by side? Maybe it’s an antialiasing parameter?

Thanks in advance! The replies here are always fast and pertinent it’s a pleasure ^^

I think that behavior (or bug) has been introduced in VTK 9. After its introduction, my flat grids not only disappear when viewed from the side (edge-on), they aren’t rendered at all when viewed from the other side as if back-face culling is active. That’s very odd indeed.

The rendering of edges on polydata was changed to a shader-based approach, resulting in much faster performance. It does have a few drawbacks, and I think you found one of them - if the polygonal face isn’t rendered in a particular view, then the edges aren’t rendered, either.

There are two things you can try (sorry, these were originally ParaView changes):

  • Set actor->GetProperty()->SetRenderLinesAsTubes(1) - It adds some depth to the edges, and may help.
  • Use the vtkExtractEdges filter on your geometry, and display the original as “surface” and the extracted edges. You’ll have to play with the display params, and possibly use the vtkMapper::SetResolveCoincidentTopologyLineOffsetParameters(XX, YY);
    to avoid depth fighting.



Thanks. But I’m not using Paraview. So, please, can you translate that as VTK API calls?



Edited the original post…

1 Like