@jetprint/editor-sdk 1.2.17 → 1.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,9 +27,17 @@ export interface ComposeResult {
27
27
  skipped: string[];
28
28
  }
29
29
  export declare function getSplitChildrenWithBounds(layerList: any[], layerName?: string): SplitChild[];
30
+ /** 异形抱枕缝份描边参数(随设计 JSON 还原,与编辑器预览同源)。 */
31
+ export interface PillowSeamOptions {
32
+ /** 描边颜色(用户在编辑器所选,pillowSeamColor);缺省白色 */
33
+ color?: string;
34
+ /** 描边宽度比例(pillowSeamRatio)= 分片绘制较长边 × 此比例;缺省 0.025 */
35
+ ratio?: number;
36
+ }
30
37
  /**
31
38
  * @param fabricScreenshotList 每分片印刷位图({id,name,blob})
32
39
  * @param productJson 生产图布局:{ canvasWidth, canvasHeight?, layerList(含 split 分组 bounds) }
33
- * @param typeModel 设计模式:'pillow3d' 时每分片沿轮廓描 5px 红边(异形抱枕裁切引导线)
40
+ * @param typeModel 设计模式:'pillow3d' 时每分片沿设计轮廓向外描一圈缝份边(颜色/宽度取 pillowSeam)+ 红色对位定位点
41
+ * @param pillowSeam 异形抱枕缝份描边参数(颜色 + 宽度比例);typeModel==='pillow3d' 时生效
34
42
  */
35
- export declare function composeProductionImage(fabricScreenshotList: FabricScreenshotItem[], productJson: any, format?: 'png' | 'jpeg', typeModel?: string): Promise<ComposeResult>;
43
+ export declare function composeProductionImage(fabricScreenshotList: FabricScreenshotItem[], productJson: any, format?: 'png' | 'jpeg', typeModel?: string, pillowSeam?: PillowSeamOptions): Promise<ComposeResult>;
@@ -31,6 +31,14 @@ export interface Pillow3dOptions {
31
31
  /** 剪影圆角半径(px):把直角等尖角磨圆,更像抱枕。默认按尺寸自适应(≈minSide*0.04);0 = 不圆角 */
32
32
  cornerRound?: number;
33
33
  }
34
+ /**
35
+ * 异形抱枕缝份描边尺寸口径(**唯一真源**,跨预览/效果图/切图还原共用,避免各处魔法数发散)。
36
+ * - PILLOW_SEAM_RATIO:描边宽度 ≈「5cm」近似 = 设计较长边 × 此比例(渲染分辨率无关,各管线按各自绘制尺寸乘同一比例 → 视觉一致)。
37
+ * - PILLOW_SEAM_CORNER_RATIO:描边前把设计尖角磨圆的半径比例(按较长边),使缝份沿圆角轮廓走、不尖锐。
38
+ * 二者会随设计序列化进保存 JSON(pillowSeamRatio / pillowSeamCornerRatio),生产切图(headless)据此还原,预览与生产同源。
39
+ */
40
+ export declare const PILLOW_SEAM_RATIO = 0.025;
41
+ export declare const PILLOW_SEAM_CORNER_RATIO = 0.04;
34
42
  /**
35
43
  * 异形抱枕 5cm 缝份描边:沿设计非透明外轮廓向外膨胀 strokePx 描一圈纯色环,环落在设计【下层】,
36
44
  * 返回四周扩了 strokePx 的新 canvas(设计居中 + 外圈缝份边)。供 buildPillow3dPreview 前置调用,