Problem with fan-cylinder's intersect detection

Problem with fan-cylinder intersect detection | Babylon.js Playground (

In this example, I created a fan-cylinder, and then check whether some points are intersected with it. If it’s intersected, create a box there, otherwise there will be a ball instead.

Obviously some points are not intersected with the fan-cylinder we can see but the engine thinks so. I just wanna use it for detection, how to make the result accurate?

intersectsPoint will check if the point is inside the bounding box of the mesh, not inside the mesh itself.

This links may help you:

1 Like

Thanks for answering, but I still don’t know how to solve my problem by reading documents and discussion, examples in that post.

How to make it check with the mesh itself instead of the bounding box? intersectsPoint doesn’t have the second parameter for precise. And one more thing, if I detect with meshes instead of points, the result seems more weird:

Welp, eventually I figured out another way although seems ugly. Not totally solved the problem but at least solved my work…

The second link (Point is inside a mesh functionality) has code to do exactly what you want (check if point is inside mesh).