Signal boost: Voronoi diagrams with SciPy
I was a bit confused by SciPy's documentation for its Voronoi class and wondering how I could easily draw the "infinite" regions from the output. After getting a somewhat verbose answer from ChatGPT, I decided to Google the question and found Voronoi diagrams with SciPy, by Martin McBride, which solved my problem.
The solution is not different in spirit to ChatGPT's but it's simpler in my mind, so I went with it. The idea is to add the points of a very far off bounding box, then simply ignore regions with -1 vertices.
Comments
Post a Comment