How can I get a view rectangle with a distant camera?

I have a sandcastle.

I have a lot of polyline entities I need to add. By “a lot”, I mean thousands. If I try to add them all, Cesium ceasing reasonable function. So, I need to implement strategies to be able to view as many as possible.

One of those strategies is to not add an polyline if I know it is not going to be visible.

When the camera is close to the surface of the globe, the view rectangle appears to be accurate in reporting the min&max longitude&latitude visible.

However, when the camera is distant from the surface of the globe, this computation fails.

The visible longitudes in this case go from ~ -120 to ~60. Yet, computeViewRectangle is reporting that the entire surface of the globe can be seen at the same time.

Obviously, computeViewRectangle is likely reporting what is contained within the camera view and does not try to determine what is an is not visible.

How can I determine longitudes and latitudes are visible? I realize that with curved surfaces this can get complex. To try to make it simpler, I would only need min & max values.

If you have advice for how to better handle this situation, I am interested.