pyvista.DataSetFilters.sample_over_circular_arc#

DataSetFilters.sample_over_circular_arc(pointa, pointb, center, resolution=None, tolerance=None, progress_bar=False)[source]#

Sample a dataset over a circular arc.

Parameters:
pointasequence[float]

Location in [x, y, z].

pointbsequence[float]

Location in [x, y, z].

centersequence[float]

Location in [x, y, z].

resolutionint, optional

Number of pieces to divide circular arc into. Defaults to number of cells in the input mesh. Must be a positive integer.

tolerancefloat, optional

Tolerance used to compute whether a point in the source is in a cell of the input. If not given, tolerance is automatically generated.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.PolyData

Arc containing the sampled data.

Examples

Sample a dataset over a circular arc and plot it.

>>> import pyvista as pv
>>> from pyvista import examples
>>> uniform = examples.load_uniform()
>>> uniform["height"] = uniform.points[:, 2]
>>> pointa = [
...     uniform.bounds[1],
...     uniform.bounds[2],
...     uniform.bounds[5],
... ]
>>> pointb = [
...     uniform.bounds[1],
...     uniform.bounds[3],
...     uniform.bounds[4],
... ]
>>> center = [
...     uniform.bounds[1],
...     uniform.bounds[2],
...     uniform.bounds[4],
... ]
>>> sampled_arc = uniform.sample_over_circular_arc(
...     pointa, pointb, center
... )
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(uniform, style='wireframe')
>>> _ = pl.add_mesh(sampled_arc, line_width=10)
>>> pl.show_axes()
>>> pl.show()
../../../_images/pyvista-DataSetFilters-sample_over_circular_arc-1_00_00.png