Throw randomly. Keep what fits. Toss what doesn't.
That's the whole trick โ no formula required. The keepers alone draw the shape. Swap the shape above: same three steps, any pattern.