sylefeb / VoxSurf

A simple, easily hackable C++ surface voxelizer (STL=>voxels)
MIT License
174 stars 23 forks source link

Artifacts when voxelizing mesh cube #10

Open mhaemmerle opened 3 years ago

mhaemmerle commented 3 years ago

When trying to voxelize a simple cube exported from Blender, this is the result when viewed in Magicavoxel (version 0.99.6.2):

unit_cube_magica

If I e.g. slightly taper the 4 top points of the cube the artifacts will vanish - though leaving me with one or more steps in the voxelized result (where the side faces of the cube have been). Also the artifact in the top is still there:

unit_cube_magica_taper

To reproduce:

I can't attach Stl files here, but this is the same cube exported as text Stl:

solid Exported from Blender-2.80 (sub 75)
facet normal -1.000000 0.000000 0.000000
outer loop
vertex -1.000000 -1.000000 -1.000000
vertex -1.000000 -1.000000 1.000000
vertex -1.000000 1.000000 1.000000
endloop
endfacet
facet normal -1.000000 0.000000 0.000000
outer loop
vertex -1.000000 -1.000000 -1.000000
vertex -1.000000 1.000000 1.000000
vertex -1.000000 1.000000 -1.000000
endloop
endfacet
facet normal 0.000000 1.000000 0.000000
outer loop
vertex -1.000000 1.000000 -1.000000
vertex -1.000000 1.000000 1.000000
vertex 1.000000 1.000000 1.000000
endloop
endfacet
facet normal 0.000000 1.000000 0.000000
outer loop
vertex -1.000000 1.000000 -1.000000
vertex 1.000000 1.000000 1.000000
vertex 1.000000 1.000000 -1.000000
endloop
endfacet
facet normal 1.000000 0.000000 0.000000
outer loop
vertex 1.000000 1.000000 -1.000000
vertex 1.000000 1.000000 1.000000
vertex 1.000000 -1.000000 1.000000
endloop
endfacet
facet normal 1.000000 0.000000 0.000000
outer loop
vertex 1.000000 1.000000 -1.000000
vertex 1.000000 -1.000000 1.000000
vertex 1.000000 -1.000000 -1.000000
endloop
endfacet
facet normal 0.000000 -1.000000 0.000000
outer loop
vertex 1.000000 -1.000000 -1.000000
vertex 1.000000 -1.000000 1.000000
vertex -1.000000 -1.000000 1.000000
endloop
endfacet
facet normal 0.000000 -1.000000 0.000000
outer loop
vertex 1.000000 -1.000000 -1.000000
vertex -1.000000 -1.000000 1.000000
vertex -1.000000 -1.000000 -1.000000
endloop
endfacet
facet normal 0.000000 0.000000 -1.000000
outer loop
vertex -1.000000 1.000000 -1.000000
vertex 1.000000 1.000000 -1.000000
vertex 1.000000 -1.000000 -1.000000
endloop
endfacet
facet normal 0.000000 0.000000 -1.000000
outer loop
vertex -1.000000 1.000000 -1.000000
vertex 1.000000 -1.000000 -1.000000
vertex -1.000000 -1.000000 -1.000000
endloop
endfacet
facet normal 0.000000 0.000000 1.000000
outer loop
vertex 1.000000 1.000000 1.000000
vertex -1.000000 1.000000 1.000000
vertex -1.000000 -1.000000 1.000000
endloop
endfacet
facet normal 0.000000 0.000000 1.000000
outer loop
vertex 1.000000 1.000000 1.000000
vertex -1.000000 -1.000000 1.000000
vertex 1.000000 -1.000000 1.000000
endloop
endfacet
endsolid Exported from Blender-2.80 (sub 75)

Is this a bug in VoxSurf or a limitation in the algorithms used?

mhaemmerle commented 3 years ago

I packaged the blender file and exported Stl in the zip file here: issue_attachment.zip