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)
def set_cell_type(self, cell_type): PointsToTube.set_cell_type(self, cell_type)
def set_use_unique_points(self, flag): PointsToTube.set_use_unique_points(self, flag)
def set_capping(self, flag): PointsToTube.set_capping(self, flag)
def set_use_nearest_nbr(self, flag): PointsToTube.set_use_nearest_nbr(self, flag)
def set_number_of_sides(self, num): PointsToTube.set_number_of_sides(self, num)
def set_radius(self, radius): PointsToTube.set_radius(self, radius)
def __init__(self): PointsToTube.__init__(self)