MATLAB Answers

How is vertex normal defined for 3-D surface triangulation?

5 views (last 30 days)
Bruce Elliott
Bruce Elliott on 17 Mar 2020
Commented: Bruce Elliott on 18 Mar 2020
Does the vertexNormal method of a triangulation object return the normalized numerical average of the adjacent face normal vectors? I believe that's a common definition, but I'd like to confirm it.


Bruce Elliott
Bruce Elliott on 18 Mar 2020
Well yes, that's true!
I did it, and found that the differences between the built-in vertexNormal vectors and those I computed by averaging the normal vectors of the adjacent faces were at the level of machine precision. In other words, they were the same, as expected.
For the curious, here is the code I used:
[F,P] = freeBoundary(delaunayTriangulation(rand(50,1),rand(50,1),rand(50,1)));
TR = triangulation(F,P);
normVecsBuiltIn = vertexNormal(TR);
vtxAtt = vertexAttachments(TR);
for vertIdx = 1:size(TR.Points,1)
adjFaces = vtxAtt{vertIdx};
meanNorm = mean(faceNormal(TR,adjFaces'));
meanNorm = meanNorm/norm(meanNorm);
diffVec = normVecsBuiltIn(vertIdx,:)-meanNorm;
fprintf('Vert. ID: %2u - Vect. Diff: %e\n',vertIdx,norm(diffVec));

Sign in to comment.

Answers (0)

Translated by