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

Cook, Rich cook47 at llnl.gov
Wed Mar 30 12:38:40 EDT 2016


Here is a working solution that I developed with much help from this list and especially David DeMarle (and probably you, Utkarsh), along with a sample data file.


On Mar 30, 2016, at 8:07 AM, Utkarsh Ayachit <utkarsh.ayachit at kitware.com<mailto:utkarsh.ayachit at kitware.com>> wrote:

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<mailto: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<tel:%28925%29%20423-9605>
☎ (fax) (925) 423-6961<tel:%28925%29%20423-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<http://secure-web.cisco.com/1ortPqUlji2GoZo2RSdhxP3AI6cEdi2ap0jKeswJ_7lkEVI-VzqTwdyQIGJ4cIypf_zrvHAAIGO0mD7AC7HyZ9fsrMJy4c63CxPHOpEw6NaSFGX5GveTxzspw7XnM9a7Y43ul4yEgW8_z9ji6ZcNQDQgIoyK8uNuc5pNchFIopm71zC9W_3GomNOUdBvhdhdR4SOC0M4JsPBhHl6YuLNdN_XFbnPvyesyyW0EhasAQls8WCQkhlJWcKHcBZWukup2CqPz7YozeGbVqHl6VYdMBF5U954vvQYsA6UFaGsYBFvh1jOnHKvPHWT5pmY48z-vPlCePVClzNTHHnvCF9OjusCSkUIYjcUffJgBwcW29CqKTQ2_ONwKiX_hPV7qmsve/http%3A%2F%2Fwww.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<http://secure-web.cisco.com/1Vf0smVBSzXh-Ov2c-OCGjA7unhsO9_P0K0VfzpHJEitUtESoKsZ5PqzlsXQVB35nQsIw1UdrVYHmvP_u7E6pUmKqxECnWev1d8bMD9OBUhJNYPQ3TM36cKK53Nd9Cg5XAEqW4BOkGhTo6MbfBSFVOJy1OwV5dJxZzDNWmk80trhh2sBbWVzRxvEHxlQ8I2YQS10GTVeu0uWH4Qg-4Hdnp4UWlQN0QBQky_XolZSuFoXXFWi27ZubBiaqUo1PGnsCom_jscjwWVumrc2k5f0u0PASok6V0DRR0kgI6t9AIqexJvVGBoXMPVGJWRHgGsEfyssviKqabcTpCpKlVLIDBJMxJEZS_zcmckkRTh7VNcZQpA2lbzVhCx5A9pvaW1gT/http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html>

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView<http://secure-web.cisco.com/1gMvNKYfoBcd6FEGyz3Z5vPGQ-j2UJlU1dp01XHmK9Bo_qUuUWHSccCewsEcvob_RwMSA_176IsqaoIbwKtJdFh3AMwdhOqu7w0HJen9J4FSrsBQHhG297XuiJc7d7CSwTRXzeIgulN1IbISPO-zCjiHtrTWMpaV9sbjfaiOk1wYzFdhoT_b2g9JF0QmLQsUt4A1iMOe-wiiIc5kfhOerxC_5n_erFT5nFCGJm5FYogUXxRKfUNyo-AYTdOHaqYiAiHQiMoIEtLE2MbLzw8-wKhEk-c4EevJPbcDQ6wjm95uk9nEIS4zGZJkci906RZzJAEv1z-DkNRl3ei1fHBomav7M4b4NHiBpE7XXb0YSdt40QpElyRu7mfhSDfg1AKMW/http%3A%2F%2Fparaview.org%2FWiki%2FParaView>

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview<http://secure-web.cisco.com/1LfjDkIeiov9cRryNT-1cO9sV9YOVRAPyvyeOkwttqzJq8VnN0NqVRH5Cl-88y8-Xk8Mb3rRgasWM1LSDF2MNlm6f-JpVLVJGHaQNMV_sqAJbcNWgkHa1Wz0jUYYb73Yu2T9tjxAZHHUK3Qh0VYHvZzTauvcF1Isc_-gZQwQTH0HHGtxx2Ve0-Ui54y5MGfHk50XjfvlGBosbfJZd_l8qP67L6VvvBFgdN1lNRolJmAC3czRNjkE8c4bDsW-Fdj0Y8DQAEgLfRjnWQi1vRfdYLCA1PNseW3VcgtnrIlA5BQqiQJna30ugnwOxJ-nthlwuA8rMk2_JmjiYB7NAd38RxeNAPDwpG-H0CnAI80mTvIrQoSxU35TvB6LqB7VBcsyF/http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fparaview>


<sample.py>

--
✐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)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160330/67fdfe6f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inclusionFile2ellipsoidVTK.py
Type: text/x-python-script
Size: 2479 bytes
Desc: inclusionFile2ellipsoidVTK.py
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160330/67fdfe6f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_inclusionsV2.dat
Type: application/octet-stream
Size: 1263 bytes
Desc: test_inclusionsV2.dat
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160330/67fdfe6f/attachment.obj>


More information about the ParaView mailing list