Vertices of polygons in bounded voronoi diagram

29 views (last 30 days)
I am new to matlab and I am facing a problem as follows.
I want to find out the vertices of polygons that make up the voronoi diagram limited by a rectangular boundary. I was trying to use 'Voronoin' function but I am not able to think of a way to extract out the vertices of the bounded polygons. Voronoin gives us vertices of unbounded polygons and not that of bounded version. Besides it also treats both posotive and negative infinities as Inf only. So, please help me.
  2 Comments
KalMandy
KalMandy on 27 Oct 2016
Hi, have you found the solution for the above question? Please be kind enough to mention the solution here. Thanks

Sign in to comment.

Accepted Answer

Matt J
Matt J on 30 Oct 2016
Edited: Matt J on 8 Feb 2022
I have created a function (attached) which will obtain the Voronoi polygons in inequality form, and also optionally in vertex form if bounds are specified. It relies on files available in this FEX submission, which must be downloaded. It is probably not an optimally fast algorithm and I don't know how it compares to VoronoiLimit, but it is a simple and flexible tool. On my machine, I am able to process an input data set of 2000 seed points in 2D in about 2 sec.(R2021b);
  20 Comments

Sign in to comment.

More Answers (1)

Preetham Manjunatha
Preetham Manjunatha on 8 Feb 2022
Edited: Preetham Manjunatha on 8 Feb 2022
Here is the link function to clip the extending edges of the Voronoi Diagram for rectangular or square region. Rigorously tested on the random points, this function can process an input data set of 2000 seed points in 2D in about 0.015 seconds on average.

Categories

Find more on Voronoi Diagram in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!