Generate 3d point cloud map from world with Harmonic or later

I found a solution for gazebo classic here:

For gz Harmonic, how to get the same function since there is no RayShape anymore.

I found the GetRayIntersection in gz::physics but had no idea how to use it in upper program