|
[Sponsors] |
[General] Extract Slice Plane Dimensions in PvPython |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 15, 2015, 10:44 |
Extract Slice Plane Dimensions in PvPython
|
#1 |
New Member
Join Date: Oct 2015
Posts: 3
Rep Power: 11 |
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! |
|
October 16, 2015, 06:09 |
|
#2 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
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:] 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] 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 Mikko |
|
October 31, 2015, 19:52 |
|
#3 |
New Member
Join Date: Oct 2015
Posts: 3
Rep Power: 11 |
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??
|
|
November 3, 2015, 13:55 |
|
#4 |
Member
Jack
Join Date: May 2015
Posts: 98
Rep Power: 11 |
Have you checked The ParaView Guide-v4.3? I found it really helpful so far in my quest to learn paraview.
|
|
|
|
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 |