Compute normal vectors of 2.5D triangulation

버전 1.1.0.0 (2.25 KB) 작성자: David Gingras
That function compute the normal vectors of a 2.5D triangulation.
다운로드 수: 2.3K
업데이트 날짜: 2009/5/5

라이선스 보기

It could be useful to know the normal vectors of a surface. The function provided is able to take a 2.5D unrestricted triangulation (Delaunay or not) which define a 3D surface and computes the normal vectors of each cell. It is possible to compute vectors at the center cells or at vertices.

Inputs :
"XYZ" is the coordinate of the vertex of the triangulation (nx3 matrix).
"TRI" is the list of triangles which contain indexes of XYZ (mx3 matrix).
"strPosition" is the position where the normal is computed. It
could be 'center-cells' for a computation on the center of each
triangle or could be 'vertices' and the vectors are computed at
vertices with respect to the neighbor cells (string).

Outputs :
"NormalVx", "NormalVy" and "NormalVz" are the component of
normal vectors (normalized to 1).
"PosVx", "PosVy" and "PosVz" is the positions of each vector.

Note :
if strPosition == 'center-cells', then the dimension of each
output are mx1.
if strPosition == 'vertices', then the dimension of each
output are nx1.

All cells have to be enumerated clockwise or counter-clock.

Example :

[X,Y,Z]=peaks(25);
X=reshape(X,[],1);
Y=reshape(Y,[],1);
Z=0.4*reshape(Z,[],1);
TRI = delaunay(X,Y);
[NormalVx NormalVy NormalVz PosVx PosVy PosVz]=computeNormalVectorTriangulation([X Y Z],TRI,'vertices');

quiver3(PosVx,PosVy, PosVz, NormalVx, NormalVy, NormalVz), axis equal
hold on
trimesh(TRI,X,Y,Z)

David Gingras, February 2009

인용 양식

David Gingras (2024). Compute normal vectors of 2.5D triangulation (https://www.mathworks.com/matlabcentral/fileexchange/23063-compute-normal-vectors-of-2-5d-triangulation), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Delaunay Triangulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

updated description

1.0.0.0