Polygon

Polygon(center=(0.0, 0.0, 0.0), radius=1, normal=(0, 0, 1), n_sides=6)

Create a polygon.

Parameters
centeriterable, optional

Center in [x, y, z]. Central axis of the polygon passes through this point.

radiusfloat, optional

The radius of the polygon.

normaliterable, optional

Direction vector in [x, y, z]. Orientation vector of the polygon.

n_sidesint, optional

Number of sides of the polygon.

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)
../../../_images/pyvista-Polygon-1_00_00.png