CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Extract Slice Plane Dimensions in PvPython

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2015, 10:44
Default Extract Slice Plane Dimensions in PvPython
  #1
New Member
 
Join Date: Oct 2015
Posts: 3
Rep Power: 7
AeroJ is on a distinguished road
Hi everyone,

Does anyone know how to (or if it possible to) obtain the coordinates of the vertices of a slice plane in PvPython?

I've been able to access the grid point coordinates contained within the slice with:

servermanager.Fetch(SliceName).GetPoint(PointIndex )

but I also need to find out where the vertices of the slice plane are so that I can construct a tangent vector to the plane.

Any help would be greatly appreciated!

Thanks!
AeroJ is offline   Reply With Quote

Old   October 16, 2015, 06:09
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 239
Rep Power: 9
Flowkersma is on a distinguished road
Hi,

Here are a few snippets that may interest you:

Bounding box:
Code:
bbox = slice.GetDataInformation().GetBounds()
print 'xbounds:', bbox[0:2], 'ybounds:', bbox[2:4], 'zbounds', bbox[4:]
Coordinates:
Code:
from paraview import numpy_support as ns
data = servermanager.Fetch(slice)
coordinates = ns.vtk_to_numpy(data.GetPoints().GetData())
print 'xcoords:', coordinates[:,0], 'ycoords:', coordinates[:,1], 'zcoords', coordinates[:,2]
Surface normals:
Code:
from paraview import numpy_support as ns
pvNormals = GenerateSurfaceNormals(slice)
data = servermanager.Fetch(pvNormals)
normals = ns.vtk_to_numpy(data.GetPointData().GetArray('Normals'))
print 'Normals', normals
Regards,
Mikko
Flowkersma is offline   Reply With Quote

Old   October 31, 2015, 19:52
Default
  #3
New Member
 
Join Date: Oct 2015
Posts: 3
Rep Power: 7
AeroJ is on a distinguished road
Thanks for that Mikko, they were very helpful snippets Is there any documentation anywhere that can tell me what attributes and methods the Paraview vtk objects have? Basically, is there any documentation with more snippets that might be useful??
AeroJ is offline   Reply With Quote

Old   November 3, 2015, 13:55
Default
  #4
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 7
Jack001 is on a distinguished road
Have you checked The ParaView Guide-v4.3? I found it really helpful so far in my quest to learn paraview.
Jack001 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[General] Smaller slice plane in paraview pssk1988 ParaView 2 April 22, 2019 22:49
[General] unwrap cylinder slice to flat plane openfoam_user ParaView 5 May 5, 2017 11:50
[General] Reducing the size of slice plane milidon ParaView 4 October 21, 2015 04:44
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
how to extract a yx plane and set as BC... sawyer86 OpenFOAM Running, Solving & CFD 0 March 19, 2012 11:43


All times are GMT -4. The time now is 11:31.