5.0

5.0 | 2 ratings Rate this file 144 downloads (last 30 days) File Size: 14.19 KB File ID: #24086

Polygon2Voxel

by Dirk-Jan Kroon

 

12 May 2009 (Updated 01 Oct 2009)

Code covered by BSD License  

Convert a triangulated mesh into a voxel volume

Download Now | Watch this File

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 small 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)
Zip File Content  
Other Files license.txt,
polygon2voxel.m,
polygon2voxel_double.c,
sphere.mat
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
13 Aug 2009 Siyi Deng

very helpful. Good job.

18 Aug 2009 Óscar J. Rubio Martín

Incredible performance! Very good

Please login to add a comment or rating.
Updates
25 May 2009

Added center and resize options

01 Oct 2009

Linux Ubuntu Tested

Tag Activity for this File
Tag Applied By Date/Time
discretization Dirk-Jan Kroon 12 May 2009 09:47:31
mesh Dirk-Jan Kroon 12 May 2009 09:47:31
polygons Dirk-Jan Kroon 12 May 2009 09:47:31
triangulated Dirk-Jan Kroon 12 May 2009 09:47:31
triangles Dirk-Jan Kroon 12 May 2009 09:47:31
voxels Dirk-Jan Kroon 12 May 2009 09:47:31
voxel Dirk-Jan Kroon 12 May 2009 09:47:31
voxel volume Dirk-Jan Kroon 12 May 2009 09:47:31
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com