If simplifying the polygon isn't enough, or if the polygon generation itself is a heavy operation, you can move the polygon calculation to a separate thread. This prevents the main thread (which handles UI, input, and rendering) from freezing while the calculation is in progress.