taichi-dev / taichi_elements

High-performance multi-material continuum physics engine in Taichi
MIT License
483 stars 69 forks source link

Wrong seeding particles #26

Closed PavelBlend closed 4 years ago

PavelBlend commented 4 years ago

Particles are created outside the volume of the original mesh. The cube acts as an emitter: front right top

Here is the blend scene: test_seeding.zip

This error is reproduced in Windows 10 at this commit: 47396caaeb0cd4c1bb6bb8d829aee50a1496602a

yuanming-hu commented 4 years ago

Thanks for reporting this.

The vertical bars look like voxelization leakage, which is relatively easy to fix.

The extra padding is due to the fact that, if half of the voxel resides in the mesh and we have no choice but to include the whole voxel. This is hard to fix, unless we use a higher resolution grid to make it less pronounced.

Btw, I'm getting a Suzanne in your blend file - is this the correct file?

PavelBlend commented 4 years ago

This is not a valid file. I messed up the files. And accidentally deleted the file in which the error was reproduced. I will now try to create a new file.

PavelBlend commented 4 years ago

I simulated a voxels_grid object that represents a 32x32x32 voxel grid. Screenshot_1

The emitter does not extend beyond the voxels, but the particles are seeded too much. Maybe there is a rounding error? seeding_bug.zip