# How to avoid rendering ISO lines on surfaces

**URL:** https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636
**Category:** Support
**Created:** [May 17, 2025, 10:49am UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636 "2025-05-17T10:49:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![samwit](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@samwit](https://discourse.vtk.org/u/samwit)
#### Post date: [May 17, 2025, 10:49am UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/1 "2025-05-17T10:49:16Z")

</div>

Hi vtk helpers,

There’re always ISO lines on surfaces rendered, as highlighted below:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/5a3ea0e395b8570ddd1fa9cc860f6b48e1df8e32.jpeg)

Here’s my code:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/fce342c94cc6bfcf8a4019f3bfd50ae066ff8680.png)

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?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [May 17, 2025, 12:52pm UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/2 "2025-05-17T12:52:12Z")

</div>

There are two solutions I can think of:

1. tweak the coincident offsets such that the lines appear below the surface. See vtkMapper:: SetResolveCoincidentTopology and vtkMapper::SetRelativeCoincidentTopologyLineOffsetParameters
2. 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.

---

<div class="post-metadata">

### Author: ![Francois\_Mazen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/francois_mazen/32/3290_2.png) [@Francois\_Mazen](https://discourse.vtk.org/u/Francois_Mazen)
#### Post date: [May 18, 2025, 10:47am UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/3 "2025-05-18T10:47:18Z")

</div>

> [@jaswantp](#):
>
> 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](https://vtk.org/doc/nightly/html/classvtkExtractCellsByType.html#details) by selecting all types except the line ones would do the trick?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [May 18, 2025, 6:13pm UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/4 "2025-05-18T18:13:06Z")

</div>

That is a good suggestion!

---

<div class="post-metadata">

### Author: ![samwit](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@samwit](https://discourse.vtk.org/u/samwit)
#### Post date: [May 19, 2025, 3:07am UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/5 "2025-05-19T03:07:58Z")

</div>

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:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/9/987f4d2680474bb9da6cf17bd680ef6f6a9a4686.png)

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [May 19, 2025, 1:32pm UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/6 "2025-05-19T13:32:00Z")

</div>

Can you confirm that the source has only triangles? Or is it quads?

---

<div class="post-metadata">

### Author: ![samwit](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@samwit](https://discourse.vtk.org/u/samwit)
#### Post date: [May 20, 2025, 1:51am UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/7 "2025-05-20T01:51:18Z")

</div>

I’m not sure, but I tried to add all the available cell types to the extraction filter.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/f90dc3a208c9d885b04478fcf1be95ef261bc361.png)

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:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/0/0f69107d8ccf815d6b82371fc14e21f1ae6da289.png)

I tried to direct the output to a VTK file, but it turned to be empty.

---

<div class="post-metadata">

### Author: ![samwit](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@samwit](https://discourse.vtk.org/u/samwit)
#### Post date: [May 20, 2025, 9:46am UTC](https://discourse.vtk.org/t/how-to-avoid-rendering-iso-lines-on-surfaces/15636/8 "2025-05-20T09:46:47Z")

</div>

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:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/2/277229a68102c67ad4030eeca9afe9081c4aca77.png)

Thank you very much buddies @jaswantp @Francois_Mazen
