General magnetostatic shape–shape interactions