Point/Line Sets¶
Add Cell Connectivity to Points¶

class
PVGeo.filters.xyz.
AddCellConnToPoints
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterBase
This filter will add linear cell connectivity between scattered points. You have the option to add
VTK_Line
orVTK_PolyLine
connectivity.VTK_Line
connectivity makes a straight line between the points in order (either in the order by index or using a nearest neighbor calculation). TheVTK_PolyLine
adds a poly line connectivity between all points as one spline (either in the order by index or using a nearest neighbor calculation). Type map is specified in vtkCellType.h.Cell Connectivity Types:
 4: Poly Line
 3: Line
Convert XYZ Units¶

class
PVGeo.filters.xyz.
ConvertUnits
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterPreserveTypeBase
Convert points in an input data object to from meters to feet or vice versa. This simply uses a
vtkTransformFilter
and scales input data object with common conversions.
Extract Cell Centers¶

class
PVGeo.filters.xyz.
ExtractCellCenters
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterBase
Extract Points¶

class
PVGeo.filters.xyz.
ExtractPoints
[source]¶ Bases:
PVGeo.base.FilterBase
Extracts XYZ coordinates and point/cell data from an input
vtkDataSet
Iterate Over Points¶

class
PVGeo.filters.xyz.
IterateOverPoints
(dt=1.0)[source]¶ Bases:
PVGeo.base.FilterBase
Iterate over points in a time varying manner.
Lat Lon To UTM¶

class
PVGeo.filters.xyz.
LonLatToUTM
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterBase
Converts Points from Lon Lat to UTM

_LonLatToUTM__Convert2D
(lon, lat, elev)¶ Converts 2D Lon Lat coords to 2D XY UTM points

Points to Tube¶

class
PVGeo.filters.xyz.
PointsToTube
(num_sides=20, radius=10.0, capping=False, **kwargs)[source]¶ Bases:
PVGeo.filters.xyz.AddCellConnToPoints
Takes points from a vtkPolyData object and constructs a line of those points then builds a polygonal tube around that line with some specified radius and number of sides.
Rotate Points¶

class
PVGeo.filters.xyz.
RotatePoints
(angle=45.0, origin=[0.0, 0.0], useCorner=True)[source]¶ Bases:
PVGeo.base.FilterBase
Rotates XYZ coordinates in vtkPolyData around an origin at a given angle on the XY plane.
Rotation Tool¶

class
PVGeo.filters.xyz.
RotationTool
(decimals=6)[source]¶ Bases:
object
A class that holds a set of methods/tools for performing and estimating coordinate rotations.

EstimateAndRotate
(x, y, z)[source]¶ A method to estimate the rotation of a set of points and correct that rotation on the XY plane

static
RotateAround
(pts, theta, origin)[source]¶ Rotate points around an origins given an anlge on the XY plane

static
RotationMatrix
(vector_orig, vector_fin)[source]¶ Calculate the rotation matrix required to rotate from one vector to another. For the rotation of one vector to another, there are an infinit series of rotation matrices possible. Due to axially symmetry, the rotation axis can be any vector lying in the symmetry plane between the two vectors. Hence the axisangle convention will be used to construct the matrix with the rotation axis defined as the cross product of the two vectors. The rotation angle is the arccosine of the dot product of the two unit vectors. Given a unit vector parallel to the rotation axis, w = [x, y, z] and the rotation angle a, the rotation matrix R is:
 1 + (1cos(a))*(x*x1) z*sin(a)+(1cos(a))*x*y y*sin(a)+(1cos(a))*x*z  R =  z*sin(a)+(1cos(a))*x*y 1 + (1cos(a))*(y*y1) x*sin(a)+(1cos(a))*y*z   y*sin(a)+(1cos(a))*x*z x*sin(a)+(1cos(a))*y*z 1 + (1cos(a))*(z*z1) 
Parameters:  vector_orig (umpy array, len 3) – The unrotated vector defined in the reference frame.
 vector_fin (numpy array, len 3) – The rotated vector defined in the reference frame.
Note
This code was adopted from printipi under the MIT license.
