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 Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2015, 09:44
Default Extract Slice Plane Dimensions in PvPython
  #1
New Member
 
Join Date: Oct 2015
Posts: 3
Rep Power: 10
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, 05:09
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
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, 18:52
Default
  #3
New Member
 
Join Date: Oct 2015
Posts: 3
Rep Power: 10
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, 12:55
Default
  #4
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 11
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


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 21:49
[General] unwrap cylinder slice to flat plane openfoam_user ParaView 5 May 5, 2017 10:50
[General] Reducing the size of slice plane milidon ParaView 4 October 21, 2015 03:44
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 02:09
how to extract a yx plane and set as BC... sawyer86 OpenFOAM Running, Solving & CFD 0 March 19, 2012 10:43


All times are GMT -4. The time now is 17:33.