Move the outer loop to happen after the mesh data has been retrieved. Though this doesn't address the problematic algorithmic complexity of the algorithm, it should at least reduce some overhead, and it removes a few more uses of the `PBVHVertRef` API that we are working to remove.