place arrows equally spaced along streamlines

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

place arrows equally spaced along streamlines

Dan Lipsa-2
Hi all,
I would like to place arrow glyphs equally spaced along streamlines. I am using vtkStreamTracer.
The only way I see to do this is to add an option to vtkStreamTracer to compute the distance from the seed and add this as a point data to the the streamline. Than, I can use contour to get the points where I need to place the arrows.

Is there any other simpler way? Do you have any suggestions with this?

Thanks,
Dan


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Cory Quammen-2
Dan,

Another way would be to normalize your vector field, run the stream
tracer on it, and then contour by integration time. That should give
you evenly spaced samples along the streamline when you run the
contour filter on it.

A quick test of this in ParaView looks like it should work. See
attached images. The one with the normalized velocity field has even
spacing, the one with the non-normalized velocity field does not.

Cory

On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:

> Hi all,
> I would like to place arrow glyphs equally spaced along streamlines. I am
> using vtkStreamTracer.
> The only way I see to do this is to add an option to vtkStreamTracer to
> compute the distance from the seed and add this as a point data to the the
> streamline. Than, I can use contour to get the points where I need to place
> the arrows.
>
> Is there any other simpler way? Do you have any suggestions with this?
>
> Thanks,
> Dan
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>


--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

EvenSpacing.png (80K) Download Attachment
NoNormalization.png (83K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Dan Lipsa-2
Thanks Cory!
This works very nice!

Dan


On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Another way would be to normalize your vector field, run the stream
tracer on it, and then contour by integration time. That should give
you evenly spaced samples along the streamline when you run the
contour filter on it.

A quick test of this in ParaView looks like it should work. See
attached images. The one with the normalized velocity field has even
spacing, the one with the non-normalized velocity field does not.

Cory

On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
> Hi all,
> I would like to place arrow glyphs equally spaced along streamlines. I am
> using vtkStreamTracer.
> The only way I see to do this is to add an option to vtkStreamTracer to
> compute the distance from the seed and add this as a point data to the the
> streamline. Than, I can use contour to get the points where I need to place
> the arrows.
>
> Is there any other simpler way? Do you have any suggestions with this?
>
> Thanks,
> Dan
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Cory Quammen-2
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:

> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Andy Bauer
If exact math was done with integrating the streamlines you should get the same result, regardless of the vector magnitude. Since we are numerically integrating though it may be off a bit.

On Mon, Mar 20, 2017 at 4:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:
> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Andy Bauer
For this you would have to normalize the vector after doing the interpolation instead of on the full velocity field.

On Mon, Mar 20, 2017 at 4:13 PM, Andy Bauer <[hidden email]> wrote:
If exact math was done with integrating the streamlines you should get the same result, regardless of the vector magnitude. Since we are numerically integrating though it may be off a bit.

On Mon, Mar 20, 2017 at 4:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:
> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Shawn Waldon-2
Not VTK, but ParaView has a vtkAppendArcLength filter [1] that you can use to append the distance along a polyline as a data array.  Then could you use that to get your evenly spaced points?  It could be moved down into VTK if someone needed it there.  I'm not sure how it handles multiple lines in the input dataset though.

Shawn

[1]: http://www.paraview.org/ParaView/Doc/Nightly/www/cxx-doc/classvtkAppendArcLength.html

On Mon, Mar 20, 2017 at 4:22 PM, Andy Bauer <[hidden email]> wrote:
For this you would have to normalize the vector after doing the interpolation instead of on the full velocity field.

On Mon, Mar 20, 2017 at 4:13 PM, Andy Bauer <[hidden email]> wrote:
If exact math was done with integrating the streamlines you should get the same result, regardless of the vector magnitude. Since we are numerically integrating though it may be off a bit.

On Mon, Mar 20, 2017 at 4:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:
> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Dan Lipsa-2
In reply to this post by Cory Quammen-2
Cory,
That's a pity! It worked beautifully! :-)

I could not see any difference between streamlines generated from the normalized vector field and the streamlines generated from the original field.

I could not understand why and still don't as the interpolated vectors will be different (and have different direction) if you normalize the original vectors.
Maybe as Andy said, you'll still have the correct vectors in the points of the dataset and the differences in the interpolated vectors are small.


On Mon, Mar 20, 2017 at 4:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:
> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Dan Lipsa-2
In reply to this post by Shawn Waldon-2
Shawn,
I don't think this filter will work because you can interpolate in both directions from a seed which means that you'll have a jump between some points. Seems the easiest would be just to add an additional array in vtkStreamTracer.

Dan


On Mon, Mar 20, 2017 at 4:39 PM, Shawn Waldon <[hidden email]> wrote:
Not VTK, but ParaView has a vtkAppendArcLength filter [1] that you can use to append the distance along a polyline as a data array.  Then could you use that to get your evenly spaced points?  It could be moved down into VTK if someone needed it there.  I'm not sure how it handles multiple lines in the input dataset though.

Shawn

[1]: http://www.paraview.org/ParaView/Doc/Nightly/www/cxx-doc/classvtkAppendArcLength.html

On Mon, Mar 20, 2017 at 4:22 PM, Andy Bauer <[hidden email]> wrote:
For this you would have to normalize the vector after doing the interpolation instead of on the full velocity field.

On Mon, Mar 20, 2017 at 4:13 PM, Andy Bauer <[hidden email]> wrote:
If exact math was done with integrating the streamlines you should get the same result, regardless of the vector magnitude. Since we are numerically integrating though it may be off a bit.

On Mon, Mar 20, 2017 at 4:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:
> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: place arrows equally spaced along streamlines

Dan Lipsa-2
It turns out that each direction for streamlines is in its own cell, so vtkAppendArcLength works very nice. I'll move that to VTK.

Thanks Shawn!
Dan


On Mon, Mar 20, 2017 at 5:42 PM, Dan Lipsa <[hidden email]> wrote:
Shawn,
I don't think this filter will work because you can interpolate in both directions from a seed which means that you'll have a jump between some points. Seems the easiest would be just to add an additional array in vtkStreamTracer.

Dan


On Mon, Mar 20, 2017 at 4:39 PM, Shawn Waldon <[hidden email]> wrote:
Not VTK, but ParaView has a vtkAppendArcLength filter [1] that you can use to append the distance along a polyline as a data array.  Then could you use that to get your evenly spaced points?  It could be moved down into VTK if someone needed it there.  I'm not sure how it handles multiple lines in the input dataset though.

Shawn

[1]: http://www.paraview.org/ParaView/Doc/Nightly/www/cxx-doc/classvtkAppendArcLength.html

On Mon, Mar 20, 2017 at 4:22 PM, Andy Bauer <[hidden email]> wrote:
For this you would have to normalize the vector after doing the interpolation instead of on the full velocity field.

On Mon, Mar 20, 2017 at 4:13 PM, Andy Bauer <[hidden email]> wrote:
If exact math was done with integrating the streamlines you should get the same result, regardless of the vector magnitude. Since we are numerically integrating though it may be off a bit.

On Mon, Mar 20, 2017 at 4:08 PM, Cory Quammen <[hidden email]> wrote:
Dan,

Actually, I think I'm wrong. I think you would get different
streamline results by changing the vector magnitudes. You'll
definitely get evenly spaced glyphs by normalizing, though :-) Too bad
the streamlines will be wrong.

