Minimum distance computation for toroidal patch via topological classification | Synapse