voxelSurf

Fully vectorized method to plot voxels in an indexed 3d data array
803 Downloads
Updated 15 May 2020

View License

This is a fully vectorized method to display voxels in 3d indexed integer data. The colors are chosen according to the colormap, colormap(lines) is recommended.
This method is much faster than other existing voxel plotters and can handle 3d arrays up to 512x512x512 data points easily on computers with a decent graphics card.
(it just needs a lot of ram for large arrays).
Another neat feature is that it displays both colors at the boundary of 2 regimes by cutting the faces of the voxels at the regime boundaries into 2 triangles.
If you use this for academic purposes, please use appropriate credit.
Feel free to post suggestions on what to improve or add.

Cite As

Johann-Lukas Voigt (2024). voxelSurf (https://www.mathworks.com/matlabcentral/fileexchange/66204-voxelsurf), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
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!
Version Published Release Notes
1.11.0.0

Fixed minor axis bug suggested in comments
removed dependencies on subtightplot and other drawing methods of the demo file.

1.10.0.0

-Added missing methods to run demo script

1.9.0.0

Added second demo file
Added missing methods to run demo script

1.8.0.0

Fixed a small X-Y axis swap bug

1.7.0.0

Now able to handle different transparency layers. Simply use a complex matrix as an input; the real part is interpreted as an index of the colormap while the imaginary part of each voxel corresponds to the index of a given alphamap

1.6.0.0

fixed X/Y swap bug.

1.5.0.0

Updated Example and added more detailed comments.

1.4.0.0

Added transparency option
Added Minecraft Style Example

1.3.0.0

Made description more clear

1.2.0.0

edited title

1.1.0.0

Fixed some typos.

1.0.0.0