Pattern fitting