# VTK 9 broken lines

**URL:** https://discourse.vtk.org/t/vtk-9-broken-lines/13288
**Category:** Support
**Created:** [February 8, 2024, 11:06pm UTC](https://discourse.vtk.org/t/vtk-9-broken-lines/13288 "2024-02-08T23:06:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Blake\_Xi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blake_xi/32/8392_2.png) [@Blake\_Xi](https://discourse.vtk.org/u/Blake_Xi)
#### Post date: [February 8, 2024, 11:06pm UTC](https://discourse.vtk.org/t/vtk-9-broken-lines/13288/1 "2024-02-08T23:06:48Z")

</div>

Recently upgrade to VTK 9.3 from VTK 8.2. Found a strange issue on rendering lines. When zoom out too much the line will “disconnect” and almost looks like dotted line.  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/a/aa25af90ecbd4f454a100452e73a3eea6bbbe288.png)  
In vtk 8.2, no matter how much I zoom out it will always be normal.  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/81939240d61898ce1bf2ff3695e9d54e1fb7f8f7.png)

A slice of an stl object looks strange as well.  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/ff1fc579808818f6daf50feabc3720aa811f47b4.png)  
Zoomed in a bit more:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/e/e2c072628a673a110d68de5958922236e1ef03be.png)

In rare cases, it will show very fainted lines:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/8/859dcf418e71c9c67ebeaa64adc0a1b4b96fa70d.png)

---

<div class="post-metadata">

### Author: ![Blake\_Xi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blake_xi/32/8392_2.png) [@Blake\_Xi](https://discourse.vtk.org/u/Blake_Xi)
#### Post date: [February 8, 2024, 11:56pm UTC](https://discourse.vtk.org/t/vtk-9-broken-lines/13288/2 "2024-02-08T23:56:49Z")

</div>

Found two very similar issues: [Markups Line discontinuities - Support - 3D Slicer Community](https://discourse.slicer.org/t/markups-line-discontinuities/22189) [Upgrade vtk.js， Line rendering is inconsistent · Issue #2386 · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/issues/2386)  
Not sure what’s the solution here.

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 9, 2024, 1:00pm UTC](https://discourse.vtk.org/t/vtk-9-broken-lines/13288/3 "2024-02-09T13:00:41Z")

</div>

Perhaps try to turn on multisample anti-aliasing? I think it is discussed [here](https://discourse.vtk.org/t/how-to-anti-alias-in-vtkrenderwindow/4556).

---

<div class="post-metadata">

### Author: ![Blake\_Xi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blake_xi/32/8392_2.png) [@Blake\_Xi](https://discourse.vtk.org/u/Blake_Xi)
#### Post date: [February 9, 2024, 10:43pm UTC](https://discourse.vtk.org/t/vtk-9-broken-lines/13288/4 "2024-02-09T22:43:43Z")

</div>

Thanks! Using `renderWindow->SetMultiSamples(X);` actually fixed this issue.

---

<div class="post-metadata">

### Author: ![Blake\_Xi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blake_xi/32/8392_2.png) [@Blake\_Xi](https://discourse.vtk.org/u/Blake_Xi)
#### Post date: [February 9, 2024, 10:51pm UTC](https://discourse.vtk.org/t/vtk-9-broken-lines/13288/5 "2024-02-09T22:51:06Z")

</div>

However, I still think this is a potential bug, might be related to the pixel count. Even without anti-aliasing, there should not be any disconnection in the object outlines.
