guillaumechereau / goxel

Goxel: Free and Open Source 3D Voxel Editor
GNU General Public License v3.0
2.8k stars 223 forks source link

Fix vxl export with height 64 #226

Closed Black-Cat closed 3 years ago

Black-Cat commented 3 years ago

Fix for #52

Bug was in scenes with 64 height voxel columns, where no voxels were touching air.

Function is_surface was not returning 1 while iterating on such column which was causing number of colors to be zero. This commit adds additional check for border voxels, which helps algorithm in such case. Z check prevents corrupted files, X and Y checks prevent not writing color for border voxels.

Can be tested with 512x512x64 filled region or with the project attached to mentioned issue

Also a small typo fix.

guillaumechereau commented 3 years ago

Thanks!