Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Delaunay Trianggle selection

Subject: Delaunay Trianggle selection

From: sivabalan N

Date: 6 Apr, 2010 09:40:06

Message: 1 of 3

Hai Friends!!
i have created triangles using delaunay triangle command from X, Y points..
MY COMMANDS ARE:
>> x = randn(1,12); % generates 12 normally distributed numbers
>> y = randn(1,12);
>> z = zeros(1,12); % trimesh (used below) needs three arguments
>> plot(x,y,'o');
>> tri = delaunay(x,y);
>> hold on, trimesh(tri,x,y,z), hold off; % plot triangles
>> hidden off %reveal all hidden points
>> title(‘deLaunay Triangulation')
now my quesation: how can i get the X Y Z cordinates (vertex)of each of the out triangle alone?
is there any commands available means please guide me friends.....

Subject: Delaunay Trianggle selection

From: Steven Lord

Date: 6 Apr, 2010 13:51:25

Message: 2 of 3


"sivabalan N" <nshivabalan@gmail.com> wrote in message
news:hpevhm$kji$1@fred.mathworks.com...
> Hai Friends!!
> i have created triangles using delaunay triangle command from X, Y
> points..
> MY COMMANDS ARE:
>>> x = randn(1,12); % generates 12 normally distributed numbers
>>> y = randn(1,12);
>>> z = zeros(1,12); % trimesh (used below) needs three arguments
>>> plot(x,y,'o');
>>> tri = delaunay(x,y);
>>> hold on, trimesh(tri,x,y,z), hold off; % plot triangles
>>> hidden off %reveal all hidden points
>>> title(‘deLaunay Triangulation')
> now my quesation: how can i get the X Y Z cordinates (vertex)of each of
> the out triangle alone?
> is there any commands available means please guide me friends.....

You have the coordinates of the points in the variables x, y, and z. You
have the indices of the points that make up each triangle in tri. Combine
them.

x(tri(1, :))
y(tri(1, :))
z(tri(1, :))

If you no longer have x, y, z, and/or tri then you can extract the data from
the various *Data properties and the Faces property of the graphics object
assuming you can get a handle to it using FINDOBJ or the like.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: Delaunay Trianggle selection

From: sivabalan N

Date: 20 Apr, 2010 12:23:04

Message: 3 of 3

Thank you very much steven..
let me try ur idea and i will reply u soon..

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us