4.3 | 3 ratings Rate this file 29 Downloads (last 30 days) File Size: 3.17 KB File ID: #34428
image thumbnail



Jakob Sievers (view profile)


Constrain the vertices of a Voronoi decomposition to the domain of the input data.

| Watch this File

File Information

The routine performs a Voronoi decomposition of an input dataset and constrains the vertices to the domain of the data themselves, such that even unbounded Voronoi cells become useful polygons (See attached figure).

I asked some time ago on the Matlab Central regarding the existence of such a routine but received no answer so this is my attempt to fix it the hard way.

This is my first upload. Feel free to comment.


This file inspired Lloyds Algorithm(Px,Py, Crs, Num Iterations, Show Plot).

Required Products Mapping Toolbox
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
01 Jul 2014 UIC

UIC (view profile)

Dear Jakob,
There is only a small bug in the code you may resolve that. for some Voronoi cells (specially those near edges) vertices are not correct. Would you mind to check that.

Good luck,


22 Sep 2013 Jakob Sievers

Jakob Sievers (view profile)

Hi Michele
That is an interesting case. I am very limited timewise at the moment but when I do return to this function I will definitely take it into consideration. Could be interesting to add options for empty spaces of arbitrary polygon shapes within the bounding box.

Comment only
06 Sep 2013 Michele

Great function!
I have a question though. Is it possible to add new internal bounds, for example a "hole" inside a square region?

Comment only
02 Jul 2012 maxime

maxime (view profile)

Great function !
I upgraded it for using it with any bounding shape. Just replacing "crs" variable by any polygon.
Works fine !

20 Jun 2012 S

S (view profile)

11 Mar 2012 Pearl

Pearl (view profile)

I 2nd Richard. I'm trying to get extended boundary, but still have no luck. Let me know if you have chance to upgrade the code. However, I don't have the mapping toolbox either :"(

Comment only
03 Feb 2012 Jakob Sievers

Jakob Sievers (view profile)

I have indeed considered adding an option to describe extended boundaries yourself. I will see if I get the time to make those changes.
I am not aware of any file-exchange alternatives to what polybool does, so I'm afraid the mapping toolbox remains a requirement.

Comment only
24 Jan 2012 Richard Garner

Thanks for this, as I have run into the same problem, with a slight variation. I want the Voronoi diagram limited by a larger boundary outside of the original set of vertices from which the Voronoi diagram is calculated. HOWEVER, unfortunatey I cannot use your function because I do not have the mapping toolbox.

Comment only

Contact us