Generate a shape pattern that follows a given rule.