Intersection with terrain of partial ellipsoid

Is there a way to show intersection of ellipsoid with terrain ? For example ellipsoid yellow and intersection with mountain in red.
p.s. i found IntersectionTest method will it help ? any examples how it works ?
Screenshot from 2021-01-28 18-55-51

Wanted result something like this
Screenshot from 2021-01-25 16-19-16