[Paraview] how to create a vtk.vtkParametricEllipsoid and write it to a VTK file?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Mar 30 11:07:56 EDT 2016


Rich,

Attached is a sample script that you can run using pvpython or pvbatch or
vtkpython executables.

Utkarsh

On Tue, Mar 29, 2016 at 1:35 PM, Cook, Rich <cook47 at llnl.gov> wrote:

> I'm still trying to solve my ellipsoid puzzle.
> From looking around online, I've found a promising avenue.  Create a
> vtk.vtkParametricEllipsoid, rotate it, and then write to VTK for my user.
> My question is, can someone help me finish this script?  I am hoping for
> an experienced user it's trivial.  My objective is to hand the user a
> python script to convert her data to VTK.
>
> from ? import ?  # WHAT GOES HERE?  Do I need to run this from paraview?
> for ellipsoid in ellipsoids:
>
> ellipsoid = vtk.vtkParametricEllipsoid()
> ellipsoid.SetXRadius(50)
> ellipsoid.SetYRadius(10)
> ellipsoid.SetZRadius(10)
> transform = vtk.vtkTransform()
> transform.RotateWXYZ(45,0,1,0)
>
> transform.Translate(100,200,50)
>
> # The magic:   connect the transform to the ellipsoid and add it to the
> scene.
>
> # HOW???
>
>
> # write all objects in the scene to a VTK file  Again, HOW?
>
> --
> ✐Richard Cook
> ✇ Lawrence Livermore National Laboratory
> Bldg-453 Rm-4024, Mail Stop L-557
> 7000 East Avenue,  Livermore, CA, 94550, USA
> ☎ (office) (925) 423-9605
> ☎ (fax) (925) 423-6961
> ---
> Information Management & Graphics Grp., Services & Development Div.,
> Integrated Computing & Communications Dept.
> (opinions expressed herein are mine and not those of LLNL)
>
>
>
>
> _______________________________________________
> 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:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160330/2cddd9b7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.py
Type: text/x-python
Size: 1241 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160330/2cddd9b7/attachment.py>


More information about the ParaView mailing list