[Paraview] Scaling cylinder glyph's radius and height individually
Cory Quammen
cory.quammen at kitware.com
Tue Jan 9 09:30:22 EST 2018
Hi Ahmad,
Alas, reading the code of vtkGlyph3D, you cannot orient by a vector
array different from the vector array used to do the scaling using the
functionality in ParaView. You would have to modify either
vtkPVGlyphFilter or its parent class vtkGlyph3D, to do this, and
expose the new VTK class through a ParaView plugin [1]. A simple
modification would be to add a ScaleMode, say VTK_SCALE_BY_NORMAL, to
vtkGlyph3D, and then set the active normals in your data set to the
vector by which you wish to scale. Then the "vectors" property could
control the orientation and the active normals would control the
scale. That's kind of kludgey, but it would be a fairly fast
modification to make.
HTH,
Cory
[1] https://www.paraview.org/Wiki/ParaView/Plugin_HowTo
On Tue, Jan 9, 2018 at 7:43 AM, Ahmad . <super_achie at hotmail.com> wrote:
> Just want to add that a programmatic (C++) solution is preferred rather than
> using the GUI
>
>
> I have a C++ pipeline where I can set the properties of the cylinder glyph
> with vtkSMPropertyHelper.
>
> I have looked in filters.xml under vtkPVGlyphFilter source proxy (file
> located in
> <paraview_home>/ParaViewCore/ServerManager/SMApplication/Resources) to see
> what my options are, but there is only one "SetInputArrayToProcess" that
> takes a vector attribute as input; nothing about a vector specifically for
> orientation..
>
> Suggestions on how to handle this issue, are very welcome; other approaches
> than mine as well!
>
> ________________________________
> Van: Ahmad . <super_achie at hotmail.com>
> Verzonden: maandag 8 januari 2018 20:52
> Aan: paraview at paraview.org
> Onderwerp: Re: Scaling cylinder glyph's radius and height individually
>
>
> Following up on my own question, I found out that if I scale by "Vector
> Components" it is possible to change the length of the cylinders with the
> second vector index, and the radius with the first and third. I need to
> rearrange my attribute data as such: [radius_x, length, radius_z]. If I keep
> radius_x == radius_z, then the cylinder will not deform, and the cross
> section stays a perfect circle. See the image in the attachment please.
>
>
> BUT the problem here is that "vector components" also affects the
> orientation of my cylindrical glyphs. I can turn this off in the properties
> menu, but I need to orient my cylinders based on another vector attribute
> data...
>
>
> I feel I'm getting somewhere, but if someone could give me an idea on how to
> now orient my glyphs with another vector data than the one I use now for
> scaling, that would be much appreciated!
>
>
> Best,
> Ahmad
>
> ________________________________
> Van: Ahmad . <super_achie at hotmail.com>
> Verzonden: maandag 8 januari 2018 18:01
> Aan: paraview at paraview.org
> Onderwerp: Scaling cylinder glyph's radius and height individually
>
>
> Dear community,
>
>
> When I try to scale cylindrical glyph objects by a 'Scalar', it scales both
> the radius and height of the glyphs.
>
> Is there a way to scale the radius by a Scalar1, and the height be a
> Scalar2?
>
>
> I have an unstructured grid, and for each point I want to create a cylinder
> that can have an arbitrary radius and height.
>
> I thought Glyphs would be the way to go, but I'm kind of stuck with this
> issue.
>
>
> Any help is much appreciated; or if you can recommend a different way to
> achieve the above-mentioned please let me know!
>
>
> Best,
>
> Ahmad
>
>
> _______________________________________________
> 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 ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> https://paraview.org/mailman/listinfo/paraview
>
--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
More information about the ParaView
mailing list