samwit
(Samuel)
May 17, 2025, 10:49am
1
Hi vtk helpers,
There’re always ISO lines on surfaces rendered, as highlighted below:
Here’s my code:
I can set the width of the lines by “props->SetLineWidth(3.0)”, but I cannot just disable it by assigning 0 to the value.
How can I avoid rendering the ISO lines?
jaswantp
(Jaswant Panchumarti (Kitware))
May 17, 2025, 12:52pm
2
There are two solutions I can think of:
tweak the coincident offsets such that the lines appear below the surface. See vtkMapper:: SetResolveCoincidentTopology and vtkMapper::SetRelativeCoincidentTopologyLineOffsetParameters
Pass the output of your source through a filter that removes the lines. I’m not aware of a filter that does it. However, it’s quite easy to write one that shallow copies the points and polys into output and skips the lines.
Jaswant Panchumarti (Kitware):
Pass the output of your source through a filter that removes the lines. I’m not aware of a filter that does it. However, it’s quite easy to write one that shallow copies the points and polys into output and skips the lines.
Maybe vtkExtractCellsByType by selecting all types except the line ones would do the trick?
jaswantp
(Jaswant Panchumarti (Kitware))
May 18, 2025, 6:13pm
4
That is a good suggestion!
samwit
(Samuel)
May 19, 2025, 3:07am
5
Thank you both.
I tried out vtkExtractCellsByType but it got nothing to output.
The output is a PNG but it turned out to be empty at all.
Did I miss anything essential?
Codes here:
jaswantp
(Jaswant Panchumarti (Kitware))
May 19, 2025, 1:32pm
6
Can you confirm that the source has only triangles? Or is it quads?
samwit
(Samuel)
May 20, 2025, 1:51am
7
I’m not sure, but I tried to add all the available cell types to the extraction filter.
However, it extracted nothing.
It seems as if nothing was input to the filter, so it got nothing to extract from.
Is it related to the data source? It’s an Open CASCADE shape “TopoDS_Shape”.
Or did I use the correct way of connecting the data source to the filter?
The codes I used now here:
I tried to direct the output to a VTK file, but it turned to be empty.
samwit
(Samuel)
May 20, 2025, 9:46am
8
I got the problem fixed.
The input was indeed empty due to the lack of an explicit invoke of IVtkTools_ShapeDataSource::Update.
And the output has no ISO lines at all.
The final solution here:
Thank you very much buddies @jaswantp @Francois_Mazen