How to speed the function H in this code? (Hausdorff Chirality Measurement)

BTW, if you want help to really speed this up, please provide example input data, so that posters can run the code themselves. Right now it’s not easy to guess what sort of input data should be used.