pyvista.Rectangle

Contents

pyvista.Rectangle#

Rectangle(points: MatrixLike[float] | None = None) PolyData[source]#

Create a rectangle defined by 3 points.

The 3 points must define an orthogonal set of vectors.

Parameters:
pointsarray_like[float], optional

Points of the rectangle. Defaults to a unit square in xy-plane.

Returns:
pyvista.PolyData

Rectangle mesh.

Examples

>>> import pyvista as pv
>>> pointa = [1.0, 0.0, 0.0]
>>> pointb = [1.0, 1.0, 0.0]
>>> pointc = [0.0, 1.0, 0.0]
>>> rectangle = pv.Rectangle([pointa, pointb, pointc])
>>> rectangle.plot(show_edges=True, line_width=5)
../../../_images/pyvista-Rectangle-1_00_00.png