# Examples from pyvista.DataObjectFilters.slice_along_line
# ========================================================

# Slice the random hills dataset along a circular arc.
import numpy as np
import pyvista as pv
from pyvista import examples
hills = examples.load_random_hills()
center = np.array(hills.center)
point_a = center + np.array([5, 0, 0])
point_b = center + np.array([-5, 0, 0])
arc = pv.CircularArc(
    pointa=point_a, pointb=point_b, center=center, resolution=100
)
line_slice = hills.slice_along_line(arc)

# Plot the circular arc and the hills mesh.
pl = pv.Plotter()
_ = pl.add_mesh(hills, smooth_shading=True, style='wireframe')
_ = pl.add_mesh(
    line_slice,
    line_width=10,
    render_lines_as_tubes=True,
    color='k',
)
_ = pl.add_mesh(arc, line_width=10, color='grey')
pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
