The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Problem with triangulation using DelaunayTri Class
Replies: 1   Last Post: Dec 15, 2009 11:37 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jacek W

Posts: 2
Registered: 12/4/09
Problem with triangulation using DelaunayTri Class
Posted: Dec 9, 2009 8:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have to triangulate a simple unit triangle (a half of the unit square) with uniform grid. Using DelaunayTri class the triangulation makes a few more triangles on the hypotenuse. This is a straight line the triangle is not supposed to be there. I was able to avoid the problem just for a few specific numbers but not in general.
How I can fix it ??
See example:
function bary(n)
% works nice for n=3,5,9,17; not for any
for j=1:n
for i=1:n-j+1
x=[u(i) v(j)];
uv=[uv; x];
% Triangulation of the barycentric coordinates
hold on
% Labels
hold on
vxlabels = arrayfun(@(n) {sprintf('P%d', n)}, (1:length(x))');
Hpl = text(x, y+0.03, vxlabels, 'FontWeight', 'bold', 'HorizontalAlignment',...
'center', 'BackgroundColor', 'none');
ic = incenters(dt);
numtri = size(dt,1);
trilabels = arrayfun(@(x) {sprintf('T%d', x)}, (1:numtri)');
Htl = text(ic(:,1), ic(:,2), trilabels, 'FontWeight', 'bold', ...
'HorizontalAlignment', 'center', 'Color', 'red');
hold off

The delaunay command works fine but I want to use the DlelaunayTri object commands. Should I use delaunay + TriRep to create one ??

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.