|
|
| File Information |
| Description |
This function polygon2function will convert a Triangulated Mesh into a Voxel Volume which will contain the discretized mesh.
Discretization of a polygon is done by splitting the polygon in smaller polygons, until the longest edge is smaller than 0.5 voxel, then the voxel beneath the vertice coordinates is set to one.
The function is fast because the main function is implemented in c-code /mex file (takes seconds on a core 2 duo with function compiled by Microsoft Visual Studio 2008.).
Try the example.
Bugs, successes and other comments are welcome!
|
| 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.
|
| Updates |
| 25 May 2009 |
Added center and resize options |
| 01 Oct 2009 |
Linux Ubuntu Tested |
| 12 Feb 2010 |
Small Bug fixed, for the case if all vertices are outside the volume. Only not draw the face if they are outside at the same side of the volume. |
| 27 May 2010 |
Changed output to Logicals instead of Double datatype |
| 12 Nov 2010 |
Now first index volume is 1,1,1 instead of 0,0,0, and YXZ dimensions as in Matlab convention (Thanks Yuanming SUO). |
| 19 Dec 2011 |
Added boundary options |
|
Contact us at files@mathworks.com