delaunay_2d#
- UnstructuredGrid.delaunay_2d(tol=1e-05, alpha=0.0, offset=1.0, bound=False, inplace=False, edge_source=None, progress_bar=False)#
Apply a 2D Delaunay filter along the best fitting plane.
This filter can be used to generate a 2d surface from a set of points on a plane. If you want to create a surface from a point cloud, see
pyvista.PolyDataFilters.reconstruct_surface()
.- Parameters
- tol
float
,optional
Specify a tolerance to control discarding of closely spaced points. This tolerance is specified as a fraction of the diagonal length of the bounding box of the points. Defaults to
1e-05
.- alpha
float
,optional
Specify alpha (or distance) value to control output of this filter. For a non-zero alpha value, only edges or triangles contained within a sphere centered at mesh vertices will be output. Otherwise, only triangles will be output. Defaults to
0.0
.- offset
float
,optional
Specify a multiplier to control the size of the initial, bounding Delaunay triangulation. Defaults to
1.0
.- boundbool,
optional
Boolean controls whether bounding triangulation points and associated triangles are included in the output. These are introduced as an initial triangulation to begin the triangulation process. This feature is nice for debugging output. Default
False
.- inplacebool,
optional
If
True
, overwrite this mesh with the triangulated mesh. DefaultFalse
.- edge_source
pyvista.PolyData
,optional
Specify the source object used to specify constrained edges and loops. If set, and lines/polygons are defined, a constrained triangulation is created. The lines/polygons are assumed to reference points in the input point set (i.e. point ids are identical in the input and source).
- progress_barbool,
optional
Display a progress bar to indicate progress. Default
False
.
- tol
- Returns
pyvista.PolyData
Mesh from the 2D delaunay filter.
Examples
First, generate 30 points on circle and plot them.
>>> import pyvista >>> points = pyvista.Polygon(n_sides=30).points >>> circle = pyvista.PolyData(points) >>> circle.plot(show_edges=True, point_size=15)
Use
delaunay_2d()
to fill the interior of the circle.>>> filled_circle = circle.delaunay_2d() >>> filled_circle.plot(show_edges=True, line_width=5)
See Create Triangulated Surface for more examples using this filter.