Kobe, maybe this bounds-computation function I made would be helpful? It’s Typescript, but if you just take out any type annotations it becomes valid JS. What you get is a point or Rectangle that contains the Entity – well, the
position plus all the points that make up position-independent shapes like Polyline, but not the extruded surfaces of positoin-dependent shapes like Ellipse or Cylinder. It’s not perfect, but if the bounding Rectangle doesn’t overlap with the viewport, you know that at least you can’t see the center of any graphic owned by the Entity.
To determine overlap, I had to use separate functions depending on map mode, due to a number of bugs with the functions that go between screenspace coordinates and world coordinates in various modes. This is most of it, though do note my comment at the bottom about how I’m assuming you already figured out how to get a Rectangle representing your viewport.
Hopefully this helps you!