纺织学报 ›› 2026, Vol. 47 ›› Issue (1): 186-195.doi: 10.13475/j.fzxb.20250701701

• 服装工程 • 上一篇    下一篇

基于Python的参数化样板自动生成模型构建

孙威斌1,2, 钱娟1,2(), 袁成晓3, 杜劲松1,2   

  1. 1.新疆大学 纺织与服装学院, 新疆 乌鲁木齐 830017
    2.新疆智能与绿色纺织重点实验室, 新疆 乌鲁木齐 830017
    3.新疆易欣服饰有限公司, 新疆 和田 848100
  • 收稿日期:2025-07-07 修回日期:2025-11-11 出版日期:2026-01-15 发布日期:2026-01-15
  • 通讯作者: 钱娟(1988—),女,副教授,博士。主要研究方向为服装数字化技术。E-mail:juanqian@xju.edu.cn
  • 作者简介:孙威斌(1998—),男,硕士生。主要研究方向为服装数字化技术。
  • 基金资助:
    自治区区域协同创新专项—上海合作组织科技伙伴计划及国际科技合作计划项目(2025E01012)

Model construction for parametric pattern automatic generation based on Python

SUN Weibin1,2, QIAN Juan1,2(), YUAN Chengxiao3, DU Jinsong1,2   

  1. 1. College of Textiles and Clothing, Xinjiang University, Urumqi, Xinjiang 830017, China
    2. Xinjiang Key Laboratory of Intelligent and Green Textile, Urumqi, Xinjiang 830017, China
    3. Xinjiang Yixin Garment Co., Ltd., Hotan, Xinjiang 848100, China
  • Received:2025-07-07 Revised:2025-11-11 Published:2026-01-15 Online:2026-01-15

摘要:

针对服装生产过程中繁琐费时的适体纸样制作与调整,提出一种基于Python的参数化样板生成模型,以实现样板的自动生成。通过研究和对比2类双圆弧曲线的拟合原理,利用Python语言设计了可调整的连接点函数来生成衣身曲线,并评估曲线在连接点处的平滑性。根据人体测量实验获取的人体各部位尺寸建立回归模型,用于设置纸样生成的部位参数。以女士衬衫为例,结合参数化设计理念,构建样板的自动生成模型,并在AutoCAD中实现适体纸样的快速生成。利用CLO 3D软件对生成纸样进行压力与合体性的评价,验证了该生成方法的可行性。实验结果表明,由所提算法生成的曲线在拥有平滑性的同时可以进行长度调整,能快速便捷地处理纸样中的复杂曲线,为大规模个性化定制过程中基于体型快速生成适体性纸样提供理论和技术支撑。

关键词: 服装纸样, 女士衬衫, 参数化样板, 适体性纸样, 纸样生成, Python语言

Abstract:

Objective In garment production, pattern-making usually relies on the experience of manual pattern makers, and this process is ofern associated to low efficiency, high cost, and difficulty in meeting large-scale personalized customization demands. Although 3D reverse engineering can generate body-fitting surfaces, it faces challenges in curve deformation and ease allowance control, less conducive to style modifications. Existing parametric methods rely on specialized CAD software, with limited accessibility. In order to address the creation and adjustment of well-fitting patterns, this study proposes a Python-based parametric pattern generation model for automated pattern creation, providing technical support to shorten the production cycle at the pattern-making stage.

Method This study integrates parametric modeling with self-developed biarc curve fitting algorithm to achieve rapid generation and adjustment of well-fitted garment patterns. Taking the generation of a women's shirt pattern in AutoCAD as an example, the research first investigates two types of biarc curves for constructing garment outlines using Python, along with continuity calculations at their connecting points. Next, by combining the prototype method and short-measurement method from garment structural design, body-related parameters are established. The correlations between body dimensions are obtained through anthropometric experiments, and pattern generation/adjustment rules are incorporated to build an automatic pattern generation model. Finally, the automatically generated patterns are evaluated for pressure distribution and fit using CLO 3D software, verifying the feasibility of this generation method.

