PolyDataFilters.ruled_surface#
- PolyDataFilters.ruled_surface(
- *,
- resolution: VectorLikeInt | None = None,
- progress_bar: bool = False,
Create a ruled surface from a polyline.
Added in version 0.45.0.
This filter is a filter that generates a surface from a set of lines. The lines are assumed to be “parallel” in the sense that they do not intersect and remain somewhat close to one another. A surface is generated by connecting the points defining each pair of lines with straight lines. This creates a strip for each pair of lines (that is, a triangulation is created from two generating lines). The filter can handle an arbitrary number of lines, with lines
iandi + 1assumed connected. Note that there are several different approaches for creating the ruled surface, the method for creating the surface can either use the input points or resample from the polylines (using a user-specified resolution).This filter implements vtkRuledSurfaceFilter.
- Parameters:
- resolution
VectorLikeInt, default: (1, 1) Set the number of points in the output polyline.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- resolution
- Returns:
pyvista.PolyDataRuled surface.
Examples#
Download Python source code | Download Jupyter notebook
Create a ruled surface from a polyline.
>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> poly = pv.PolyData(
... [[0, 0, 1], [1, 0, 0], [0, 1, 0], [1, 1, 1]],
... lines=[[2, 0, 1], [2, 2, 3]],
... force_float=False,
... )
>>> surface = poly.ruled_surface(resolution=(21, 21))
>>> _ = pl.add_mesh(surface, show_edges=True)
>>> pl.show()