# Coloring surface streamlines according to sense of rotation

**URL:** https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692
**Category:** ParaView Support
**Created:** [May 22, 2025, 1:05am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692 "2025-05-22T01:05:40Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![scabo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@scabo](https://discourse.paraview.org/u/scabo)
#### Post date: [May 22, 2025, 1:05am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/1 "2025-05-22T01:05:40Z")

</div>

Hi  
I have streamlines on the surface of a cross-section both clockwise and anticlockwise rotating. I want to color it differently according to their sense of rotation, red for clock, blue for anti. How can i do it in Paraview?  
thanks

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2025, 7:41am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/2 "2025-05-22T07:41:16Z")

</div>

Please share your data and an illustration of what you want to do.

---

<div class="post-metadata">

### Author: ![scabo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@scabo](https://discourse.paraview.org/u/scabo)
#### Post date: [May 22, 2025, 8:48am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/3 "2025-05-22T08:48:24Z")

</div>

Hi, I have just shared the data called Surface Streamlines via WeTransfer. I want to plot the streamlines with y and z component of velocities on a 2D cross-section of the pipe. But colored according to sense of rotation exactly like the picture below. The corner streamline on the c/s should be colored by one color and the core one with another color. Attached picture.

 ![secondary_flow_streamlines](https://discourse.paraview.org/uploads/default/original/3X/3/6/36463dc48c57b5862c06d7caad9926f47ab09d17.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2025, 8:52am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/4 "2025-05-22T08:52:29Z")

</div>

Use Contour filter.

---

<div class="post-metadata">

### Author: ![scabo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@scabo](https://discourse.paraview.org/u/scabo)
#### Post date: [May 22, 2025, 8:56am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/5 "2025-05-22T08:56:32Z")

</div>

But for the streamlines dont we have to do surface vectors on a slice and then do glyph? But i do not know how to color the streamlines differently. Those are not contour lines but streamlines..can you please explain a bit more, thanks..

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2025, 8:57am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/6 "2025-05-22T08:57:41Z")

</div>

Ha sorry, I missed that you need streamlines. I’ll investigate with your data.

---

<div class="post-metadata">

### Author: ![scabo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@scabo](https://discourse.paraview.org/u/scabo)
#### Post date: [May 22, 2025, 8:58am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/7 "2025-05-22T08:58:59Z")

</div>

Yes, they have done by plotting contours of streamfunction which also gives streamlines but i am doing in using glyph on surface vectors on a 2D slice. Otherwise i need to define the streamfunction seperately again..

---

<div class="post-metadata">

### Author: ![scabo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@scabo](https://discourse.paraview.org/u/scabo)
#### Post date: [May 22, 2025, 1:14pm UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/8 "2025-05-22T13:14:39Z")

</div>

Hey did you have a chance to look at it? thanks

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2025, 1:41pm UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/9 "2025-05-22T13:41:07Z")

</div>

I’m afraid I dont see a simple way to compute the sense of rotation of a line. You will need a custom programmable filter for that.

---

<div class="post-metadata">

### Author: ![scabo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/a6a055/32.png) [@scabo](https://discourse.paraview.org/u/scabo)
#### Post date: [May 22, 2025, 5:11pm UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/10 "2025-05-22T17:11:00Z")

</div>

Is doing the custom filter very complex? means how to do that?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 23, 2025, 7:06am UTC](https://discourse.paraview.org/t/coloring-surface-streamlines-according-to-sense-of-rotation/16692/11 "2025-05-23T07:06:31Z")

</div>

Its not easy, but its not super hard either. Doc is here: [5. Programmable Filter — ParaView Documentation 5.12.0 documentation](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html)
