This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Class: triangulation

Triangulation vertex normal


VN = vertexNormal(TR,vi)
VN = vertexNormal(TR)


VN = vertexNormal(TR,vi) returns the unit normal vector to each of the specified vertices in vi.

VN = vertexNormal(TR) returns the normal information for all vertices in the triangulation.

Input Arguments


Triangulation representation, see triangulation or delaunayTriangulation.


IDs of vertices to query, specified as a column vector. Each element in vi is a Vertex ID.

Output Arguments


Vertex normals, returned a matrix. Each row, VN(j,:), is the unit normal vector at the vertex vi(j). The vector at VN(j,:) is the average unit normal of the faces attached to vertex vi(j).

If you do not specify vi, then vertexNormal returns the unit normal information for all vertices in the triangulation. In this case, the normal associated with TR.Points(j,:) is VN(j,:).


Vertex ID

A row number of the matrix, TR.Points. Use this ID to refer a specific vertex in the triangulation.


expand all

Create a 3-D triangulation representing the volume of a cube.

[X,Y,Z] = meshgrid(1:4);
X = X(:);
Y = Y(:);
Z = Z(:);
dt = delaunayTriangulation(X,Y,Z);

Find the surfaces of the cube and isolate them in a 2-D triangulation.

[Tfb,Xfb] = freeBoundary(dt);
TR = triangulation(Tfb,Xfb);

Find the unit normal vectors to the triangles on the surface of the cube.

vn = vertexNormal(TR);

Plot the results.

trisurf(TR,'FaceColor', [0.8 0.8 1.0]);
axis equal
hold on
hold off

Was this topic helpful?