Esempio n. 1
0
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.
"""
# sphinx_gallery_thumbnail_number = 2
import vista
import numpy as np
from PVGeo.filters import PointsToTube

###############################################################################


def path(y):
    """Equation: x = a(y-h)^2 + k"""
    a = -110.0 / 160.0**2
    x = a * y**2 + 110.0
    return x, y


x, y = path(np.arange(0.0, 200.0, 25.0))
zo = np.linspace(9.0, 11.0, num=len(y))
points = vista.PolyData(np.c_[x, y, zo])

points.plot(point_size=10)

###############################################################################

# Use the filter: here is vtkPolyData containing the tube
tube = PointsToTube(nearestNbr=True).apply(points)
tube.plot(color=True)
Esempio n. 2
0
 def set_cell_type(self, cell_type):
     PointsToTube.set_cell_type(self, cell_type)
Esempio n. 3
0
 def set_use_unique_points(self, flag):
     PointsToTube.set_use_unique_points(self, flag)
Esempio n. 4
0
 def set_capping(self, flag):
     PointsToTube.set_capping(self, flag)
Esempio n. 5
0
 def set_use_nearest_nbr(self, flag):
     PointsToTube.set_use_nearest_nbr(self, flag)
Esempio n. 6
0
 def set_number_of_sides(self, num):
     PointsToTube.set_number_of_sides(self, num)
Esempio n. 7
0
 def set_radius(self, radius):
     PointsToTube.set_radius(self, radius)
Esempio n. 8
0
 def __init__(self):
     PointsToTube.__init__(self)