# Examples from pyvista.PolyDataFilters.multi_ray_trace
# =====================================================

# Compute the intersection between rays from the origin in
# directions `[1, 0, 0]`, `[0, 1, 0]` and `[0, 0, 1]`, and
# a sphere with radius 0.5 centered at the origin
import pyvista as pv
sphere = pv.Sphere()
points, rays, cells = sphere.multi_ray_trace(
    [[0, 0, 0]] * 3,
    [[1, 0, 0], [0, 1, 0], [0, 0, 1]],
    first_point=True,
)
string = ', '.join(
    [
        f'({point[0]:.3f}, {point[1]:.3f}, {point[2]:.3f})'
        for point in points
    ]
)
f'Rays intersected at {string}'

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