I can't think of any other tricks using existing tools in VTK to do
this - you would need a scalar field along the streamline giving the
distance from seed point.

Cory

On Wed, Mar 15, 2017 at 9:20 PM, Dan Lipsa <[hidden email]> wrote:
> Thanks Cory!
> This works very nice!
>
> Dan
>
>
> On Wed, Mar 15, 2017 at 12:08 PM, Cory Quammen <[hidden email]>
> wrote:
>>
>> Dan,
>>
>> Another way would be to normalize your vector field, run the stream
>> tracer on it, and then contour by integration time. That should give
>> you evenly spaced samples along the streamline when you run the
>> contour filter on it.
>>
>> A quick test of this in ParaView looks like it should work. See
>> attached images. The one with the normalized velocity field has even
>> spacing, the one with the non-normalized velocity field does not.
>>
>> Cory
>>
>> On Wed, Mar 15, 2017 at 11:44 AM, Dan Lipsa <[hidden email]> wrote:
>> > Hi all,
>> > I would like to place arrow glyphs equally spaced along streamlines. I
>> > am
>> > using vtkStreamTracer.
>> > The only way I see to do this is to add an option to vtkStreamTracer to
>> > compute the distance from the seed and add this as a point data to the
>> > the
>> > streamline. Than, I can use contour to get the points where I need to
>> > place
>> > the arrows.
>> >
>> > Is there any other simpler way? Do you have any suggestions with this?
>> >
>> > Thanks,
>> > Dan
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Search the list archives at: http://markmail.org/search/?q=vtkusers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...