Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug in solid voxelization #64

Open
UGzhang opened this issue Jan 13, 2022 · 15 comments
Open

A bug in solid voxelization #64

UGzhang opened this issue Jan 13, 2022 · 15 comments
Labels
fixed? A bug that is supposedly fixed, but needs further verification input/help wanted

Comments

@UGzhang
Copy link

UGzhang commented Jan 13, 2022

I try to input 32/50/64/100 as voxel grid length in cpu mode.
32/64/100 work very well, but 50 has a bug.
I have uploaded my source obj file and output .obj file (modify .txt to .obj).
1642052035(1)
sphere.txt
sphere.obj_50_voxels.txt

@Forceflow
Copy link
Owner

Forceflow commented Jan 13, 2022

If I read this correctly, you're trying a non-cubical voxel grid? There is still no official support for this - ymmv.

Have you tried with the developer branch?

Thanks for report, though.

@UGzhang
Copy link
Author

UGzhang commented Jan 17, 2022

I will try to developer branch, thx.
And I notice in the paper Fast Parallel Surface and Solid Voxelization on GPU's, they use octree in solid voxelization(like right pic)
Do you have use octree in this project?
458d04fd2cda7a92fd92925f629cecc

@UGzhang
Copy link
Author

UGzhang commented Jan 25, 2022

Another bug happened in solid voxelization.
I use grid size = 8 in cpu mode.
My input is a cube, and output is 8x8x7. I think the correct output is 8x8x8.
Do you have any idea to solve this problem?
1643107787(1)

@xingshh
Copy link

xingshh commented Apr 19, 2022

I find this bug too。 I think the boundary pnt should be reserved., then reset the bounary bit?
when x = xmax;
{
if (morton_order) {
size_t location = mortonEncode_LUT(x, y, z);
setBitXor((voxel_table, location);
boundaryBits.push_back(location);
}else {
size_t location = static_cast<size_t>(x) + (static_cast<size_t>(y) * static_cast<size_t>(info.gridsize.x))+ (static_cast<size_t>(z) * static_cast<size_t>(info.gridsize.x) * static_cast<size_t>(info.gridsize.y);
setBitXor(voxel_table, location);
boundaryBits.push_back(location);
}
}
}

@conceptclear
Copy link
Contributor

conceptclear commented Apr 19, 2022 via email

@Forceflow
Copy link
Owner

Can you try again with the latest release version?

@Forceflow Forceflow added input/help wanted fixed? A bug that is supposedly fixed, but needs further verification labels Jul 19, 2022
@hitrpr
Copy link

hitrpr commented Sep 28, 2022

Tested now .5 release, have the same single-voxel layer.
127 width for main object and 127 grid with 2 layers for additional
изображение
I did -s 128
Magica voxel
So i can suppose, that are voxels 1—128 plus zero voxel.

@Forceflow
Copy link
Owner

And this only happens in solid voxelisation?

@hitrpr
Copy link

hitrpr commented Oct 5, 2022

And this only happens in solid voxelisation?

No, with hull-voxelization too
изображение
73122237
m1.obj_128.zip
command was cuda_voxelizer.exe -f ./proc/m1.obj -s 128 -o vox

@adnan-saood
Copy link

I have somehow similar behavior in my project. I am trying to voxelize a simple 3D blob read as a surface_mesh object in CGAL.

I made the appropriate conversions (so I don't use Trimesh, because I have to use CGAL).

All meshes are read and solid voxelized correctly but this one.

image

I m trying to save it as a pointcloud file (the ultimate goal is for me to check if a point is inside the poly or not)

image

Did anyone face similar behavior anywhere? Me using CGAL is working perfectly as intended for other files (cube, iso-sphere, prism,...)

File:
polyhedral.zip

@conceptclear
Copy link
Contributor

conceptclear commented Mar 23, 2023 via email

@adnan-saood
Copy link

I can do a basic workaround to produce what I want but in a very unintuitive way, If I use an STL input file with mm units (scaled x1000 compared to the zip file I attached earlier), the result is good. I do not know what caused this, maybe some numerical errors.

image

@Forceflow
Copy link
Owner

Forceflow commented Mar 25, 2023

Yeah, I'm writing this down as some numerical errors. I'm currently in the process of rewriting the project to remove the dependency on GLM, maybe this resolves these numerical quirks, since it is not really meant for usage with CUDA.

Thank you all for the detailed reports and test models. As soon as I got the rewrite nailed won, I'll have a new look at this. If you're compiling yourself, maybe disable fastmath?

@adnan-saood
Copy link

@Forceflow I will definitely try that. If this is a collaboration-based library don't hesitate to create the task and maybe we would do the changes in our forks and PR. Thanks again for the clarifications.

@Forceflow
Copy link
Owner

You can test with the dev branch if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed? A bug that is supposedly fixed, but needs further verification input/help wanted
Projects
None yet
Development

No branches or pull requests

6 participants