# Polyline section colors

**URL:** <https://discourse.vtk.org/t/polyline-section-colors/5314>\
**Category:** Development\
**Created:** [March 4, 2021, 8:46am UTC](https://discourse.vtk.org/t/polyline-section-colors/5314 "2021-03-04T08:46:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume\_Gillet](https://discourse.vtk.org/user_avatar/discourse.vtk.org/guillaume_gillet/32/3114_2.png) [@Guillaume\_Gillet](https://discourse.vtk.org/u/Guillaume_Gillet)\
**Post date:** [March 4, 2021, 8:46am UTC](https://discourse.vtk.org/t/polyline-section-colors/5314/1 "2021-03-04T08:46:26Z")

</div>

Hello, so i’m a new trainee and for my company i’m studying vtk in order to replace their 3D component, and for that reason i need to display boreholes as polylines, but the fact is that they want me to color each section of a polyline by a different color, is there any method native in vtk to do this? Or am i forced to split each polyline into multiple lines to color each one separately ?  
Thanks for any answer or advice that could helpme!

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [March 4, 2021, 8:55am UTC](https://discourse.vtk.org/t/polyline-section-colors/5314/2 "2021-03-04T08:55:12Z")

</div>

Use line cells instead of polylines cell.

---

<div class="post-metadata">

**Author:** ![Guillaume\_Gillet](https://discourse.vtk.org/user_avatar/discourse.vtk.org/guillaume_gillet/32/3114_2.png) [@Guillaume\_Gillet](https://discourse.vtk.org/u/Guillaume_Gillet)\
**Post date:** [March 4, 2021, 8:57am UTC](https://discourse.vtk.org/t/polyline-section-colors/5314/3 "2021-03-04T08:57:02Z")

</div>

How does it work? I mean have you got a link to some documentation i could read please? Thanks for the quick answer though!

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [March 4, 2021, 8:58am UTC](https://discourse.vtk.org/t/polyline-section-colors/5314/4 "2021-03-04T08:58:26Z")

</div>

here you go:

[https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/ColoredLines/](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/ColoredLines/)

---

<div class="post-metadata">

**Author:** ![Guillaume\_Gillet](https://discourse.vtk.org/user_avatar/discourse.vtk.org/guillaume_gillet/32/3114_2.png) [@Guillaume\_Gillet](https://discourse.vtk.org/u/Guillaume_Gillet)\
**Post date:** [March 4, 2021, 9:00am UTC](https://discourse.vtk.org/t/polyline-section-colors/5314/5 "2021-03-04T09:00:10Z")

</div>

Thank you!
