Obi Official Forum
Help hole in collider - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Help hole in collider (/thread-2151.html)



hole in collider - julienrobert - 08-04-2020

[Image: hole.png]I would like the fluid to go through a hole in a container. I modified the 3D object Environnement from the sample ressources to cut a hole in it (see image hole). But it's not working (see example.mov), what am I doing wrong?

http://julienrobert.net/partage/example.mov

thanks


RE: hole in collider - josemendez - 08-04-2020

Maybe you haven't updated the mesh distance field.
See:
http://obi.virtualmethodstudio.com/tutorials/distancefields.html

Keep in mind that distance fields for one-sided objects with holes in them are not well defined. You might want to deactivate distance fields entirely (the "use distance fields" checkbox in the ObiCollider component), or use a two-sided mesh instead.


RE: hole in collider - julienrobert - 08-04-2020

(08-04-2020, 05:09 PM)josemendez Wrote: Maybe you haven't updated the mesh distance field.
See:
http://obi.virtualmethodstudio.com/tutorials/distancefields.html

Keep in mind that distance fields for one-sided objects with holes in them are not well defined. You might want to deactivate distance fields entirely (the "use distance fields" checkbox in the ObiCollider component), or use a two-sided mesh instead.

Thanks Jose.
Generating a new distance field didn't solve the problem, it's doing the same. Maybe it's one-sided mesh the problem.
When I uncheck Use Distance Field, the fluid goes through the mesh completely.


RE: hole in collider - josemendez - 08-04-2020

(08-04-2020, 05:51 PM)julienrobert Wrote: When I uncheck Use Distance Field, the fluid goes through the mesh completely.

This is called tunneling and is common in all physics engines. It is exacerbated when using small objects and/or moving things around. See:
https://www.youtube.com/watch?v=ms0Z35GY6pk

MeshColliders are "paper-thin", meaning that they do not have a volume: only the mesh triangles collide with particles. But once a particle has passed trough a triangle in a single timestep, it cannot be projected back.

That's precisely why distance fields are useful: they are solid, even if they are concave. This allows particles to be projected to the surface of the field if they ever get inside.

However, for a one-sided mesh with holes...how can you define what's "inside" and "outside" the mesh, if it has no volume, and it does not divide space into two clear, distinct regions?  You need a closed mesh for this, and that's why distance fields are ill-defined for one sided, holed shapes.


RE: hole in collider - julienrobert - 08-04-2020

[quote pid='6330' dateline='1586365172']
However, for a one-sided mesh with holes...how can you define what's "inside" and "outside" the mesh, if it has no volume, and it does not divide space into two clear, distinct regions?  You need a closed mesh for this, and that's why distance fields are ill-defined for one sided, holed shapes.
[/quote]

I will consider building a two-sided mesh.


RE: hole in collider - julienrobert - 13-04-2020

I did a 2-sided mesh. I'm used to modeling so I might have done something wrong because now the distance field looks inversed.[Image: inversed.png]


RE: hole in collider - josemendez - 13-04-2020

(13-04-2020, 03:02 PM)julienrobert Wrote: I did a 2-sided mesh. I'm used to modeling so I might have done something wrong because now the distance field looks inversed.[Image: inversed.png]

Normal direction is very important. Make sure the "outside" of the mesh has normals pointing outside, not the other way around.