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:
- pointa
np.ndarray
orlist
Location in
[x, y, z]
.- pointb
np.ndarray
orlist
Location in
[x, y, z]
.- center
np.ndarray
orlist
Location in
[x, y, z]
.- resolution
int
,optional
Number of pieces to divide circular arc into. Defaults to number of cells in the input mesh. Must be a positive integer.
- tolerance
float
,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,
optional
Display a progress bar to indicate progress.
- pointa
- Returns:
pyvista.PolyData
Arc containing the sampled data.
Examples
Sample a dataset over a circular arc and plot it.
>>> import pyvista >>> 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 = pyvista.Plotter() >>> _ = pl.add_mesh(uniform, style='wireframe') >>> _ = pl.add_mesh(sampled_arc, line_width=10) >>> pl.show_axes() >>> pl.show()