Elevated plane physics

Hi, what is the best way to make the sphere on a plane with elevations and prevent it from going lower

I tried Cannon.js previously, and I am not sure if creating trimesh will help me get the results I am looking for.

three-mesh-bvh spherecast.