Results Based on the fitting principles of two types of biarc curves, this study developed a biarc curve algorithm using Python for automatically generating complex curves in garment patterns. The computational results demonstrate that the curves generated by the biarc algorithm possess G0 and G1 continuity, ensuring smooth linearity of the generated curves with high algorithmic accuracy. All connection points exhibit similar G2 deviations while demonstrating variations in curve length. A greater tc value results in a shorter generated curve. Furthermore, when calculating both the deviations at connection points and the curve length of biarc curves constructed using the incenter method, all values were found to be identical to those obtained with tc=0.5. This further confirms that the connection points of curves drawn via the incenter method are encompassed within the connection point function described. While maintaining low G2 values, the algorithm allows for curve length adjustment, enabling convenient processing of complex structural curves in pattern-making. In regional anthropometric experiments, body measurement data were collected from 200 females in Xinjiang, including length dimensions (height, shoulder width, chest width, back width, back length, bust point distance, arm length) and circumference dimens-ions (waist circumference, bust circumference, neck base circumference). Regression analysis was employed to establish the mapping relationships between key body dimensions, which simplified the construction of the automatic pattern generation model. After incorporating adjustment rules, the model was able to carry out rapid modifications of different pattern sections to generate personalized patterns. The automatically generated shirt pattern was imported into virtual software for seam testing. Pressure and fit tests conducted in CLO 3D software reveal reasonable garment pressure distribution and uniform body-garment clearance, validating the feasibility of the proposed parametric pattern generation method.

Conclusion The Python-generated biarc curves demonstrate both superior smoothness and adjustable length properties, enabling efficient handling of complex pattern contours. The proposed method facilitates rapid pattern generation and modification, providing robust technical support for large-scale personalized apparel pattern production. The anthropometric regression model developed for personalized pattern generation was intentionally designed without body type classification constraints. However, subsequent integration of body type classification with the required measurement data could significantly enhance the model's generalization capability and improve pattern accuracy. The proposed method proves universally applicable for automatic generation of diverse garment patterns, with promising potential for implementation in parametric pattern library development.

Key words: garment pattern, women's shirt, parametric pattern, fitted pattern, pattern generation, Python

中图分类号: 

  • TS941.2

图1

纸样自动生成技术路线"

图2

2类双圆弧曲线图"

图3

后领窝弧线"

图4

不同tc取值所对应的双圆弧曲线"

图5

底摆造型线"

表1

双圆弧曲线算法偏差及长度"

连接点位置 G0 偏差/cm G1 偏差/(°) G2 偏差/cm-1 曲线长度/cm
Q1
Q2
0.000 0
0.000 0
0.000 0
0.000 0
0.142 5
0.149 2
10.49
10.29
Q3
ABK内心
0.000 0
0.000 0
0.000 0
0.000 0
0.233 0
0.149 2
10.09
10.29

图6

tc对应生成曲线长度拟合图"

表2

后片部分参数设定"

参数 符号 参数 符号
后衣长 Ba 颈根围 Bg
腰围 Bb 总肩宽 Bh
胸围 Bc 肩斜角 Bi
背宽 Be 后腰省量 B1
背长 Bf 腰部变量 W1

图7

人体部位间尺寸相关系数图"

表3

背宽与胸围尺寸回归模型"

因变量 自变量 非标准化系数 T 显著性
回归系数 标准错误
背宽 常量 18.259 1.910 9.561 0.000
胸围 0.195 0.018 10.555 0.000

表4

人体部位间尺寸回归模型"

自变量 因变量 回归方程
胸围(Bc) 背宽(Be)
乳间距(Fk)
腰围(Bb)
Be=0.195Bc+18.259
Fk=0.052Bc+11.314
Bb=1.029Bc-10.613
总肩宽(Bh) 胸宽(Fd) Fd=0.566Bh+16.543
身高(H) 臂长(Xa) Xa=0.233H+16.477
背长(Bf) Bf=0.224H+4.742

图8

女士衬衫衣身后片结构图"

表5

女士衬衫衣身后片关键结构尺寸关系"

部位 结构线 表达式
后衣长线
背长
袖窿深线
P5P2
P5P3
P4P1
Ba
Bf
Bc/5+5.5
后腰围线 P3P12 Bb/4+B1+W1
后胸围线 P4P9 Bc/4
后领窝宽 P5P6 Bg/5-0.3
后领窝深 P6 P21 (1/3)(Bg/5-0.3)
后领窝直线 P5P7 (1/3)(Bg/5-0.3)
后肩线 P1P8 Bh/2
肩下落线 P8 P22 (tan(arctan(5/15)+0.7(Bi-18)))×
(Bh/2-Bg/5+0.3)
背宽线 P4P10 Be/2
底摆深 P2P24 5
底摆直线长 P2P25 7
底摆延伸量 P23P26 1
后腰省 P19P20 B1
省损量 P17P18 1
腰省胸上量 P14P16 5
腰省下量 P13P15 15

