version (3.54 KB) by Dirk-Jan Kroon
Convert a triangulated mesh into a voxel volume


Updated 20 May 2019

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

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.

Note, this new version is pure Matlab (previous version required c++ compiler)

Try the example.

Bugs, successes and other comments are welcome!

Cite As

Dirk-Jan Kroon (2022). Polygon2Voxel (https://www.mathworks.com/matlabcentral/fileexchange/24086-polygon2voxel), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!