![]() |
Microscopy Image Browser 2.91
MIB
|
This function PATCHNORMALS calculates the normals of a triangulated mesh. PATCHNORMALS calls the patchnormal_double.c mex function which first calculates the normals of all faces, and after that calculates the vertice normals from the face normals weighted by the angles of the faces. More...
Functions | |
function N = | patchnormals (FV) |
This function PATCHNORMALS calculates the normals of a triangulated mesh. PATCHNORMALS calls the patchnormal_double.c mex function which first calculates the normals of all faces, and after that calculates the vertice normals from the face normals weighted by the angles of the faces. | |
This function PATCHNORMALS calculates the normals of a triangulated mesh. PATCHNORMALS calls the patchnormal_double.c mex function which first calculates the normals of all faces, and after that calculates the vertice normals from the face normals weighted by the angles of the faces.
function N = patchnormals | ( | FV | ) |
This function PATCHNORMALS calculates the normals of a triangulated mesh. PATCHNORMALS calls the patchnormal_double.c mex function which first calculates the normals of all faces, and after that calculates the vertice normals from the face normals weighted by the angles of the faces.
N=patchnormals(FV);
Inputs, FV : A struct containing FV.faces with a facelist Nx3 and FV.vertices with a Nx3 vertices list. Such a structure is created by Matlab Patch function Outputs, N : A Mx3 list with the normals of all vertices
Example, % Compile the c-coded function mex patchnormals_double.c -v
% Load a triangulated mesh of a sphere load sphere;
% Calculate the normals N=patchnormals(FV);
% Show the normals figure, patch(FV,FaceColor
,[1 0 0]); axis square; hold on; for i=1:size(N,1); p1=FV.vertices(i,:); p2=FV.vertices(i,:)+10*N(i,:);
plot3([p1(1) p2(1)],[p1(2) p2(2)],[p1(3) p2(3)],g-
); end
Function is written by D.Kroon University of Twente (June 2009)
References max, min, N, and patchnormals_double().