pyvista.CircularArc

Contents

pyvista.CircularArc#

CircularArc(
pointa: VectorLike[float],
pointb: VectorLike[float],
center: VectorLike[float],
resolution: int = 100,
negative: bool = False,
) PolyData[source]#

Create a circular arc defined by two endpoints and a center.

The number of segments composing the polyline is controlled by setting the object resolution.

Parameters:
pointasequence[float]

Position of the first end point.

pointbsequence[float]

Position of the other end point.

centersequence[float]

Center of the circle that defines the arc.

resolutionint, default: 100

The number of segments of the polyline that draws the arc. Resolution of 1 will just create a line.

negativebool, default: False

By default the arc spans the shortest angular sector between pointa and pointb.

By setting this to True, the longest angular sector is used instead (i.e. the negative coterminal angle to the shortest one).

Returns:
pyvista.PolyData

Circular arc mesh.

Examples

Create a quarter arc centered at the origin in the xy plane.

>>> import pyvista as pv
>>> arc = pv.CircularArc([-1, 0, 0], [0, 1, 0], [0, 0, 0])
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(arc, color='k', line_width=10)
>>> _ = pl.show_bounds(location='all', font_size=30, use_2d=True)
>>> _ = pl.view_xy()
>>> pl.show()
../../../_images/pyvista-CircularArc-1_00_00.png