vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.05k stars 87 forks source link

VOXCONVERT: --surface-only produces internal faces #432

Closed mgerhardy closed 3 months ago

mgerhardy commented 3 months ago

When I voxconvert a .vox file with only surface voxels to .obj using --surface-only it produces internal faces. I am sure it's a closed object (no holes)

untitled.vox.zip

This is most likely a problem with the cubic mesh extractor code - as it should only ever generate external visible faces.

--surface-only just calls voxelutil::visitUndergroundVolume to erase all non-visible voxels - should not have any impact on the result

FYI @hkunz

hkunz commented 3 months ago

Yes all non visible voxels did not impact the result. Well actually the vox file only consists of surface voxels. It's hollow. The internal faces result in the .obj are actually remnants of those visible surface-only voxels. It's like the visible surface voxels were just converted to mesh boxes so the back/invisible faces of those mesh boxes were not removed.

mgerhardy commented 3 months ago

See the attached commit and the clarification of the docs - this is intended behavior. You should fill the hollows before. There are examples in the docs on how to do that.