[vtkusers] vtkArrayCalculator function definition syntax????
Randall Hand
randall.hand at gmail.com
Fri Apr 14 14:08:04 EDT 2006
Unfortunately, VTK's array calculator does not support true cross product
computation. I have a patch in bug 2903 (
http://www.vtk.org/Bug/bug.php?op=show&bugid=2903&pos=19 ) that adds a
"cross(X,Y)" function, but it hasn't been integrated yet. You can probably
grab it & replace your vtkFunctionParser with it and it'll work.
In the meantime, you've got 2 options:
1) Load your vectors in a 3-scalars, and then perform the cross product
yourself as you've shown.
2) Use V.ihat, V.jhat, and V.khat to access the 3 components (read:
Vector dot i-unit vector, etc)
also, you can't directly write back the results into components.. So you'll
have to compute each component & multiply by ihat/jhat/khat and then add the
3 parts together... It's gonna be one massive & messy function line. And
slow to run......
On 4/14/06, W.T. Bridgman <William.T.Bridgman.1 at gsfc.nasa.gov> wrote:
>
> I want to do a cross product of two vector datasets.
>
> I can't find any documentation (both the vtk list & Google) on
> vtkArrayCalculator or vtkFunctionParser to implement this.
>
> How would I code the SetFunction for this? Does the parser recognize
> vector components?
>
> E[3]=V[2]*B[1]-V[1]*B[2], etc.
>
> Thanks,
> Tom
> --
> Dr. William T."Tom" Bridgman Scientific Visualization
> Studio
> Global Science & Technology, Inc. NASA/Goddard Space Flight
> Center
> Email: William.T.Bridgman.1 at gsfc.nasa.gov Code 610.3
> Phone: 301-286-1346 Greenbelt, MD 20771
> FAX: 301-286-1634 http://svs.gsfc.nasa.gov/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060414/7434ad91/attachment.htm>
More information about the vtkusers
mailing list