表6

女士衬衫衣身后片控制点"

关键点 x 坐标 y 坐标
P1 0 0
P2 P1.x P1.y-Ba
P3 P1.x P1.y-Bf
P4 P1.x P1.y-(Bc/5+5.5)
P5 P1.x P1.y-(1/3)(Bg/5-0.3)
P6 P5.x+Bg/5-0.3 P5.y
P7 P5.x+(1/3)-(Bg/5-0.3) P6.y
P8 P1.x+Bh/2 P1.y
P9 P4.x+Bc/4 P4.y
P10 P4.x+Be/2 P4.y
P11 P10.x SP.y
P12 P1.x+Bb/4+B1+W1 P1.y-Bf
P13 (P12.x+P3.x)/2 (P12.y+P3.y)/2
P14 P13.x P4.y+5
P15 P13.x P13.y-15
P16 P13.x P4.y
P17 P16.x-0.5 P16.y
P18 P16.x+0.5 P16.y
P19 P13.x-B1/2 P13.y
P20 P13.x+B1/2 P13.y
P21 P6.x P1.y
P22 P8.x -math.tan(math.atan(5/15)+
math.radians(0.7(Bi-18)))×
(P8.x-P21.x)

图9

后片腰部与袖结构调整图"

图10

前片肩角调整图"

图11

女士衬衫纸样图"

图12

虚拟试衣测试图"

