A novel method is proposed to construct relatively rich vector patterns from existing examples to address the problem of excessively simple and coarse details in automatically generated patterns. This method involves several key steps, including the extraction of vectorized primitives, the construction of primitive relationships, and the intelligent generation of patterns through optimization algorithms. Specifically, vectorized primitives are extracted from raster images, and directed graphs are used to establish relationships between primitives, taking into account the geometric relationships of the graph. Primitive relationships are calculated based on the extracted geometric relationships, and relevant constraints are used to transform the original pattern. The transformed pattern is then optimized to produce a more harmonious and aesthetically pleasing pattern variation. Experimental results show that the proposed algorithm can generate a diverse set of novel pattern variants, and the optimized variants demonstrate high levels of harmony and aesthetics. Users have the ability to influence the direction of pattern generation by adjusting the primitives, enabling them to compare and select the generated pattern variants that align with their implicit preferences. The proposed method provides an effective solution for pattern generation, catering to various requirements in practical applications and delivering a range of diverse pattern graphics for products.