pyvista.PolygonSource

Contents

pyvista.PolygonSource#

class PolygonSource(
center: VectorLike[float] = (0.0, 0.0, 0.0),
radius: float = 1.0,
normal: VectorLike[float] = (0.0, 0.0, 1.0),
n_sides: int = 6,
fill: bool = True,
)[source]#

Polygon source algorithm class.

Added in version 0.44.0.

Parameters:
centersequence[float], default: (0.0, 0.0, 0.0)

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

radiusfloat, default: 1.0

The radius of the polygon.

normalsequence[float], default: (0.0, 0.0, 1.0)

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

n_sidesint, default: 6

Number of sides of the polygon.

fillbool, default: True

Enable or disable producing filled polygons.

Examples

Create an 8 sided polygon.

>>> import pyvista as pv
>>> source = pv.PolygonSource(n_sides=8)
>>> source.output.plot(show_edges=True, line_width=5)
../../../_images/pyvista-PolygonSource-1_00_00.png

Methods

Attributes

PolygonSource.center

Get the center in [x, y, z].

PolygonSource.fill

Get enable or disable producing filled polygons.

PolygonSource.n_sides

Get number of sides of the polygon.

PolygonSource.normal

Get the normal in [x, y, z].

PolygonSource.output

Get the output data object for a port on this algorithm.

PolygonSource.radius

Get the radius of the polygon.