Change point properties of a Triangulation? Problem with triangulation()

8 次查看(过去 30 天)
Hello, I'm working on a nano-research project for which I'm currently building a MATLAB model. I've tried to create a delaunay triangulation of a set of coplanar 3D data (equally space x & y with all zs = 1) but the delaunayTriangulation() function cannot handle coplanar data. For this reason, I've resorted to creating the triangulation using a combination of delaunay() and triangulation() as follows:
if true
[x,y] = meshgrid(0:1:10,0:1:10);
tri = delaunay(x,y);
nx = length(x);
ny = length(y);
z = ones(size(x));
X = reshape(x,[nx^2 1]);
Y = reshape(y,[ny^2 1]);
Z = ones([nx*ny 1]);
tr = triangulation(tri,X,Y,Z);
end
And this seems to be working for the purpose of creating a 3D surface that contains coplanar points. I'm even able to pass the incenter() and faceNormal() commands that I need to perform calculations down the line. However, the problem is that I need to be able to manipulate points in the triangulation (due to chemical etching). When I try to manipulate a vertex of one of the triangles using tr.Points(ID,:) = [x y z] I get the error:
if true
You cannot set the read-only property 'Points' of triangulation.
end
I understand (from documentation) that I'll be able to accomplish this using delaunayTriangulation(), however, there is a possibility of coplanar data that I cannot pass through that particular function. Additionally, I understand that faceNormal() can only handle 2D data, so if I change some Z values to give an uneven surface, I'm not sure if faceNormal() will be able to handle it! Can anybody help me out with this dilemma? I've thought about converting the triangulation back into a set of coordinate points, and then manipulating them before changing them back into a triangulation, but I'm not sure how to accomplish this.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Delaunay Triangulation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by