Voronoi boundaries

53 Views Asked by At

When drawing voronoi using numpy, some edges go to infinity of course. I would like to confine the voronoi polygons to the rectangle I use to set the random seeds. When an edge goes to infinity, it is necessary to calculate where is crosses the rectangle edge and to incorporate a segment of that edge in the polygon. Can anyone send me a python code to do that. I asked ChatGPT, but no way, so I guess it is not as easy as it seems. Thanks in advance.

I tried several suggestions from chatGPT.

0

There are 0 best solutions below