# Visualization of defects in a 3D vector field as loops

**URL:** https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047
**Category:** ParaView Support
**Tags:** python, vtk
**Created:** [February 28, 2024, 3:27pm UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047 "2024-02-28T15:27:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![abhinavsns](https://discourse.paraview.org/user_avatar/discourse.paraview.org/abhinavsns/32/10946_2.png) [@abhinavsns](https://discourse.paraview.org/u/abhinavsns)
#### Post date: [February 28, 2024, 3:27pm UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047/1 "2024-02-28T15:27:02Z")

</div>

I have a 3D vector field data with a scalar that helps me identify regions in the vector field that are not aligned. I can extract the misaligned region with thresholding the scalar. These regions usually form a closed loop and now I want to render a tube at the cores of the misalignments. Is there a filter that can help with this?  
I tried using threshold on a streamline that gives me the normals but unable to render a tube that is perpendicular to the misalignments. Any help would be appreciated.

[data.pvsm](https://discourse.paraview.org/uploads/short-url/o4wAnBKc5evZsejqIeTktlbN1wG.pvsm) (566.7 KB)  
[data.vtu](https://discourse.paraview.org/uploads/short-url/dUqhg7DybsJtG6j61harwvgpop1.vtu) (1.2 MB)

 ![viz](https://discourse.paraview.org/uploads/default/original/2X/5/5b10c3c68d454337d791b1123016814f49d5d217.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: [February 28, 2024, 4:41pm UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047/2 "2024-02-28T16:41:23Z")

</div>

please share a screenshot and data.

---

<div class="post-metadata">

### Author: ![abhinavsns](https://discourse.paraview.org/user_avatar/discourse.paraview.org/abhinavsns/32/10946_2.png) [@abhinavsns](https://discourse.paraview.org/u/abhinavsns)
#### Post date: [February 28, 2024, 5:12pm UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047/3 "2024-02-28T17:12:03Z")

</div>

Thank you! The data is attached now.

---

<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: [February 29, 2024, 12:51pm UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047/4 "2024-02-29T12:51:47Z")

</div>

@Charles_Gueunet

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [March 2, 2024, 2:48pm UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047/5 "2024-03-02T14:48:36Z")

</div>

I don’t understand what the physics phenomenon is about, but wouldn’t a `Vortex Cores` filter help?

---

<div class="post-metadata">

### Author: ![Charles\_Gueunet](https://discourse.paraview.org/user_avatar/discourse.paraview.org/charles_gueunet/32/40_2.png) [@Charles\_Gueunet](https://discourse.paraview.org/u/Charles_Gueunet)
#### Post date: [March 5, 2024, 10:21am UTC](https://discourse.paraview.org/t/visualization-of-defects-in-a-3d-vector-field-as-loops/14047/6 "2024-03-05T10:21:53Z")

</div>

When computing the Gradient, you may have a look at the `Vorticity` option. It will compute a vector field, orthogonal to the gradient and pointing inward / outward vortices. Here is what I obtain with your data:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/9/93800ce2f7b8d119f697c4dab18438383ce23fb7.jpeg)

If you really need to extract one ring and one line, you may be interested in Topological Data Analysis. Using TTK, we have [this example](https://topology-tool-kit.github.io/examples/persistentGenerators_darkSky/) that may suits your need, but do not hesitate to ask for some guidance as it is not trivial to use.

Best,  
Charles
