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

조회 수: 8 (최근 30일)
Bruce Elliott
Bruce Elliott 2020년 3월 17일
댓글: Bruce Elliott 2020년 3월 18일
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.
Thanks.
  댓글 수: 2
darova
darova 2020년 3월 18일
You can check this with norm()
Bruce Elliott
Bruce Elliott 2020년 3월 18일
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);
fprintf('\n');
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));
end

댓글을 달려면 로그인하십시오.

답변 (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