[Paraview] ClipFunction Property

Adriano Gagliardi agagliardi at ara.co.uk
Thu Aug 13 03:25:53 EDT 2009


Hi,

There are some changes you need to make to get it to work.

from paraview.simple import * //use this to import the updated
ParaView-Python API

dataset = servermanager.sources.LegacyVTKreader(FileNames="myData.vtk")
dataset.UpdatePipeline()

clipper = servermanager.filters.Clip(Input=dataset)

//you can use clipper.GetProperty('ClipType').Available to see the available
options. You should get a list like this:
//['Plane', 'Box, 'Sphere', 'Scalar']
//set the clip type to plane
clipper.ClipType = Plane

//to set the properties of the plane
clipper.ClipType.Origin = [10.0,0.0,5.0]
clipper.ClipType.Normal = [1,0,0]
clipper.UpdatePipeline()

-------------

There are more options available.. use dir(servermanager.filters.Clip) and
dir(servermanager.filters.Clip.ClipType). Plus, I believe the latest release
has a trace functionality where-by you can have written to Python script any
action you perform interactively, which can help get you find these things
out.

Hope this helps.

===================================

Adriano Gagliardi MEng PhD
Project Scientist
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agagliardi at ara.co.uk
Url: www.ara.co.uk 
-----Original Message-----
From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
On Behalf Of Jeshua Lacock
Sent: 13 August 2009 08:06
To: paraview at paraview.org
Subject: [Paraview] ClipFunction Property


Greetings,

I am trying to script ParaView's 3.6.1 clip class.

My script is something like:

connection = servermanager.Connect()
from paraview.simple import *
from paraview import servermanager

dataset = LegacyVTKReader(FileNames="myData.vtk")

plane = servermanager.implicit_functions.Plane()
plane.Normal = [1,0,0]
plane.Origin = [10.0,0.0,5.0]

clipper = servermanager.filters.Clip(Input=inputFile)

clipper.ClipFunction = plane

Which causes the error:

Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/Users/kitware/ParaViewReleases/ParaView-3.6/ParaView3Bin/
Utilities/VTKPythonWrapping/paraview/servermanager.py", line 197, in
__setattr__
AttributeError: Attribute ClipFunction does not exist.  This class does not
allow addition of new attributes to avoid mistakes due to typos. Use
add_attribute() if you really want to add this attribute.

All of the documentation I can find on servermanager.filters.Clip shows use
of the ClipFunction property. I guess with 3.6.1 it no longer exists?

How do I set the plane without it? I don't see any plane property for
servermanager.filters.Clip.

Can anyone point me to documentation for how to set the plane for the
filter?


Thank you,

Jeshua Lacock
Founder/Programmer
3DTOPO Incorporated
<http://3DTOPO.com>
Phone: 208.462.4171

_______________________________________________
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

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


---------------------------
This email contains information that is private and confidential and is intended only for the addressee.  If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons.
Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245




More information about the ParaView mailing list