0

I have the problem that I want to generate a Voronoi diagram in Python 3.8 and in a certain area (Orange) I want to know the sizes of the regions. What is the fastest way to do this?

My Voronoi-Diagram with the bounding in orange

For the diagram I used scipy.spatial Voronoi and voronoi_plot_2d

AcK
  • 2,063
  • 2
  • 20
  • 27
Phil
  • 9
  • 1
  • Do you have the coordinates of the points? – francesco foschi Mar 05 '21 at 10:08
  • Of cours! [(0.2, 0.1), (0, 1), (0.9, 1), (1, 0), (0.22, 0.2), (0.4, 0.18), (0.29, 0.22), (0.5, 0.4), (0.2, 0.5), (0.9, 0.1)] But the points are only for illustration. It's about the general way because later I have a random number and position of the points. – Phil Mar 05 '21 at 10:14
  • https://stackoverflow.com/questions/24467972/calculate-area-of-polygon-given-x-y-coordinates – francesco foschi Mar 05 '21 at 10:22
  • Thanks! Now the only question is how I calculate the area within my boundaries. So within the orange area? – Phil Mar 05 '21 at 10:39
  • Please be aware this is not a code-writing or tutoring service. We can help solve specific, technical problems, not open-ended requests for code or advice. Please edit your question to show what you have tried so far, and what specific problem you need help with. See the [How To Ask a Good Question](https://stackoverflow.com/help/how-to-ask "How To Ask a Good Question") page for details on how to best help us help you. – itprorh66 Mar 05 '21 at 18:30
  • If you could use a Java-based solution, there is a class called the BoundedVoronoiDiagram in the open-source Tinfour library that addresses your problem directly.. http://tinfour.org – Gary Lucas Mar 12 '21 at 15:22

0 Answers0