taichi-dev / taichi_elements

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

Particles are lower than the mesh #44

Closed PavelBlend closed 4 years ago

PavelBlend commented 4 years ago

Here is a screenshot: 01

There is no gravity in this scene.

This error is reproduced in this scene: test_single_voxel.zip

And at this commit: d1848fdecd1318e16e31dcf6ba70921bec1f574f

yuanming-hu commented 4 years ago

This is probably hard to make perfect given the current rasterizer. Since each voxel is either filled or not, there is always some quantization errors. If we use a higher resolution, however, the errors will be much less pronounced.

PavelBlend commented 4 years ago

I had such an assumption:

maybe there is no quantization error? It seems to me that all particles are simply shifted one voxel down. Because if all the particles are raised one voxel up, then everything will be right. I created an emitter exactly along the borders of the voxels and I got this result: 01