Usually a ray casting algorithm is used to determine whether a point is indide or outside a mesh. But this algorithm is slow. Is there any fast algorithm to do this check? My input mesh is a triangular closed mesh. This question has been previously asked here: https://stackoverflow.com/questions/6554313/algorithm-for-determining-whether-a-point-is-inside-a-3d-mesh . The author solved the problem, but I don't understand the solution he/she provided.
Update: there's another method mentioned in https://www.reddit.com/r/Houdini/comments/u2co9i/the_most_efficient_way_to_test_if_a_point_is/. The algorithm is to find a nearest point on mesh, let's call this nearest point B, and the point to test A. The algorithm simply tests the dot product of AB and the normal of B. What's the potential downside ofHowever, this seems to only work with convex mesh. The algorithm? should handle all different kinds of meshes.