this code scan polylines's vertices and find their square pairs (please see the attached image to get what i mean)

this function get a vertex, a list of candidates, and the upper threshold of the condition. it ask the user to selects all polylines, than it extract their vertices and append them to one long list. than the vertex compared with the element # of the list for not being the same, and for the distance between them not more than d. only one can be pair of the vertex.

than a new list is contracted with a single pair and returned to the caller