Polygon#
- Polygon(center=(0.0, 0.0, 0.0), radius=1.0, normal=(0, 0, 1), n_sides=6, fill=True)[source]#
Create a polygon.
- Parameters:
- center
Sequence
, default: (0.0, 0.0, 0.0) Center in
[x, y, z]
. Central axis of the polygon passes through this point.- radius
float
, default: 1.0 The radius of the polygon.
- normal
Sequence
, default: (0, 0, 1) Direction vector in
[x, y, z]
. Orientation vector of the polygon.- n_sides
int
, default: 6 Number of sides of the polygon.
- fillbool, default:
True
Enable or disable producing filled polygons.
- center
- Returns:
pyvista.PolyData
Mesh of the polygon.
Examples
Create an 8 sided polygon.
>>> import pyvista >>> mesh = pyvista.Polygon(n_sides=8) >>> mesh.plot(show_edges=True, line_width=5)