NVIDIAGameWorks / FleX

Other
650 stars 100 forks source link

NvFlexExtCreateSoftFromMesh particlizing creates strange runs of particles #76

Closed henryclever closed 5 years ago

henryclever commented 5 years ago

Upon using this function to mesh various objects, I've run into this strange issue where it sometimes creates random strings of particles like the ones shown below. I've tried to convert the obj file to a ply but in that case it won't even import it. I also examined the individual particles in this weird line string but they do not appear to be in consecutive order, so it seems I have to do a more computationally intensive searching to find them and either delete them or set the inverse mass very high. Often the particles are not exactly in a 'line' per se so just searching to see if some x,y,z particle positions match does not guarantee a solution.

Any idea what the problem is or how to solve it?

screenshot from 2019-02-19 17-58-33 screenshot from 2019-02-19 17-58-03

Thanks, Henry C.

e3dos commented 5 years ago

Never had that issue, could you send the obj file that has this problem?

henryclever commented 5 years ago

Hi, thanks for looking into this. For some reason I can't attach .obj files here. Can you send me an email to henryclever@gatech.edu? Then I will respond with the file.

-Henry

mmacklin commented 5 years ago

Hi Henry,

I think this is a failure of the voxelization algorithm which relies on a parity checking to determine inside outside. Basically it counts the number of surfaces a ray goes through to determine if a voxel is inside.

It could be that there is a numerical precision issue, or that there is a small hole in the mesh around that point that the ray is slipping through.

I would inspect the mesh - but the code that performs the voxelization is in core/voxelize.cpp, you may be able to avoid the problem by changing the eps tolerances.

Hope that helps.

Cheers, Miles

henryclever commented 5 years ago

Hi Miles,

I cut the eps by a factor of 10 and the problem went away - Yay!

Thank you! Henry C.