[1] 程碧莲, 蒋高明, 李炳贤. 三维服装虚拟展示技术的研究进展[J]. 纺织学报, 2024, 45(5): 248-257.
CHENG Bilian, JIANG Gaoming, LI Bingxian. Research progress in three-dimensional garment virtual display technology[J]. Journal of Textile Research, 2024, 45(5): 248-257.
[2] WU S, ZHONG A H, JIANG X W, et al. Auto-generation of paper patterns for children's jeans[J]. The Journal of the Textile Institute, 2024, 115(9): 1468-1475.
doi: 10.1080/00405000.2023.2233071
[3] LIU K X, ZENG X Y, BRUNIAUX P, et al. Fit evaluation of virtual garment try-on by learning from digital pressure data[J]. Knowledge-Based Systems, 2017, 133: 174-182.
doi: 10.1016/j.knosys.2017.07.007
[4] 凌雅丽, 朱凌轩, 邵晓煊, 等. 亚洲男士西服基本纸样自动生成系统的建立[J]. 纺织学报, 2020, 41(9): 108-113, 118.
LING Yali, ZHU Lingxuan, SHAO Xiaoxuan, et al. Development of automatic pattern generation system for Asian men's suits[J]. Journal of Textile Research, 2020, 41(9): 108-113, 118.
doi: 10.1177/004051757104100204
[5] 张伶俐, 张皋鹏. 应用MatLab的服装纸样参数化平面制版[J]. 纺织学报, 2019, 40(1): 130-135.
ZHANG Lingli, ZHANG Gaopeng. Parametric flat pattern design for clothing based on MatLab[J]. Journal of Textile Research, 2019, 40(1): 130-135.
[6] 娄少红. 基于AutoCAD参数化功能的A型裙样板自动化生成[J]. 纺织学报, 2020, 41(1): 131-138.
LOU Shaohong. Automatic generation of A-type skirt model based on AutoCAD parametric function[J]. Journal of Textile Research, 2020, 41(1): 131-138.
[7] LI K. The influence of Python on logical thinking and analysis of teaching countermeasures[J]. Journal of Physics: Conference Series, 2021, 1744(4): 042164.
doi: 10.1088/1742-6596/1744/4/042164
[8] MACHADO F, MALPICA N, BORROMEO S. Parametric CAD modeling for open source scientific hardware: comparing OpenSCAD and FreeCAD Python scripts[J]. PLoS One, 2019, 14(12): e0225795.
doi: 10.1371/journal.pone.0225795
[9] 赵福英, 倪俊芳. 花型样条曲线加工代码生成算法[J]. 纺织学报, 2018, 39(7): 153-158.
ZHAO Fuying, NI Junfang. Algorithm of processing code generation for pattern spline curves[J]. Journal of Textile Research, 2018, 39(7): 153-158.
[10] 郑永前, 王云鹏, 王科委. 基于粒子群优化算法的自由曲线双圆弧逼近[J]. 中国机械工程, 2011, 22(21): 2530-2535.
ZHENG Yongqian, WANG Yunpeng, WANG Kewei. Biarc approximation of freeform curves based on particle swarm optimization algorithm[J]. China Mechanical Engineering, 2011, 22(21): 2530-2535.
[11] 李重. 双圆弧在服装纸样设计中的应用[J]. 纺织学报, 2005, 26(5): 101-102, 105.
LI Zhong. Biarc application in the garment pattern design[J]. Journal of Textile Research, 2005, 26(5): 101-102, 105.
[12] 娄少红. 双圆弧的图解及其在衣缝轮廓线设计中的应用[J]. 纺织学报, 2019, 40(9): 150-158.
LOU Shaohong. Diagram of biarc and its application in design of garment seam outline[J]. Journal of Textile Research, 2019, 40(9): 150-158.
[13] 叶勤文, 陈咪, 张皋鹏. 双圆弧拟合曲线在参数化服装制版中的应用[J]. 东华大学学报(自然科学版), 2019, 45(6): 851-857.
YE Qinwen, CHEN Mi, ZHANG Gaopeng. Application of double arc fitting curve in parametric garment plate making[J]. Journal of Donghua University (Natural Science), 2019, 45(6): 851-857.
[14] 刘宇, 朱志松, 赵旭, 等. 基于PCHIP与G 1连续的离散点曲线重构方法研究[J]. 机电工程, 2020, 37(11): 1380-1386.
LIU Yu, ZHU Zhisong, ZHAO Xu, et al. Discrete point curve reconstruction methodbased on PCHIP and G1 continuous[J]. Journal of Mechanical & Electrical Engineering, 2020, 37(11): 1380-1386.
[15] 张军雄. 女装结构设计与立体造型[M]. 上海: 东华大学出版社, 2021:107-114.
ZHANG Junxiong. Fashion modelling for women's wear[M]. Shanghai: Donghua University Press, 2021:107-114.
[16] LIU K X, ZHU C, TAO X Y, et al. Parametric design of garment pattern based on body dimensions[J]. International Journal of Industrial Ergonomics, 2019, 72: 212-221.
doi: 10.1016/j.ergon.2019.05.012
[17] 王欢, 吴继辉, 海蓝茜, 等. 基于体型差异的女衬衫定制纸样调整技术[J]. 北京服装学院学报(自然科学版), 2020, 40(3): 36-42.
WANG Huan, WU Jihui, HAI Lanxi, et al. Adjustment technology of customized pattern for blouse based on body size difference[J]. Journal of Beijing Institute of Fashion Technology (Natural Science Edition), 2020, 40(3): 36-42.
[1] 胡安妮, 王婕, 杨五世, 钟跃崎. 面向虚拟展示的三维扫描服装纸样生成[J]. 纺织学报, 2025, 46(08): 209-216.
[2] 陈晓真, 吴莹, 杨叶, 鲁礼豪. 基于三维虚拟模特转换的女士连体长裤参数化纸样生成[J]. 纺织学报, 2025, 46(07): 193-201.
[3] 庹武, 杜聪, 陈谦, 吴超, 魏新桥, 张欣汝, 刘思雨. 基于计算机视觉与Canny算法的服装纸样轮廓提取[J]. 纺织学报, 2024, 45(05): 174-182.
[4] 陈咪, 叶勤文, 张皋鹏. 斜裁裙参数化结构模型的构建[J]. 纺织学报, 2020, 41(07): 135-140.
[5] 叶勤文, 张皋鹏. 基于AutoCAD参数化的个性化服装纸样生成[J]. 纺织学报, 2019, 40(04): 103-110.
[6] 张伶俐, 张皋鹏. 应用MatLab的服装纸样参数化平面制版[J]. 纺织学报, 2019, 40(01): 130-135.
[7] 李重.;马利庄;黄键. 三次Bzier样条曲线在服装纸样设计中的应用[J]. 纺织学报, 2006, 27(5): 53-55.
[8] 吴巧英;袁观洛. 中老年与青年女性上衣纸样比较研究[J]. 纺织学报, 2004, 25(02): 93-94.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!