What is the best way to find the pad pitch when the design has 27000+ pads? Using the (combine relation1 relation2) operator crashes my session as Ravel attempts to store 729 million+ combinations. Even if I break the design into quadrants to reduce the number of pads being looked at, Ravel still has to deal with 48 million+ combinations. Also, looking only at the pads nearest the design edge doesn't give me the result I'm looking for. I need to find the minimum pad pitch in the design.
Do you have any suggestions?
After some more investigation, I have found a more reliable method of finding a good cutoff value as per above:
;; Form pairs of x-y coordinates corresponding to each bump.(define x_y (transform (bump) bumppad ((xcoordinate (center bump)) (ycoordinate (center bump)))))
;; Group y coordinates corresponding to the same x coordinate into;; collections. They correspond to y coordinates of bumps on the same;; "row", where each row has the same x coordinate.(define ys (PAIR_2 (contract y (x y) x_y)))
;; Pick the "row" of y coordinates with the largest size. (Because the;; probability is high that there is a pair with small pitch, giving a;; small cutoff value.) Expand the collection to form a relation of;; the y coordinates on this "row" (for a given x coordinate).(define yrow (expand ys (ys) (PAIR_1 (CHOOSE_MAX_VALUE (transform (ys) ys (ys (count ys)))))))
;; Find the cutoff value by finding the smallest different between y;; coordinates in the "row" we are working with.(define cutoff (CHOOSE_MIN (transform (y1 y2) (select (y1 y2) (combine yrow yrow) (ordered? y1 y2)) ((abs (difference y1 y2)))) IDENTITY))
It assumes that pads for the most part are placed in a grid-like pattern, and is fast and efficient even for a large number of pads.