Code covered by the BSD License  

Highlights from
Patch Normals

5.0

5.0 | 2 ratings Rate this file 25 Downloads (last 30 days) File Size: 14.52 KB File ID: #24330
image thumbnail

Patch Normals

by Dirk-Jan Kroon

 

02 Jun 2009

Calculates the normal vectors of a triangulated mesh (patch)

| Watch this File

File Information
Description

This function calculates the normal vectors of a triangulated mesh such as used by the Matlab function patch.

It first calculates the normal vectors of all faces, and after that calculates the vertex normals from the face normals weighted by the angles of the faces.

The function is both implemented as a normal Matlab function and as a mex file in c-code (much faster)

Try the example ...

Acknowledgements
This submission has inspired the following:
Compute STL Vertex Normals
MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
23 Apr 2010 Thomas Clark

I was halfway through writing this very function, when I thought... 'I wonder whether this has been done'...

Glad I checked!

This is flawless, as far as I can tell (so far I've compiled and run the example).

Cheers Dirk-Jan :)

09 Nov 2010 Michael Fink

works like a charm, thank you!

25 Nov 2010 fraisa1985 Youssef

Thank you for your source code. But, i dont succeed to patch the different normal in some 3D mesh image. In fact, i was succeed to use you source code to have the normal vector of any facet but i don't succeed to patch him like the figure presented.
Can someone help me please how i can patch the differents normal in my 3D mesh image.
 

25 Nov 2010 fraisa1985 Youssef

Thank you for your source code. But, i dont succeed to patch the different normal in some 3D mesh image. In fact, i was succeed to use you source code to have the normal vector of any facet but i don't succeed to patch him like the figure presented.
Can someone help me please how i can patch the differents normal in my 3D mesh image.
 

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
patch Dirk-Jan Kroon 02 Jun 2009 11:43:23
isosurface Dirk-Jan Kroon 02 Jun 2009 11:43:23
normals Dirk-Jan Kroon 02 Jun 2009 11:43:23
normal vector Dirk-Jan Kroon 02 Jun 2009 11:43:23
vertex Dirk-Jan Kroon 02 Jun 2009 11:43:23
vertices Dirk-Jan Kroon 02 Jun 2009 11:43:23
faces Dirk-Jan Kroon 02 Jun 2009 11:43:23
vertexnormals Thomas Clark 23 Apr 2010 12:48:54
vertnorms Thomas Clark 23 Apr 2010 12:48:54

Contact us at files@mathworks.com