Navmesh generation with weights

Would you help me with this?
I need to pass a vector3f point and if it is not traversable then returns the nearest position to that point…