Results 1 to 1 of 1

Thread: [MATLAB] Delaunay/Veronoi Diagram - Get polygons

  1. #1
    Mar 2007

    [MATLAB] Delaunay/Veronoi Diagram - Get polygons

    I am trying to calculate polygons around nodes to provide criteria for where the nodes can move during an optimization routine I am working on. Nodes are restricted to the square region u={0,1} and v = {0,1}.

    Here is the code for the attached image. It is simply a delaunay triangulation and veronoi diagram of 10 random node positions.

    x = [0.196 0.992 0.802 0.424 0.729 0.498 0.809 0.357 0.073 0.591];
    y = [0.910 0.194 0.432 0.749 0.039 0.946 0.764 0.559 0.184 0.498];
    TRI = delaunay(x,y);
    [vx, vy] = voronoi(x,y,TRI);
    axis([0 1 0 1]);
    hold on;
    hold off
    txt = cell(1,length(x));
    for j=1:length(x);txt{j}=sprintf('  %i',j);end
    axis square
    title('Optimizing Nodes in u-v Domain')
    Idealy what I would like to achieve is an array for the position of each voronoi point and a cell array containing the indexes of each point corresponding to each nodes polygon or voronoi cell depending on what you want to call it. All veronoi points must be within / lie on the square region and each node must be completely bound.

    I can do something like this which will return something close to what I want for the bound cells ONLY (it also return points outside the bounds I am interested in):

    [V,C] = voronoin(unique([vx(:) vy(:)],'rows'));
    hold on
    for j = 1:length(C)
    hold off
    Is there an efficient way to find out the bound regions of each node by also considering the boundaries u={0,1} and v = {0,1}. I am considering using this for an optimization routine I am working on where no node can be moved outside its veronoi cell within 1 iteration to prevent 2 nodes occupying the same possition so it is important that I can find a way to make sure each node has a corresponding "bound" cell consisting of points in the range u={0,1} and v = {0,1}.

    I hope I have been clear enough, Please let me know if I need to post up more information.

    Regards Elbarto
    Attached Thumbnails Attached Thumbnails [MATLAB] Delaunay/Veronoi Diagram - Get polygons-voronoi.jpg  
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab - Add/Remove edges in delaunay triangulation
    Posted in the Math Software Forum
    Replies: 1
    Last Post: Jul 16th 2010, 11:09 PM
  2. Geometry with Polygons..
    Posted in the Geometry Forum
    Replies: 1
    Last Post: Aug 15th 2009, 11:58 AM
  3. Polygons
    Posted in the Geometry Forum
    Replies: 2
    Last Post: Sep 26th 2007, 09:27 AM
  4. Polygons
    Posted in the Statistics Forum
    Replies: 3
    Last Post: Jan 25th 2007, 03:25 PM
  5. Polygons Help!
    Posted in the Geometry Forum
    Replies: 4
    Last Post: Jan 6th 2007, 06:06 AM

Search Tags

/mathhelpforum @mathhelpforum