nmwsharp / polyscope

A C++ & Python viewer for 3D data like meshes and point clouds
https://polyscope.run
MIT License
1.76k stars 190 forks source link

Volume Grid Marching Cube gives a rotated result #253

Closed avaxman closed 5 months ago

avaxman commented 7 months ago
Screenshot 2024-01-30 at 16 08 38 Screenshot 2024-01-30 at 16 05 47

I run the following pretty classic RBF reconstruction in Python. The Volume grid function seems correct, but the result isosurface is correct up to rotation. I tried both explicit grid and callback, and they both give the same rotation. Since the scalar function is fine, I think something is wrong with the marching cubes.

(change the data folder to accommodate where you put the input). RBF.zip

Screenshot 2024-01-30 at 16 08 46
nmwsharp commented 5 months ago

Thank you very much for filing this! You were exactly right, there was a coordinate-ordering bug that I had totally missed.

Fixed in 5d0bb5ea8cdaac07264cf2c3dd17c7b7b7f1cb78. Will push a new version of the python lib to incorprate this and other fixes soon.