import jax
import matplotlib.pyplot as plt

from differt2d.geometry import FermatPath, Vertex
from differt2d.scene import Scene

ax = plt.gca()
scene = Scene.square_scene_with_wall()
wall = scene.objects[-1]
scene = scene.add_objects(*wall.get_vertices())
_ = scene.plot(ax)
scene = scene.filter_objects(lambda o: isinstance(o, Vertex))
key = jax.random.PRNGKey(1234)

for _, _, path, _ in scene.all_valid_paths(
    order=1,
    path_cls=FermatPath,
    key=key,
):
    path.plot(ax)

plt.show()  # doctest: +SKIP