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: --merge option not merging vertices and displaces object origin #389

Open hkunz opened 4 months ago

hkunz commented 4 months ago

I have a sample vox file here that when converted to .obj using command:

vengi-voxconvert.exe -set metric_flavor json -set voxformat_scale 1.0 -set voxformat_voxelizemode 0 -set voxformat_ambientocclusion 0 --merge --input "C:\Users\harry\OneDrive\Desktop\casa.vox" --output "C:\Users\harry\AppData\Local\Temp\tmpc3wwgpm4\temp.obj" --force

and then resulting .obj imported into 3d application, is not centered. However when you do the convert without the --merge flag then it is centered. Also when using --merge and then importing the resulting .obj file in Blender, there are still overlapping vertices that were not merged. image

image

I have uploaded a simpler version of .vox file here that when converted using --merge to .obj will yield a 63 vertices mesh object. When you import this one into Blender, then when manually merged (Mesh > Merge > By Distance 0.0001m) will yield to 48 vertices. There are 15 pairs of overlapping vertices: index 52 and 56 are overlapping in the final .obj file. 49 & 48 also overlapping. 30 & 20. 55 & 51. 4 & 14. 13 & 2. 10 & 16. 11 & 8. 23 & 9. 39 & 37. 41 & 25. 44 & 33. 36 & 34. 17 & 15. 47 & 46.

mgerhardy commented 4 months ago

casa.zip

attached the file here

mgerhardy commented 1 month ago

it is possible that the now included meshoptimizer supports this.