@lucablockltd/ultimate-packaging 1.4.0 → 1.5.0

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.
package/dist/index.mjs CHANGED
@@ -3,6 +3,45 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
 
4
4
  // src/components/model/tuck-end-boxes/becf-1010a/index.tsx
5
5
 
6
+ // src/utils/debugDieline.ts
7
+ var DEBUG_PALETTE = [
8
+ "#e74c3c",
9
+ "#3498db",
10
+ "#2ecc71",
11
+ "#9b59b6",
12
+ "#f39c12",
13
+ "#1abc9c",
14
+ "#e67e22",
15
+ "#c0392b",
16
+ "#2980b9",
17
+ "#8e44ad",
18
+ "#16a085",
19
+ "#d35400",
20
+ "#27ae60",
21
+ "#2c3e50",
22
+ "#f1c40f"
23
+ ];
24
+ function parseSvgPoints(d) {
25
+ const points = [];
26
+ const regex = /([MLA])\s*([-\d.]+)\s+([-\d.]+)(?:\s+([-\d.]+)\s+([-\d.]+)\s+([-\d.]+)\s+([-\d.]+)\s+([-\d.]+))?/gi;
27
+ let match;
28
+ while ((match = regex.exec(d)) !== null) {
29
+ const cmd = match[1].toUpperCase();
30
+ if (cmd === "M" || cmd === "L") {
31
+ points.push({ x: parseFloat(match[2]), y: parseFloat(match[3]) });
32
+ } else if (cmd === "A") {
33
+ const arcRegex = /A\s*[-\d.]+\s+[-\d.]+\s+[-\d.]+\s+[-\d.]+\s+[-\d.]+\s+([-\d.]+)\s+([-\d.]+)/i;
34
+ const arcMatch = arcRegex.exec(d.slice(match.index));
35
+ if (arcMatch) {
36
+ points.push({ x: parseFloat(arcMatch[1]), y: parseFloat(arcMatch[2]) });
37
+ }
38
+ }
39
+ }
40
+ return points.filter(
41
+ (p, i, arr) => i === 0 || p.x !== arr[i - 1].x || p.y !== arr[i - 1].y
42
+ );
43
+ }
44
+
6
45
  // src/components/dieline/tuck-end-boxes/becf-1010a/generate.ts
7
46
  var MT = 0.5;
8
47
  var ARC_R = 5;
@@ -152,6 +191,47 @@ function bottomDustFlaps(xSide1, xFront, xSide2, xEnd, yBody2, dustFlap, dfCorne
152
191
  dustFlapPath(xSide2, xEnd, yBody2, 1, dustFlap, dfCorner, dfInset, dfVertical, false, false)
153
192
  ];
154
193
  }
194
+ function generateBecf1010aDebugSections(attr) {
195
+ const { length, width, height, glueArea, dustFlap, tuckFlap } = attr;
196
+ const glueTaper = glueArea * GLUE_TAPER_RATIO;
197
+ const tabWidth = 8;
198
+ const tabStep = 1;
199
+ const dfInset = Math.min(dustFlap / 3, width * 0.2);
200
+ const dfCorner = Math.min(dustFlap * 0.2, dfInset * 0.6);
201
+ const dfVertical = Math.min(dustFlap * 0.4, dustFlap - dfCorner);
202
+ const xRear = glueArea;
203
+ const xSide1 = glueArea + length;
204
+ const xFront = glueArea + length + width;
205
+ const xSide2 = glueArea + length + width + length;
206
+ const xEnd = glueArea + 2 * length + 2 * width;
207
+ const yTop = 0;
208
+ const yFold1 = tuckFlap;
209
+ const yBody1 = tuckFlap + width;
210
+ const yBody2 = tuckFlap + width + height;
211
+ const yFold2 = tuckFlap + width + height + width;
212
+ const yBot = tuckFlap + 2 * width + height + tuckFlap;
213
+ const totalWidth = xEnd;
214
+ const totalHeight = yBot;
215
+ const crease = [];
216
+ crease.push(
217
+ ...verticalCreases(xRear, xSide1, xFront, xSide2, yBody1, yBody2),
218
+ ...horizontalCreases(xRear, xSide1, xFront, xSide2, xEnd, yBody1, yBody2),
219
+ tuckFoldCrease(xRear, xSide1, tabWidth, yFold1),
220
+ tuckFoldCrease(xFront, xSide2, tabWidth, yFold2)
221
+ );
222
+ let ci = 0;
223
+ const sections = [
224
+ { name: "Right Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line(xEnd, yBody1, xEnd, yBody2)] },
225
+ { name: "Glue Area", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [glueAreaPath(xRear, yBody1, yBody2, glueTaper, glueArea)] },
226
+ { name: "Rear Bottom Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line(xSide1, yBody2, xRear, yBody2)] },
227
+ { name: "Top Tuck", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [...topTuckStructure(xRear, xSide1, yBody1, yFold1, yTop, tabWidth, tabStep), ...topTuckTip(xRear, xSide1, yFold1, yTop, tabStep)] },
228
+ { name: "Bottom Tuck", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [...bottomTuckStructure(xFront, xSide2, yBody2, yFold2, yBot, tabWidth, tabStep), ...bottomTuckTip(xFront, xSide2, yFold2, yBot, tabStep)] },
229
+ { name: "Front Top Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line(xFront, yBody1, xSide2, yBody1), line(xFront - MT, yBody1, xFront, yBody1), line(xSide2, yBody1, xSide2 + MT, yBody1)] },
230
+ { name: "Top Dust Flaps", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: topDustFlaps(xSide1, xFront, xSide2, xEnd, yBody1, dustFlap, dfCorner, dfInset, dfVertical) },
231
+ { name: "Bottom Dust Flaps", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: bottomDustFlaps(xSide1, xFront, xSide2, xEnd, yBody2, dustFlap, dfCorner, dfInset, dfVertical) }
232
+ ];
233
+ return { sections, crease, viewBox: { width: totalWidth, height: totalHeight } };
234
+ }
155
235
  function generateOuterContour(attr) {
156
236
  const { length, width, height, glueArea, dustFlap, tuckFlap } = attr;
157
237
  const glueTaper = glueArea * GLUE_TAPER_RATIO;
@@ -1006,6 +1086,79 @@ async function exportDimensionPdf(params) {
1006
1086
  const arrayBuffer = doc.output("arraybuffer");
1007
1087
  return new Blob([arrayBuffer], { type: "application/pdf" });
1008
1088
  }
1089
+ function DebugOverlay({ data, fontSize }) {
1090
+ const ptR = fontSize * 0.3;
1091
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1092
+ /* @__PURE__ */ jsx("g", { id: "debug-crease", children: data.crease.map((d, i) => /* @__PURE__ */ jsx(
1093
+ "path",
1094
+ {
1095
+ d,
1096
+ fill: "none",
1097
+ stroke: "#aaa",
1098
+ strokeWidth: 0.3,
1099
+ strokeDasharray: "2,1"
1100
+ },
1101
+ `dc-${i}`
1102
+ )) }),
1103
+ data.sections.map((section, si) => {
1104
+ let pointCounter = 0;
1105
+ return /* @__PURE__ */ jsxs("g", { id: `debug-${section.name}`, children: [
1106
+ section.paths.map((d, pi) => {
1107
+ const pts = parseSvgPoints(d);
1108
+ const startIdx = pointCounter;
1109
+ pointCounter += pts.length;
1110
+ return /* @__PURE__ */ jsxs("g", { children: [
1111
+ /* @__PURE__ */ jsx(
1112
+ "path",
1113
+ {
1114
+ d,
1115
+ fill: "none",
1116
+ stroke: section.color,
1117
+ strokeWidth: 1
1118
+ }
1119
+ ),
1120
+ pts.map((p, idx) => /* @__PURE__ */ jsxs("g", { children: [
1121
+ /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: ptR, fill: section.color }),
1122
+ /* @__PURE__ */ jsx(
1123
+ "text",
1124
+ {
1125
+ x: p.x + ptR + 0.5,
1126
+ y: p.y - ptR,
1127
+ fontSize: fontSize * 0.6,
1128
+ fontFamily: "monospace",
1129
+ fontWeight: "bold",
1130
+ fill: section.color,
1131
+ children: startIdx + idx + 1
1132
+ }
1133
+ )
1134
+ ] }, `pt-${si}-${pi}-${idx}`))
1135
+ ] }, `dp-${si}-${pi}`);
1136
+ }),
1137
+ (() => {
1138
+ const allPts = section.paths.flatMap(parseSvgPoints);
1139
+ if (allPts.length === 0) return null;
1140
+ const cx = allPts.reduce((s, p) => s + p.x, 0) / allPts.length;
1141
+ const cy = allPts.reduce((s, p) => s + p.y, 0) / allPts.length;
1142
+ return /* @__PURE__ */ jsx(
1143
+ "text",
1144
+ {
1145
+ x: cx,
1146
+ y: cy,
1147
+ textAnchor: "middle",
1148
+ dominantBaseline: "central",
1149
+ fontSize,
1150
+ fontFamily: "sans-serif",
1151
+ fontWeight: "bold",
1152
+ fill: section.color,
1153
+ opacity: 0.8,
1154
+ children: section.name
1155
+ }
1156
+ );
1157
+ })()
1158
+ ] }, `ds-${si}`);
1159
+ })
1160
+ ] });
1161
+ }
1009
1162
  var MODEL_ID = "BECF-1010A";
1010
1163
  var UNIT_FACTOR = {
1011
1164
  mm: 1,
@@ -1064,7 +1217,8 @@ var DIE_LINE_BECF_1010A = forwardRef(
1064
1217
  attributes,
1065
1218
  unit = "mm",
1066
1219
  isShowDimensions = false,
1067
- renderAs = "svg"
1220
+ renderAs = "svg",
1221
+ debug = false
1068
1222
  }, ref) => {
1069
1223
  const theme = useMemo(
1070
1224
  () => getModelTheme(),
@@ -1151,12 +1305,17 @@ var DIE_LINE_BECF_1010A = forwardRef(
1151
1305
  }),
1152
1306
  [attributes, dieline, factor, unit, serializeSvg, theme]
1153
1307
  );
1308
+ const debugData = useMemo(
1309
+ () => debug ? generateBecf1010aDebugSections(attributes) : null,
1310
+ [attributes, debug]
1311
+ );
1154
1312
  const padding = isShowDimensions ? 15 : 0;
1155
1313
  const vbX = -padding;
1156
1314
  const vbY = -padding;
1157
1315
  const vbW = dieline.viewBox.width + padding * 2;
1158
1316
  const vbH = dieline.viewBox.height + padding * 2;
1159
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
1317
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
1318
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1160
1319
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
1161
1320
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
1162
1321
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension(d, i, getFontDimensionSize())) })
@@ -1417,6 +1576,45 @@ function bottomDustFlaps2(xSide1, xFront, xSide2, xEnd, yBody2, dustFlap, dfCorn
1417
1576
  dustFlapPath2(xSide2, xEnd, yBody2, 1, dustFlap, dfCorner, dfInset, dfVertical, true, false)
1418
1577
  ];
1419
1578
  }
1579
+ function generateBecf1030aDebugSections(attr) {
1580
+ const { length, width, height, glueArea, dustFlap, tuckFlap } = attr;
1581
+ const glueTaper = glueArea * GLUE_TAPER_RATIO2;
1582
+ const tabWidth = 9;
1583
+ const tabStep = 1;
1584
+ const dfInset = Math.min(dustFlap * 0.2, width * 0.2);
1585
+ const dfCorner = Math.min(dustFlap * 0.12, dfInset * 0.6);
1586
+ const dfVertical = Math.min(dustFlap * 0.28, dustFlap - dfCorner);
1587
+ const xRear = glueArea;
1588
+ const xSide1 = glueArea + length;
1589
+ const xFront = glueArea + length + width;
1590
+ const xSide2 = glueArea + length + width + length;
1591
+ const xEnd = glueArea + 2 * length + 2 * width;
1592
+ const yTop = 0;
1593
+ const yFold1 = tuckFlap;
1594
+ const yBody1 = tuckFlap + width;
1595
+ const yBody2 = tuckFlap + width + height;
1596
+ const yFold2 = tuckFlap + width + height + width;
1597
+ const yBot = tuckFlap + 2 * width + height + tuckFlap;
1598
+ const totalWidth = xEnd;
1599
+ const totalHeight = yBot;
1600
+ const crease = [];
1601
+ crease.push(
1602
+ ...verticalCreases2(xRear, xSide1, xFront, xSide2, yBody1, yBody2),
1603
+ ...horizontalCreases2(xRear, xSide1, xFront, xSide2, xEnd, yBody1, yBody2, tabWidth, yFold1, yFold2, tabStep)
1604
+ );
1605
+ let ci = 0;
1606
+ const sections = [
1607
+ { name: "Right Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line2(xEnd, yBody1, xEnd, yBody2)] },
1608
+ { name: "Glue Area", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [glueAreaPath2(xRear, yBody1, yBody2, glueTaper, glueArea)] },
1609
+ { name: "Front Top Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line2(xFront, yBody1, xSide2, yBody1), line2(xFront - MT2, yBody1, xFront, yBody1), line2(xSide2, yBody1, xSide2 + MT2, yBody1)] },
1610
+ { name: "Front Bottom Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line2(xFront, yBody2, xSide2, yBody2), line2(xFront - MT2, yBody2, xFront, yBody2), line2(xSide2, yBody2, xSide2 + MT2, yBody2)] },
1611
+ { name: "Top Tuck", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [...topTuckStructure2(xRear, xSide1, yBody1, yFold1, tabWidth, tabStep), ...topTuckTip2(xRear, xSide1, yFold1, yTop)] },
1612
+ { name: "Bottom Tuck", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [...bottomTuckStructure2(xRear, xSide1, yBody2, yFold2, tabWidth, tabStep), ...bottomTuckTip2(xRear, xSide1, yFold2, yBot)] },
1613
+ { name: "Top Dust Flaps", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: topDustFlaps2(xSide1, xFront, xSide2, xEnd, yBody1, dustFlap, dfCorner, dfInset, dfVertical) },
1614
+ { name: "Bottom Dust Flaps", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: bottomDustFlaps2(xSide1, xFront, xSide2, xEnd, yBody2, dustFlap, dfCorner, dfInset, dfVertical) }
1615
+ ];
1616
+ return { sections, crease, viewBox: { width: totalWidth, height: totalHeight } };
1617
+ }
1420
1618
  function generateOuterContour2(attr) {
1421
1619
  const { length, width, height, glueArea, dustFlap, tuckFlap } = attr;
1422
1620
  const glueTaper = glueArea * GLUE_TAPER_RATIO2;
@@ -1712,7 +1910,8 @@ var DIE_LINE_BECF_1030A = forwardRef(
1712
1910
  attributes,
1713
1911
  unit = "mm",
1714
1912
  isShowDimensions = false,
1715
- renderAs = "svg"
1913
+ renderAs = "svg",
1914
+ debug = false
1716
1915
  }, ref) => {
1717
1916
  const theme = useMemo(
1718
1917
  () => getModelTheme(),
@@ -1799,12 +1998,17 @@ var DIE_LINE_BECF_1030A = forwardRef(
1799
1998
  }),
1800
1999
  [attributes, dieline, factor, unit, serializeSvg, theme]
1801
2000
  );
2001
+ const debugData = useMemo(
2002
+ () => debug ? generateBecf1030aDebugSections(attributes) : null,
2003
+ [attributes, debug]
2004
+ );
1802
2005
  const padding = isShowDimensions ? 15 : 0;
1803
2006
  const vbX = -padding;
1804
2007
  const vbY = -padding;
1805
2008
  const vbW = dieline.viewBox.width + padding * 2;
1806
2009
  const vbH = dieline.viewBox.height + padding * 2;
1807
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
2010
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
2011
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1808
2012
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
1809
2013
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
1810
2014
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension2(d, i, getFontDimensionSize())) })
@@ -2069,6 +2273,44 @@ function bottomDustFlaps3(xSide1, xFront, xSide2, xEnd, yBody2, dustFlap, dfCorn
2069
2273
  dustFlapPath3(xSide2, xEnd, yBody2, 1, dustFlap, dfCorner, dfInset, dfVertical, "none", "edge")
2070
2274
  ];
2071
2275
  }
2276
+ function generateBecf1040aDebugSections(attr) {
2277
+ const { length, width, height, glueArea, dustFlap, tuckFlap } = attr;
2278
+ const glueTaper = glueArea * GLUE_TAPER_RATIO3;
2279
+ const tabWidth = 7;
2280
+ const tabStep = 1;
2281
+ const dfInset = Math.min(dustFlap / 6, width * 0.2);
2282
+ const dfCorner = Math.min(dustFlap * 0.1, dfInset * 0.6);
2283
+ const dfVertical = Math.min(dustFlap / 6, dustFlap - dfCorner);
2284
+ const xRear = glueArea;
2285
+ const xSide1 = glueArea + length;
2286
+ const xFront = glueArea + length + width;
2287
+ const xSide2 = glueArea + length + width + length;
2288
+ const xEnd = glueArea + 2 * length + 2 * width;
2289
+ const yFold1 = tuckFlap;
2290
+ const yBody1 = tuckFlap + width;
2291
+ const yBody2 = tuckFlap + width + height;
2292
+ const yFold2 = tuckFlap + width + height + width;
2293
+ const yBot = tuckFlap + 2 * width + height + tuckFlap;
2294
+ const totalWidth = xEnd;
2295
+ const totalHeight = yBot;
2296
+ const crease = [];
2297
+ crease.push(
2298
+ ...verticalCreases3(xRear, xSide1, xFront, xSide2, yBody1, yBody2),
2299
+ ...horizontalCreases3(xSide1, xFront, xSide2, xEnd, yBody1, yBody2, tabWidth, yFold1, yFold2, tabStep)
2300
+ );
2301
+ let ci = 0;
2302
+ const sections = [
2303
+ { name: "Right Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line3(xEnd, yBody1, xEnd, yBody2)] },
2304
+ { name: "Glue Area", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [glueAreaPath3(xRear, yBody1, yBody2, glueTaper, glueArea)] },
2305
+ { name: "Rear Top Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line3(xSide1, yBody1, xRear, yBody1), line3(xSide1, yBody1, xSide1 + MT3, yBody1)] },
2306
+ { name: "Rear Bottom Edge", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [line3(xSide1, yBody2, xRear, yBody2), line3(xSide1, yBody2, xSide1 + MT3, yBody2)] },
2307
+ { name: "Top Tuck", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [...topTuckStructure3(xFront, xSide2, yBody1, yFold1, tabWidth, tabStep), ...topTuckTip3(xFront, xSide2, yFold1, 0)] },
2308
+ { name: "Bottom Tuck", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: [...bottomTuckStructure3(xFront, xSide2, yBody2, yFold2, tabWidth, tabStep), ...bottomTuckTip3(xFront, xSide2, yFold2, yBot)] },
2309
+ { name: "Top Dust Flaps", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: topDustFlaps3(xSide1, xFront, xSide2, xEnd, yBody1, dustFlap, dfCorner, dfInset, dfVertical) },
2310
+ { name: "Bottom Dust Flaps", color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length], paths: bottomDustFlaps3(xSide1, xFront, xSide2, xEnd, yBody2, dustFlap, dfCorner, dfInset, dfVertical) }
2311
+ ];
2312
+ return { sections, crease, viewBox: { width: totalWidth, height: totalHeight } };
2313
+ }
2072
2314
  function generateOuterContour3(attr) {
2073
2315
  const { length, width, height, glueArea, dustFlap, tuckFlap } = attr;
2074
2316
  const glueTaper = glueArea * GLUE_TAPER_RATIO3;
@@ -2363,7 +2605,8 @@ var DIE_LINE_BECF_1040A = forwardRef(
2363
2605
  attributes,
2364
2606
  unit = "mm",
2365
2607
  isShowDimensions = false,
2366
- renderAs = "svg"
2608
+ renderAs = "svg",
2609
+ debug = false
2367
2610
  }, ref) => {
2368
2611
  const theme = useMemo(
2369
2612
  () => getModelTheme(),
@@ -2450,12 +2693,17 @@ var DIE_LINE_BECF_1040A = forwardRef(
2450
2693
  }),
2451
2694
  [attributes, dieline, factor, unit, serializeSvg, theme]
2452
2695
  );
2696
+ const debugData = useMemo(
2697
+ () => debug ? generateBecf1040aDebugSections(attributes) : null,
2698
+ [attributes, debug]
2699
+ );
2453
2700
  const padding = isShowDimensions ? 15 : 0;
2454
2701
  const vbX = -padding;
2455
2702
  const vbY = -padding;
2456
2703
  const vbW = dieline.viewBox.width + padding * 2;
2457
2704
  const vbH = dieline.viewBox.height + padding * 2;
2458
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
2705
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
2706
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2459
2707
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
2460
2708
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
2461
2709
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension3(d, i, getFontDimensionSize())) })
@@ -2868,6 +3116,149 @@ function generateDimensions4(attr, unit) {
2868
3116
  }
2869
3117
  ];
2870
3118
  }
3119
+ function generateBecf11d01DebugSections(attr) {
3120
+ const { length, width, height, flapHeight, glueArea } = attr;
3121
+ const glueTaper = glueArea * GLUE_TAPER_RATIO4;
3122
+ const xRear = glueArea;
3123
+ const xSide1 = glueArea + length;
3124
+ const xFront = glueArea + length + width;
3125
+ const xSide2 = glueArea + length + width + length;
3126
+ const xEnd = glueArea + 2 * length + 2 * width;
3127
+ const yTop = 0;
3128
+ const yBody1 = flapHeight;
3129
+ const yBody2 = flapHeight + height;
3130
+ const yBot = 2 * flapHeight + height;
3131
+ const totalWidth = xEnd;
3132
+ const totalHeight = yBot;
3133
+ const crease = [];
3134
+ crease.push(
3135
+ line4(xRear, yBody1, xRear, yBody2),
3136
+ line4(xSide1, yBody1, xSide1, yBody2),
3137
+ line4(xFront, yBody1, xFront, yBody2),
3138
+ line4(xSide2, yBody1, xSide2, yBody2)
3139
+ );
3140
+ crease.push(line4(xRear + FLAP_INSET, yBody1 + MT4, xSide1 - FLAP_INSET, yBody1 + MT4));
3141
+ crease.push(line4(xSide1, yBody1, xFront, yBody1));
3142
+ crease.push(line4(xFront + FLAP_INSET, yBody1 + MT4, xSide2 - FLAP_INSET, yBody1 + MT4));
3143
+ crease.push(line4(xSide2, yBody1, xEnd, yBody1));
3144
+ crease.push(line4(xRear + FLAP_INSET, yBody2 - MT4, xSide1 - FLAP_INSET, yBody2 - MT4));
3145
+ crease.push(line4(xSide1, yBody2, xFront, yBody2));
3146
+ crease.push(line4(xFront + FLAP_INSET, yBody2 - MT4, xSide2 - FLAP_INSET, yBody2 - MT4));
3147
+ crease.push(line4(xSide2, yBody2, xEnd, yBody2));
3148
+ const sections = [];
3149
+ let colorIdx = 0;
3150
+ sections.push({
3151
+ name: "Glue Area",
3152
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3153
+ paths: [glueAreaPath4(xRear, yBody1, yBody2, glueTaper, glueArea)]
3154
+ });
3155
+ sections.push({
3156
+ name: "Right Edge",
3157
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3158
+ paths: [line4(xEnd, yBody1, xEnd, yBody2)]
3159
+ });
3160
+ {
3161
+ const rL = xRear + FLAP_INSET;
3162
+ const rR = xSide1 - FLAP_INSET;
3163
+ sections.push({
3164
+ name: "Top Rear Dust Flap",
3165
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3166
+ paths: [
3167
+ line4(rL, yBody1, rL, yTop),
3168
+ line4(rL, yTop, rR, yTop),
3169
+ line4(rR, yTop, rR, yBody1),
3170
+ line4(xRear, yBody1, rL, yBody1),
3171
+ line4(rR, yBody1, xSide1, yBody1)
3172
+ ]
3173
+ });
3174
+ }
3175
+ sections.push({
3176
+ name: "Top Side1 Flap",
3177
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3178
+ paths: [
3179
+ line4(xSide1, yBody1, xSide1, yTop),
3180
+ line4(xSide1, yTop, xFront, yTop),
3181
+ line4(xFront, yTop, xFront, yBody1)
3182
+ ]
3183
+ });
3184
+ {
3185
+ const fL = xFront + FLAP_INSET;
3186
+ const fR = xSide2 - FLAP_INSET;
3187
+ sections.push({
3188
+ name: "Top Front Dust Flap",
3189
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3190
+ paths: [
3191
+ line4(fL, yBody1, fL, yTop),
3192
+ line4(fL, yTop, fR, yTop),
3193
+ line4(fR, yTop, fR, yBody1),
3194
+ line4(xFront, yBody1, fL, yBody1),
3195
+ line4(fR, yBody1, xSide2, yBody1)
3196
+ ]
3197
+ });
3198
+ }
3199
+ sections.push({
3200
+ name: "Top Side2 Flap",
3201
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3202
+ paths: [
3203
+ line4(xSide2, yBody1, xSide2, yTop),
3204
+ line4(xSide2, yTop, xEnd, yTop),
3205
+ line4(xEnd, yTop, xEnd, yBody1)
3206
+ ]
3207
+ });
3208
+ {
3209
+ const rL = xRear + FLAP_INSET;
3210
+ const rR = xSide1 - FLAP_INSET;
3211
+ sections.push({
3212
+ name: "Bottom Rear Dust Flap",
3213
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3214
+ paths: [
3215
+ line4(rL, yBody2, rL, yBot),
3216
+ line4(rL, yBot, rR, yBot),
3217
+ line4(rR, yBot, rR, yBody2),
3218
+ line4(xRear, yBody2, rL, yBody2),
3219
+ line4(rR, yBody2, xSide1, yBody2)
3220
+ ]
3221
+ });
3222
+ }
3223
+ sections.push({
3224
+ name: "Bottom Side1 Flap",
3225
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3226
+ paths: [
3227
+ line4(xSide1, yBody2, xSide1, yBot),
3228
+ line4(xSide1, yBot, xFront, yBot),
3229
+ line4(xFront, yBot, xFront, yBody2)
3230
+ ]
3231
+ });
3232
+ {
3233
+ const fL = xFront + FLAP_INSET;
3234
+ const fR = xSide2 - FLAP_INSET;
3235
+ sections.push({
3236
+ name: "Bottom Front Dust Flap",
3237
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3238
+ paths: [
3239
+ line4(fL, yBody2, fL, yBot),
3240
+ line4(fL, yBot, fR, yBot),
3241
+ line4(fR, yBot, fR, yBody2),
3242
+ line4(xFront, yBody2, fL, yBody2),
3243
+ line4(fR, yBody2, xSide2, yBody2)
3244
+ ]
3245
+ });
3246
+ }
3247
+ sections.push({
3248
+ name: "Bottom Side2 Flap",
3249
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
3250
+ paths: [
3251
+ line4(xSide2, yBody2, xSide2, yBot),
3252
+ line4(xSide2, yBot, xEnd, yBot),
3253
+ line4(xEnd, yBot, xEnd, yBody2)
3254
+ ]
3255
+ });
3256
+ return {
3257
+ sections,
3258
+ crease,
3259
+ viewBox: { width: totalWidth, height: totalHeight }
3260
+ };
3261
+ }
2871
3262
  var MODEL_ID4 = "BECF-11D01";
2872
3263
  var UNIT_FACTOR4 = {
2873
3264
  mm: 1,
@@ -2926,7 +3317,8 @@ var DIE_LINE_BECF_11D01 = forwardRef(
2926
3317
  attributes,
2927
3318
  unit = "mm",
2928
3319
  isShowDimensions = false,
2929
- renderAs = "svg"
3320
+ renderAs = "svg",
3321
+ debug = false
2930
3322
  }, ref) => {
2931
3323
  const theme = useMemo(
2932
3324
  () => getModelTheme(),
@@ -2938,6 +3330,10 @@ var DIE_LINE_BECF_11D01 = forwardRef(
2938
3330
  () => generateDimensions4(attributes, unit),
2939
3331
  [attributes, unit]
2940
3332
  );
3333
+ const debugData = useMemo(
3334
+ () => debug ? generateBecf11d01DebugSections(attributes) : null,
3335
+ [attributes, debug]
3336
+ );
2941
3337
  const factor = UNIT_FACTOR4[unit] ?? 1;
2942
3338
  const serializeSvg = useCallback(
2943
3339
  (showDimensions) => {
@@ -3017,7 +3413,8 @@ var DIE_LINE_BECF_11D01 = forwardRef(
3017
3413
  const vbY = -padding;
3018
3414
  const vbW = dieline.viewBox.width + padding * 2;
3019
3415
  const vbH = dieline.viewBox.height + padding * 2;
3020
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
3416
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
3417
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3021
3418
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
3022
3419
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
3023
3420
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension4(d, i, getFontDimensionSize())) })
@@ -3222,6 +3619,89 @@ function generateBecf12101(attr) {
3222
3619
  crease.push(line5(xSide2Mid, yFoldBottomStart, xEnd, D + C - 2));
3223
3620
  return { cut, crease, viewBox: { width: totalWidth, height: totalHeight } };
3224
3621
  }
3622
+ function generateBecf12101DebugSections(attr) {
3623
+ const { length: A, width: B, height: C, glueArea } = attr;
3624
+ const D = calcD(C, B);
3625
+ const kulak = glueArea ?? calcKulak(B);
3626
+ const X = calcX(A);
3627
+ const xFront = kulak;
3628
+ const xSide1 = kulak + A;
3629
+ const xSide1Mid = kulak + A + B / 2;
3630
+ const xBack = kulak + A + B;
3631
+ const xSide2 = kulak + 2 * A + B;
3632
+ const xSide2Mid = kulak + 2 * A + B + B / 2;
3633
+ const xEnd = kulak + 2 * A + 2 * B - 2;
3634
+ const yFoldTop = D;
3635
+ const yFoldBottomStart = D + C - B / 2;
3636
+ const yFoldBottom = D + C;
3637
+ const yBottomFlap = D + C + B / 2;
3638
+ const yEnd = D + C + B / 2 + DIP;
3639
+ const totalWidth = xEnd;
3640
+ const totalHeight = yEnd;
3641
+ const crease = [];
3642
+ crease.push(line5(0, yFoldTop, totalWidth, yFoldTop));
3643
+ crease.push(line5(0, yFoldBottomStart, totalWidth, yFoldBottomStart));
3644
+ crease.push(line5(0, yFoldBottom, totalWidth, yFoldBottom));
3645
+ crease.push(line5(xFront, 0, xFront, totalHeight));
3646
+ crease.push(line5(xSide1, 0, xSide1, totalHeight));
3647
+ crease.push(line5(xSide1Mid, 0, xSide1Mid, totalHeight));
3648
+ crease.push(line5(xBack, 0, xBack, totalHeight));
3649
+ crease.push(line5(xSide2, 0, xSide2, totalHeight));
3650
+ crease.push(line5(xSide2Mid, 0, xSide2Mid, totalHeight));
3651
+ crease.push(line5(0, yFoldBottom - kulak, kulak + B / 2, yBottomFlap));
3652
+ crease.push(line5(kulak + A - B / 2, yBottomFlap, xSide1Mid, yFoldBottomStart));
3653
+ crease.push(line5(xSide1Mid, yFoldBottomStart, kulak + A + B + B / 2, yBottomFlap));
3654
+ crease.push(line5(kulak + 2 * A + B - B / 2, yBottomFlap, xSide2Mid, yFoldBottomStart));
3655
+ crease.push(line5(xSide2Mid, yFoldBottomStart, xEnd, D + C - 2));
3656
+ const frontCx = kulak + A / 2;
3657
+ const backCx = kulak + A + B + A / 2;
3658
+ const ropeTopY = yFoldTop - ROPE_Y;
3659
+ const ropeBotY = yFoldTop + ROPE_Y;
3660
+ let ci = 0;
3661
+ const sections = [
3662
+ {
3663
+ name: "Outer Rect",
3664
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
3665
+ paths: [
3666
+ line5(0, 0, totalWidth, 0),
3667
+ line5(totalWidth, 0, totalWidth, totalHeight),
3668
+ line5(totalWidth, totalHeight, 0, totalHeight),
3669
+ line5(0, totalHeight, 0, 0)
3670
+ ]
3671
+ },
3672
+ {
3673
+ name: "Bottom Zone Cuts",
3674
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
3675
+ paths: [
3676
+ line5(kulak + B / 2, yBottomFlap, kulak + B / 2, yEnd),
3677
+ line5(kulak + A - B / 2, yBottomFlap, kulak + A - B / 2, yEnd),
3678
+ line5(kulak + A + B + B / 2, yBottomFlap, kulak + A + B + B / 2, yEnd),
3679
+ line5(kulak + 2 * A + B - B / 2, yBottomFlap, kulak + 2 * A + B - B / 2, yEnd)
3680
+ ]
3681
+ },
3682
+ {
3683
+ name: "Front Rope Holes",
3684
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
3685
+ paths: [
3686
+ circlePath(frontCx - X / 2, ropeTopY, ROPE_R),
3687
+ circlePath(frontCx - X / 2, ropeBotY, ROPE_R),
3688
+ circlePath(frontCx + X / 2, ropeTopY, ROPE_R),
3689
+ circlePath(frontCx + X / 2, ropeBotY, ROPE_R)
3690
+ ]
3691
+ },
3692
+ {
3693
+ name: "Back Rope Holes",
3694
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
3695
+ paths: [
3696
+ circlePath(backCx - X / 2, ropeTopY, ROPE_R),
3697
+ circlePath(backCx - X / 2, ropeBotY, ROPE_R),
3698
+ circlePath(backCx + X / 2, ropeTopY, ROPE_R),
3699
+ circlePath(backCx + X / 2, ropeBotY, ROPE_R)
3700
+ ]
3701
+ }
3702
+ ];
3703
+ return { sections, crease, viewBox: { width: totalWidth, height: totalHeight } };
3704
+ }
3225
3705
  function generateOuterContour5(attr) {
3226
3706
  const { length: A, width: B, height: C, glueArea } = attr;
3227
3707
  const D = calcD(C, B);
@@ -3436,7 +3916,8 @@ var DIE_LINE_BECF_12101 = forwardRef(
3436
3916
  attributes,
3437
3917
  unit = "mm",
3438
3918
  isShowDimensions = false,
3439
- renderAs = "svg"
3919
+ renderAs = "svg",
3920
+ debug = false
3440
3921
  }, ref) => {
3441
3922
  const theme = useMemo(
3442
3923
  () => getModelTheme(),
@@ -3444,6 +3925,10 @@ var DIE_LINE_BECF_12101 = forwardRef(
3444
3925
  );
3445
3926
  const svgRef = useRef(null);
3446
3927
  const dieline = useMemo(() => generateBecf12101(attributes), [attributes]);
3928
+ const debugData = useMemo(
3929
+ () => debug ? generateBecf12101DebugSections(attributes) : null,
3930
+ [attributes, debug]
3931
+ );
3447
3932
  const dimensions = useMemo(
3448
3933
  () => generateDimensions5(attributes, unit),
3449
3934
  [attributes, unit]
@@ -3535,7 +4020,8 @@ var DIE_LINE_BECF_12101 = forwardRef(
3535
4020
  const vbY = -padding;
3536
4021
  const vbW = dieline.viewBox.width + padding * 2;
3537
4022
  const vbH = dieline.viewBox.height + padding * 2;
3538
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
4023
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
4024
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3539
4025
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
3540
4026
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
3541
4027
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension5(d, i, getFontDimensionSize())) })
@@ -3755,6 +4241,114 @@ function generateBecf12109(attr) {
3755
4241
  crease.push(line6(xSide2Mid, yFoldBottomStart, xEnd, D + C - 2));
3756
4242
  return { cut, crease, viewBox: { width: totalWidth, height: totalHeight } };
3757
4243
  }
4244
+ function generateBecf12109DebugSections(attr) {
4245
+ const { length: A, width: B, height: C, glueArea } = attr;
4246
+ const D = calcD2(C, B);
4247
+ const kulak = glueArea ?? calcKulak2(B);
4248
+ const X = calcX2(A);
4249
+ const xFront = kulak;
4250
+ const xSide1 = kulak + A;
4251
+ const xBack = kulak + A + B;
4252
+ const xSide2 = kulak + 2 * A + B;
4253
+ const xSide1Mid = kulak + A + B / 2;
4254
+ const xSide2Mid = kulak + 2 * A + B + B / 2;
4255
+ const xEnd = kulak + 2 * A + 2 * B - 2;
4256
+ const yFoldTop = D;
4257
+ const yFoldBottomStart = D + C - B / 2;
4258
+ const yFoldBottom = D + C;
4259
+ const yNotchStart = yFoldBottom + NOTCH_Y;
4260
+ const yEnd = D + C + B / 2 + DIP2;
4261
+ const totalWidth = xEnd;
4262
+ const totalHeight = yEnd;
4263
+ const crease = [];
4264
+ crease.push(line6(0, yFoldTop, totalWidth, yFoldTop));
4265
+ crease.push(line6(0, yFoldBottomStart, totalWidth, yFoldBottomStart));
4266
+ crease.push(line6(kulak, yFoldBottom, xEnd, yFoldBottom));
4267
+ crease.push(line6(xFront, 0, xFront, yFoldBottom));
4268
+ crease.push(line6(xSide1, 0, xSide1, yFoldBottom));
4269
+ crease.push(line6(xBack, 0, xBack, yFoldBottom));
4270
+ crease.push(line6(xSide2, 0, xSide2, yFoldBottom));
4271
+ crease.push(line6(xSide1Mid, 0, xSide1Mid, totalHeight));
4272
+ crease.push(line6(xSide2Mid, 0, xSide2Mid, totalHeight));
4273
+ crease.push(line6(xBack, yFoldBottom, xSide1Mid, yFoldBottomStart));
4274
+ crease.push(line6(xSide1Mid, yFoldBottomStart, xSide1, yFoldBottom));
4275
+ crease.push(line6(xSide2Mid, yFoldBottomStart, xSide2, yFoldBottom));
4276
+ crease.push(line6(xSide2Mid, yFoldBottomStart, xEnd, D + C - 2));
4277
+ const frontCx = kulak + A / 2;
4278
+ const backCx = kulak + A + B + A / 2;
4279
+ const ropeTopY = yFoldTop - ROPE_Y2;
4280
+ const ropeBotY = yFoldTop + ROPE_Y2;
4281
+ const boundaries = [xFront, xSide1, xBack, xSide2, xEnd];
4282
+ const vNotchPaths = [];
4283
+ for (let i = 0; i < boundaries.length; i++) {
4284
+ const xb = boundaries[i];
4285
+ const isFirst = i === 0;
4286
+ const isLast = i === boundaries.length - 1;
4287
+ if (!isFirst) {
4288
+ vNotchPaths.push(line6(xb - NOTCH_X, yNotchStart, xb - NOTCH_X, totalHeight));
4289
+ vNotchPaths.push(line6(xb - NOTCH_X, yNotchStart, xb, yFoldBottom));
4290
+ }
4291
+ if (!isLast) {
4292
+ vNotchPaths.push(line6(xb + NOTCH_X, yNotchStart, xb + NOTCH_X, totalHeight));
4293
+ vNotchPaths.push(line6(xb + NOTCH_X, yNotchStart, xb, yFoldBottom));
4294
+ }
4295
+ }
4296
+ let ci = 0;
4297
+ const sections = [
4298
+ {
4299
+ name: "Partial Outer Edges",
4300
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
4301
+ paths: [
4302
+ line6(0, 0, 0, yFoldBottom - kulak),
4303
+ line6(0, 0, totalWidth, 0),
4304
+ line6(totalWidth, 0, totalWidth, yFoldBottom)
4305
+ ]
4306
+ },
4307
+ {
4308
+ name: "Glue Flap Diagonal",
4309
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
4310
+ paths: [
4311
+ line6(0, yFoldBottom - kulak, kulak, yFoldBottom)
4312
+ ]
4313
+ },
4314
+ {
4315
+ name: "V-Notch Cuts",
4316
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
4317
+ paths: vNotchPaths
4318
+ },
4319
+ {
4320
+ name: "Bottom Segments",
4321
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
4322
+ paths: [
4323
+ line6(xFront + NOTCH_X, totalHeight, xSide1 - NOTCH_X, totalHeight),
4324
+ line6(xSide1 + NOTCH_X, totalHeight, xBack - NOTCH_X, totalHeight),
4325
+ line6(xBack + NOTCH_X, totalHeight, xSide2 - NOTCH_X, totalHeight),
4326
+ line6(xSide2 + NOTCH_X, totalHeight, xEnd - NOTCH_X, totalHeight)
4327
+ ]
4328
+ },
4329
+ {
4330
+ name: "Front Rope Holes",
4331
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
4332
+ paths: [
4333
+ circlePath2(frontCx - X / 2, ropeTopY, ROPE_R2),
4334
+ circlePath2(frontCx - X / 2, ropeBotY, ROPE_R2),
4335
+ circlePath2(frontCx + X / 2, ropeTopY, ROPE_R2),
4336
+ circlePath2(frontCx + X / 2, ropeBotY, ROPE_R2)
4337
+ ]
4338
+ },
4339
+ {
4340
+ name: "Back Rope Holes",
4341
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
4342
+ paths: [
4343
+ circlePath2(backCx - X / 2, ropeTopY, ROPE_R2),
4344
+ circlePath2(backCx - X / 2, ropeBotY, ROPE_R2),
4345
+ circlePath2(backCx + X / 2, ropeTopY, ROPE_R2),
4346
+ circlePath2(backCx + X / 2, ropeBotY, ROPE_R2)
4347
+ ]
4348
+ }
4349
+ ];
4350
+ return { sections, crease, viewBox: { width: totalWidth, height: totalHeight } };
4351
+ }
3758
4352
  function generateOuterContour6(attr) {
3759
4353
  const { length: A, width: B, height: C, glueArea } = attr;
3760
4354
  const D = calcD2(C, B);
@@ -4004,7 +4598,8 @@ var DIE_LINE_BECF_12109 = forwardRef(
4004
4598
  attributes,
4005
4599
  unit = "mm",
4006
4600
  isShowDimensions = false,
4007
- renderAs = "svg"
4601
+ renderAs = "svg",
4602
+ debug = false
4008
4603
  }, ref) => {
4009
4604
  const theme = useMemo(
4010
4605
  () => getModelTheme(),
@@ -4012,6 +4607,10 @@ var DIE_LINE_BECF_12109 = forwardRef(
4012
4607
  );
4013
4608
  const svgRef = useRef(null);
4014
4609
  const dieline = useMemo(() => generateBecf12109(attributes), [attributes]);
4610
+ const debugData = useMemo(
4611
+ () => debug ? generateBecf12109DebugSections(attributes) : null,
4612
+ [attributes, debug]
4613
+ );
4015
4614
  const dimensions = useMemo(
4016
4615
  () => generateDimensions6(attributes, unit),
4017
4616
  [attributes, unit]
@@ -4103,7 +4702,8 @@ var DIE_LINE_BECF_12109 = forwardRef(
4103
4702
  const vbY = -padding;
4104
4703
  const vbW = dieline.viewBox.width + padding * 2;
4105
4704
  const vbH = dieline.viewBox.height + padding * 2;
4106
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
4705
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
4706
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4107
4707
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
4108
4708
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
4109
4709
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension6(d, i, getFontDimensionSize())) })
@@ -4456,6 +5056,99 @@ function generateDimensions7(attr, unit) {
4456
5056
  }
4457
5057
  ];
4458
5058
  }
5059
+ function generateBecfC12101DebugSections(attr) {
5060
+ const { length: A, width: B, height: C, glueArea } = attr;
5061
+ const D = calcD3(C, B);
5062
+ const kulak = glueArea ?? calcKulak3(B);
5063
+ const X = calcX3(A);
5064
+ const xFront = kulak;
5065
+ const xSide1 = kulak + A;
5066
+ const xSide1Mid = kulak + A + B / 2;
5067
+ const xBack = kulak + A + B;
5068
+ const xSide2 = kulak + 2 * A + B;
5069
+ const xSide2Mid = kulak + 2 * A + B + B / 2;
5070
+ const xEnd = kulak + 2 * A + 2 * B - 2;
5071
+ const yFoldTop = D;
5072
+ const yFoldBottomStart = D + C - B / 2;
5073
+ const yFoldBottom = D + C;
5074
+ const yBottomFlap = D + C + B / 2;
5075
+ const yEnd = D + C + B / 2 + DIP3;
5076
+ const totalWidth = xEnd;
5077
+ const totalHeight = yEnd;
5078
+ const crease = [];
5079
+ crease.push(line7(0, yFoldTop, totalWidth, yFoldTop));
5080
+ crease.push(line7(0, yFoldBottomStart, totalWidth, yFoldBottomStart));
5081
+ crease.push(line7(0, yFoldBottom, totalWidth, yFoldBottom));
5082
+ crease.push(line7(xFront, 0, xFront, totalHeight));
5083
+ crease.push(line7(xSide1, 0, xSide1, totalHeight));
5084
+ crease.push(line7(xSide1Mid, 0, xSide1Mid, totalHeight));
5085
+ crease.push(line7(xBack, 0, xBack, totalHeight));
5086
+ crease.push(line7(xSide2, 0, xSide2, totalHeight));
5087
+ crease.push(line7(xSide2Mid, 0, xSide2Mid, totalHeight));
5088
+ crease.push(line7(0, yFoldBottom - kulak, kulak + B / 2, yBottomFlap));
5089
+ crease.push(line7(kulak + A - B / 2, yBottomFlap, xSide1Mid, yFoldBottomStart));
5090
+ crease.push(line7(xSide1Mid, yFoldBottomStart, kulak + A + B + B / 2, yBottomFlap));
5091
+ crease.push(line7(kulak + 2 * A + B - B / 2, yBottomFlap, xSide2Mid, yFoldBottomStart));
5092
+ crease.push(line7(xSide2Mid, yFoldBottomStart, xEnd, D + C - 2));
5093
+ const sections = [];
5094
+ let colorIdx = 0;
5095
+ sections.push({
5096
+ name: "Outer Rectangle",
5097
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5098
+ paths: [
5099
+ line7(0, 0, totalWidth, 0),
5100
+ line7(totalWidth, 0, totalWidth, totalHeight),
5101
+ line7(totalWidth, totalHeight, 0, totalHeight),
5102
+ line7(0, totalHeight, 0, 0)
5103
+ ]
5104
+ });
5105
+ sections.push({
5106
+ name: "Bottom Zone Verticals",
5107
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5108
+ paths: [
5109
+ line7(kulak + B / 2, yBottomFlap, kulak + B / 2, yEnd),
5110
+ line7(kulak + A - B / 2, yBottomFlap, kulak + A - B / 2, yEnd),
5111
+ line7(kulak + A + B + B / 2, yBottomFlap, kulak + A + B + B / 2, yEnd),
5112
+ line7(kulak + 2 * A + B - B / 2, yBottomFlap, kulak + 2 * A + B - B / 2, yEnd)
5113
+ ]
5114
+ });
5115
+ const frontCx = kulak + A / 2;
5116
+ const yNotchTop = yFoldTop - RIBBON_DY / 2;
5117
+ const yNotchBot = yFoldTop + RIBBON_DY / 2;
5118
+ function ribbonNotchPaths(cx) {
5119
+ return [
5120
+ line7(cx - RIBBON_HALF_W, yNotchBot, cx + RIBBON_HALF_W, yNotchBot),
5121
+ line7(cx - RIBBON_HALF_W - RIBBON_DX, yNotchTop, cx - RIBBON_HALF_W, yNotchBot),
5122
+ line7(cx + RIBBON_HALF_W + RIBBON_DX, yNotchTop, cx + RIBBON_HALF_W, yNotchBot)
5123
+ ];
5124
+ }
5125
+ sections.push({
5126
+ name: "Front Left Ribbon",
5127
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5128
+ paths: ribbonNotchPaths(frontCx - X / 2)
5129
+ });
5130
+ sections.push({
5131
+ name: "Front Right Ribbon",
5132
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5133
+ paths: ribbonNotchPaths(frontCx + X / 2)
5134
+ });
5135
+ const backCx = kulak + A + B + A / 2;
5136
+ sections.push({
5137
+ name: "Back Left Ribbon",
5138
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5139
+ paths: ribbonNotchPaths(backCx - X / 2)
5140
+ });
5141
+ sections.push({
5142
+ name: "Back Right Ribbon",
5143
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5144
+ paths: ribbonNotchPaths(backCx + X / 2)
5145
+ });
5146
+ return {
5147
+ sections,
5148
+ crease,
5149
+ viewBox: { width: totalWidth, height: totalHeight }
5150
+ };
5151
+ }
4459
5152
  var MODEL_ID7 = "BECF-C-12101";
4460
5153
  var UNIT_FACTOR7 = {
4461
5154
  mm: 1,
@@ -4514,7 +5207,8 @@ var DIE_LINE_BECF_C_12101 = forwardRef(
4514
5207
  attributes,
4515
5208
  unit = "mm",
4516
5209
  isShowDimensions = false,
4517
- renderAs = "svg"
5210
+ renderAs = "svg",
5211
+ debug = false
4518
5212
  }, ref) => {
4519
5213
  const theme = useMemo(
4520
5214
  () => getModelTheme(),
@@ -4526,6 +5220,10 @@ var DIE_LINE_BECF_C_12101 = forwardRef(
4526
5220
  () => generateDimensions7(attributes, unit),
4527
5221
  [attributes, unit]
4528
5222
  );
5223
+ const debugData = useMemo(
5224
+ () => debug ? generateBecfC12101DebugSections(attributes) : null,
5225
+ [attributes, debug]
5226
+ );
4529
5227
  const factor = UNIT_FACTOR7[unit] ?? 1;
4530
5228
  const serializeSvg = useCallback(
4531
5229
  (showDimensions) => {
@@ -4614,7 +5312,8 @@ var DIE_LINE_BECF_C_12101 = forwardRef(
4614
5312
  const vbY = -padding;
4615
5313
  const vbW = dieline.viewBox.width + padding * 2;
4616
5314
  const vbH = dieline.viewBox.height + padding * 2;
4617
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
5315
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
5316
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4618
5317
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
4619
5318
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
4620
5319
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension7(d, i, getFontDimensionSize())) })
@@ -5008,6 +5707,148 @@ function generateDimensions8(attr, unit) {
5008
5707
  }
5009
5708
  ];
5010
5709
  }
5710
+ function generateBecfC12109DebugSections(attr) {
5711
+ const { length: A, width: B, height: C, glueArea } = attr;
5712
+ const D = calcD4(C, B);
5713
+ const kulak = glueArea ?? calcKulak4(B);
5714
+ const X = calcX4(A);
5715
+ const xFront = kulak;
5716
+ const xSide1 = kulak + A;
5717
+ const xSide1Mid = kulak + A + B / 2;
5718
+ const xBack = kulak + A + B;
5719
+ const xSide2 = kulak + 2 * A + B;
5720
+ const xSide2Mid = kulak + 2 * A + B + B / 2;
5721
+ const xEnd = kulak + 2 * A + 2 * B - 2;
5722
+ const yFoldTop = D;
5723
+ const yFoldBottomStart = D + C - B / 2;
5724
+ const yFoldBottom = D + C;
5725
+ const yNotchStart = yFoldBottom + NOTCH_Y2;
5726
+ const yEnd = D + C + B / 2 + DIP4;
5727
+ const totalWidth = xEnd;
5728
+ const totalHeight = yEnd;
5729
+ const crease = [];
5730
+ crease.push(line8(0, yFoldTop, totalWidth, yFoldTop));
5731
+ crease.push(line8(0, yFoldBottomStart, totalWidth, yFoldBottomStart));
5732
+ crease.push(line8(kulak, yFoldBottom, xEnd, yFoldBottom));
5733
+ crease.push(line8(xFront, 0, xFront, yFoldBottom));
5734
+ crease.push(line8(xSide1, 0, xSide1, yFoldBottom));
5735
+ crease.push(line8(xBack, 0, xBack, yFoldBottom));
5736
+ crease.push(line8(xSide2, 0, xSide2, yFoldBottom));
5737
+ crease.push(line8(xSide1Mid, 0, xSide1Mid, totalHeight));
5738
+ crease.push(line8(xSide2Mid, 0, xSide2Mid, totalHeight));
5739
+ crease.push(line8(xBack, yFoldBottom, xSide1Mid, yFoldBottomStart));
5740
+ crease.push(line8(xSide1Mid, yFoldBottomStart, xSide1, yFoldBottom));
5741
+ crease.push(line8(xSide2Mid, yFoldBottomStart, xSide2, yFoldBottom));
5742
+ crease.push(line8(xSide2Mid, yFoldBottomStart, xEnd, D + C - 2));
5743
+ const sections = [];
5744
+ let colorIdx = 0;
5745
+ sections.push({
5746
+ name: "Outer Edges",
5747
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5748
+ paths: [
5749
+ line8(0, 0, totalWidth, 0),
5750
+ line8(0, 0, 0, yFoldBottom - kulak),
5751
+ line8(totalWidth, 0, totalWidth, yFoldBottom)
5752
+ ]
5753
+ });
5754
+ sections.push({
5755
+ name: "Glue Flap Diagonal",
5756
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5757
+ paths: [line8(0, yFoldBottom - kulak, kulak, yFoldBottom)]
5758
+ });
5759
+ sections.push({
5760
+ name: "V-Notch Front",
5761
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5762
+ paths: [
5763
+ line8(xFront + NOTCH_X2, yNotchStart, xFront + NOTCH_X2, totalHeight),
5764
+ line8(xFront + NOTCH_X2, yNotchStart, xFront, yFoldBottom)
5765
+ ]
5766
+ });
5767
+ sections.push({
5768
+ name: "V-Notch Side1",
5769
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5770
+ paths: [
5771
+ line8(xSide1 - NOTCH_X2, yNotchStart, xSide1 - NOTCH_X2, totalHeight),
5772
+ line8(xSide1 - NOTCH_X2, yNotchStart, xSide1, yFoldBottom),
5773
+ line8(xSide1 + NOTCH_X2, yNotchStart, xSide1 + NOTCH_X2, totalHeight),
5774
+ line8(xSide1 + NOTCH_X2, yNotchStart, xSide1, yFoldBottom)
5775
+ ]
5776
+ });
5777
+ sections.push({
5778
+ name: "V-Notch Back",
5779
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5780
+ paths: [
5781
+ line8(xBack - NOTCH_X2, yNotchStart, xBack - NOTCH_X2, totalHeight),
5782
+ line8(xBack - NOTCH_X2, yNotchStart, xBack, yFoldBottom),
5783
+ line8(xBack + NOTCH_X2, yNotchStart, xBack + NOTCH_X2, totalHeight),
5784
+ line8(xBack + NOTCH_X2, yNotchStart, xBack, yFoldBottom)
5785
+ ]
5786
+ });
5787
+ sections.push({
5788
+ name: "V-Notch Side2",
5789
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5790
+ paths: [
5791
+ line8(xSide2 - NOTCH_X2, yNotchStart, xSide2 - NOTCH_X2, totalHeight),
5792
+ line8(xSide2 - NOTCH_X2, yNotchStart, xSide2, yFoldBottom),
5793
+ line8(xSide2 + NOTCH_X2, yNotchStart, xSide2 + NOTCH_X2, totalHeight),
5794
+ line8(xSide2 + NOTCH_X2, yNotchStart, xSide2, yFoldBottom)
5795
+ ]
5796
+ });
5797
+ sections.push({
5798
+ name: "V-Notch End",
5799
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5800
+ paths: [
5801
+ line8(xEnd - NOTCH_X2, yNotchStart, xEnd - NOTCH_X2, totalHeight),
5802
+ line8(xEnd - NOTCH_X2, yNotchStart, xEnd, yFoldBottom)
5803
+ ]
5804
+ });
5805
+ sections.push({
5806
+ name: "Bottom Segments",
5807
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5808
+ paths: [
5809
+ line8(xFront + NOTCH_X2, totalHeight, xSide1 - NOTCH_X2, totalHeight),
5810
+ line8(xSide1 + NOTCH_X2, totalHeight, xBack - NOTCH_X2, totalHeight),
5811
+ line8(xBack + NOTCH_X2, totalHeight, xSide2 - NOTCH_X2, totalHeight),
5812
+ line8(xSide2 + NOTCH_X2, totalHeight, xEnd - NOTCH_X2, totalHeight)
5813
+ ]
5814
+ });
5815
+ const frontCx = kulak + A / 2;
5816
+ const backCx = kulak + A + B + A / 2;
5817
+ const yRibbonTop = yFoldTop - RIBBON_DY2 / 2;
5818
+ const yRibbonBot = yFoldTop + RIBBON_DY2 / 2;
5819
+ function ribbonNotchPaths(cx) {
5820
+ return [
5821
+ line8(cx - RIBBON_HALF_W2, yRibbonBot, cx + RIBBON_HALF_W2, yRibbonBot),
5822
+ line8(cx - RIBBON_HALF_W2 - RIBBON_DX2, yRibbonTop, cx - RIBBON_HALF_W2, yRibbonBot),
5823
+ line8(cx + RIBBON_HALF_W2 + RIBBON_DX2, yRibbonTop, cx + RIBBON_HALF_W2, yRibbonBot)
5824
+ ];
5825
+ }
5826
+ sections.push({
5827
+ name: "Front Left Ribbon",
5828
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5829
+ paths: ribbonNotchPaths(frontCx - X / 2)
5830
+ });
5831
+ sections.push({
5832
+ name: "Front Right Ribbon",
5833
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5834
+ paths: ribbonNotchPaths(frontCx + X / 2)
5835
+ });
5836
+ sections.push({
5837
+ name: "Back Left Ribbon",
5838
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5839
+ paths: ribbonNotchPaths(backCx - X / 2)
5840
+ });
5841
+ sections.push({
5842
+ name: "Back Right Ribbon",
5843
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
5844
+ paths: ribbonNotchPaths(backCx + X / 2)
5845
+ });
5846
+ return {
5847
+ sections,
5848
+ crease,
5849
+ viewBox: { width: totalWidth, height: totalHeight }
5850
+ };
5851
+ }
5011
5852
  var MODEL_ID8 = "BECF-C-12109";
5012
5853
  var UNIT_FACTOR8 = {
5013
5854
  mm: 1,
@@ -5066,7 +5907,8 @@ var DIE_LINE_BECF_C_12109 = forwardRef(
5066
5907
  attributes,
5067
5908
  unit = "mm",
5068
5909
  isShowDimensions = false,
5069
- renderAs = "svg"
5910
+ renderAs = "svg",
5911
+ debug = false
5070
5912
  }, ref) => {
5071
5913
  const theme = useMemo(
5072
5914
  () => getModelTheme(),
@@ -5078,6 +5920,10 @@ var DIE_LINE_BECF_C_12109 = forwardRef(
5078
5920
  () => generateDimensions8(attributes, unit),
5079
5921
  [attributes, unit]
5080
5922
  );
5923
+ const debugData = useMemo(
5924
+ () => debug ? generateBecfC12109DebugSections(attributes) : null,
5925
+ [attributes, debug]
5926
+ );
5081
5927
  const factor = UNIT_FACTOR8[unit] ?? 1;
5082
5928
  const serializeSvg = useCallback(
5083
5929
  (showDimensions) => {
@@ -5166,7 +6012,8 @@ var DIE_LINE_BECF_C_12109 = forwardRef(
5166
6012
  const vbY = -padding;
5167
6013
  const vbW = dieline.viewBox.width + padding * 2;
5168
6014
  const vbH = dieline.viewBox.height + padding * 2;
5169
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
6015
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
6016
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
5170
6017
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
5171
6018
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
5172
6019
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension8(d, i, getFontDimensionSize())) })
@@ -5341,6 +6188,61 @@ function generateBecfB12101(attr) {
5341
6188
  crease.push(line9(xSide2Mid, yFoldBottomStart, xEnd, C - 2));
5342
6189
  return { cut, crease, viewBox: { width: totalWidth, height: totalHeight } };
5343
6190
  }
6191
+ function generateBecfB12101DebugSections(attr) {
6192
+ const { length: A, width: B, height: C, glueArea } = attr;
6193
+ const kulak = glueArea ?? calcKulak5(B);
6194
+ const xFront = kulak;
6195
+ const xSide1 = kulak + A;
6196
+ const xSide1Mid = kulak + A + B / 2;
6197
+ const xBack = kulak + A + B;
6198
+ const xSide2 = kulak + 2 * A + B;
6199
+ const xSide2Mid = kulak + 2 * A + B + B / 2;
6200
+ const xEnd = kulak + 2 * A + 2 * B - 2;
6201
+ const yFoldBottomStart = C - B / 2;
6202
+ const yFoldBottom = C;
6203
+ const yBottomFlap = C + B / 2;
6204
+ const yEnd = C + B / 2 + DIP5;
6205
+ const totalWidth = xEnd;
6206
+ const totalHeight = yEnd;
6207
+ const crease = [];
6208
+ crease.push(line9(0, yFoldBottomStart, totalWidth, yFoldBottomStart));
6209
+ crease.push(line9(0, yFoldBottom, totalWidth, yFoldBottom));
6210
+ crease.push(line9(xFront, 0, xFront, totalHeight));
6211
+ crease.push(line9(xSide1, 0, xSide1, totalHeight));
6212
+ crease.push(line9(xSide1Mid, 0, xSide1Mid, totalHeight));
6213
+ crease.push(line9(xBack, 0, xBack, totalHeight));
6214
+ crease.push(line9(xSide2, 0, xSide2, totalHeight));
6215
+ crease.push(line9(xSide2Mid, 0, xSide2Mid, totalHeight));
6216
+ crease.push(line9(0, yFoldBottom - kulak, kulak + B / 2, yBottomFlap));
6217
+ crease.push(line9(kulak + A - B / 2, yBottomFlap, xSide1Mid, yFoldBottomStart));
6218
+ crease.push(line9(xSide1Mid, yFoldBottomStart, kulak + A + B + B / 2, yBottomFlap));
6219
+ crease.push(line9(kulak + 2 * A + B - B / 2, yBottomFlap, xSide2Mid, yFoldBottomStart));
6220
+ crease.push(line9(xSide2Mid, yFoldBottomStart, xEnd, C - 2));
6221
+ let ci = 0;
6222
+ const sections = [
6223
+ {
6224
+ name: "Outer Rect",
6225
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
6226
+ paths: [
6227
+ line9(0, 0, totalWidth, 0),
6228
+ line9(totalWidth, 0, totalWidth, totalHeight),
6229
+ line9(totalWidth, totalHeight, 0, totalHeight),
6230
+ line9(0, totalHeight, 0, 0)
6231
+ ]
6232
+ },
6233
+ {
6234
+ name: "Bottom Zone Cuts",
6235
+ color: DEBUG_PALETTE[ci++ % DEBUG_PALETTE.length],
6236
+ paths: [
6237
+ line9(kulak + B / 2, yBottomFlap, kulak + B / 2, yEnd),
6238
+ line9(kulak + A - B / 2, yBottomFlap, kulak + A - B / 2, yEnd),
6239
+ line9(kulak + A + B + B / 2, yBottomFlap, kulak + A + B + B / 2, yEnd),
6240
+ line9(kulak + 2 * A + B - B / 2, yBottomFlap, kulak + 2 * A + B - B / 2, yEnd)
6241
+ ]
6242
+ }
6243
+ ];
6244
+ return { sections, crease, viewBox: { width: totalWidth, height: totalHeight } };
6245
+ }
5344
6246
  function generateOuterContour9(attr) {
5345
6247
  const { length: A, width: B, height: C, glueArea } = attr;
5346
6248
  const kulak = glueArea ?? calcKulak5(B);
@@ -5513,10 +6415,14 @@ function renderDimension9(dim, i, fs) {
5513
6415
  ] }, `dim-${i}`);
5514
6416
  }
5515
6417
  var DIE_LINE_BECF_B_12101 = forwardRef(
5516
- ({ attributes, unit = "mm", isShowDimensions = false, renderAs = "svg" }, ref) => {
6418
+ ({ attributes, unit = "mm", isShowDimensions = false, renderAs = "svg", debug = false }, ref) => {
5517
6419
  const theme = useMemo(() => getModelTheme(), []);
5518
6420
  const svgRef = useRef(null);
5519
6421
  const dieline = useMemo(() => generateBecfB12101(attributes), [attributes]);
6422
+ const debugData = useMemo(
6423
+ () => debug ? generateBecfB12101DebugSections(attributes) : null,
6424
+ [attributes, debug]
6425
+ );
5520
6426
  const dimensions = useMemo(() => generateDimensions9(attributes, unit), [attributes, unit]);
5521
6427
  const factor = UNIT_FACTOR9[unit] ?? 1;
5522
6428
  const serializeSvg = useCallback((showDimensions) => {
@@ -5580,7 +6486,8 @@ var DIE_LINE_BECF_B_12101 = forwardRef(
5580
6486
  const vbY = -padding;
5581
6487
  const vbW = dieline.viewBox.width + padding * 2;
5582
6488
  const vbH = dieline.viewBox.height + padding * 2;
5583
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
6489
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
6490
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
5584
6491
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
5585
6492
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
5586
6493
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension9(d, i, getFontDimensionSize())) })
@@ -5896,6 +6803,113 @@ function generateDimensions10(attr, unit) {
5896
6803
  }
5897
6804
  ];
5898
6805
  }
6806
+ function generateBecfB12109DebugSections(attr) {
6807
+ const { length: A, width: B, height: C, glueArea } = attr;
6808
+ const kulak = glueArea ?? calcKulak6(B);
6809
+ const xFront = kulak;
6810
+ const xSide1 = kulak + A;
6811
+ const xSide1Mid = kulak + A + B / 2;
6812
+ const xBack = kulak + A + B;
6813
+ const xSide2 = kulak + 2 * A + B;
6814
+ const xSide2Mid = kulak + 2 * A + B + B / 2;
6815
+ const xEnd = kulak + 2 * A + 2 * B - 2;
6816
+ const yFoldBottomStart = C - B / 2;
6817
+ const yFoldBottom = C;
6818
+ const yNotchStart = yFoldBottom + NOTCH_Y3;
6819
+ const yEnd = C + B / 2 + DIP6;
6820
+ const totalWidth = xEnd;
6821
+ const totalHeight = yEnd;
6822
+ const crease = [];
6823
+ crease.push(line10(0, yFoldBottomStart, totalWidth, yFoldBottomStart));
6824
+ crease.push(line10(kulak, yFoldBottom, xEnd, yFoldBottom));
6825
+ crease.push(line10(xFront, 0, xFront, yFoldBottom));
6826
+ crease.push(line10(xSide1, 0, xSide1, yFoldBottom));
6827
+ crease.push(line10(xBack, 0, xBack, yFoldBottom));
6828
+ crease.push(line10(xSide2, 0, xSide2, yFoldBottom));
6829
+ crease.push(line10(xSide1Mid, 0, xSide1Mid, totalHeight));
6830
+ crease.push(line10(xSide2Mid, 0, xSide2Mid, totalHeight));
6831
+ crease.push(line10(xBack, yFoldBottom, xSide1Mid, yFoldBottomStart));
6832
+ crease.push(line10(xSide1Mid, yFoldBottomStart, xSide1, yFoldBottom));
6833
+ crease.push(line10(xSide2Mid, yFoldBottomStart, xSide2, yFoldBottom));
6834
+ crease.push(line10(xSide2Mid, yFoldBottomStart, xEnd, C - 2));
6835
+ const sections = [];
6836
+ let colorIdx = 0;
6837
+ sections.push({
6838
+ name: "Outer Edges",
6839
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6840
+ paths: [
6841
+ line10(0, 0, totalWidth, 0),
6842
+ line10(0, 0, 0, yFoldBottom - kulak),
6843
+ line10(totalWidth, 0, totalWidth, yFoldBottom)
6844
+ ]
6845
+ });
6846
+ sections.push({
6847
+ name: "Glue Flap Diagonal",
6848
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6849
+ paths: [line10(0, yFoldBottom - kulak, kulak, yFoldBottom)]
6850
+ });
6851
+ sections.push({
6852
+ name: "V-Notch Front",
6853
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6854
+ paths: [
6855
+ line10(xFront + NOTCH_X3, yNotchStart, xFront + NOTCH_X3, totalHeight),
6856
+ line10(xFront + NOTCH_X3, yNotchStart, xFront, yFoldBottom)
6857
+ ]
6858
+ });
6859
+ sections.push({
6860
+ name: "V-Notch Side1",
6861
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6862
+ paths: [
6863
+ line10(xSide1 - NOTCH_X3, yNotchStart, xSide1 - NOTCH_X3, totalHeight),
6864
+ line10(xSide1 - NOTCH_X3, yNotchStart, xSide1, yFoldBottom),
6865
+ line10(xSide1 + NOTCH_X3, yNotchStart, xSide1 + NOTCH_X3, totalHeight),
6866
+ line10(xSide1 + NOTCH_X3, yNotchStart, xSide1, yFoldBottom)
6867
+ ]
6868
+ });
6869
+ sections.push({
6870
+ name: "V-Notch Back",
6871
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6872
+ paths: [
6873
+ line10(xBack - NOTCH_X3, yNotchStart, xBack - NOTCH_X3, totalHeight),
6874
+ line10(xBack - NOTCH_X3, yNotchStart, xBack, yFoldBottom),
6875
+ line10(xBack + NOTCH_X3, yNotchStart, xBack + NOTCH_X3, totalHeight),
6876
+ line10(xBack + NOTCH_X3, yNotchStart, xBack, yFoldBottom)
6877
+ ]
6878
+ });
6879
+ sections.push({
6880
+ name: "V-Notch Side2",
6881
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6882
+ paths: [
6883
+ line10(xSide2 - NOTCH_X3, yNotchStart, xSide2 - NOTCH_X3, totalHeight),
6884
+ line10(xSide2 - NOTCH_X3, yNotchStart, xSide2, yFoldBottom),
6885
+ line10(xSide2 + NOTCH_X3, yNotchStart, xSide2 + NOTCH_X3, totalHeight),
6886
+ line10(xSide2 + NOTCH_X3, yNotchStart, xSide2, yFoldBottom)
6887
+ ]
6888
+ });
6889
+ sections.push({
6890
+ name: "V-Notch End",
6891
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6892
+ paths: [
6893
+ line10(xEnd - NOTCH_X3, yNotchStart, xEnd - NOTCH_X3, totalHeight),
6894
+ line10(xEnd - NOTCH_X3, yNotchStart, xEnd, yFoldBottom)
6895
+ ]
6896
+ });
6897
+ sections.push({
6898
+ name: "Bottom Segments",
6899
+ color: DEBUG_PALETTE[colorIdx++ % DEBUG_PALETTE.length],
6900
+ paths: [
6901
+ line10(xFront + NOTCH_X3, totalHeight, xSide1 - NOTCH_X3, totalHeight),
6902
+ line10(xSide1 + NOTCH_X3, totalHeight, xBack - NOTCH_X3, totalHeight),
6903
+ line10(xBack + NOTCH_X3, totalHeight, xSide2 - NOTCH_X3, totalHeight),
6904
+ line10(xSide2 + NOTCH_X3, totalHeight, xEnd - NOTCH_X3, totalHeight)
6905
+ ]
6906
+ });
6907
+ return {
6908
+ sections,
6909
+ crease,
6910
+ viewBox: { width: totalWidth, height: totalHeight }
6911
+ };
6912
+ }
5899
6913
  var MODEL_ID10 = "BECF-B-12109";
5900
6914
  var UNIT_FACTOR10 = {
5901
6915
  mm: 1,
@@ -5926,11 +6940,15 @@ function renderDimension10(dim, i, fs) {
5926
6940
  ] }, `dim-${i}`);
5927
6941
  }
5928
6942
  var DIE_LINE_BECF_B_12109 = forwardRef(
5929
- ({ attributes, unit = "mm", isShowDimensions = false, renderAs = "svg" }, ref) => {
6943
+ ({ attributes, unit = "mm", isShowDimensions = false, renderAs = "svg", debug = false }, ref) => {
5930
6944
  const theme = useMemo(() => getModelTheme(), []);
5931
6945
  const svgRef = useRef(null);
5932
6946
  const dieline = useMemo(() => generateBecfB12109(attributes), [attributes]);
5933
6947
  const dimensions = useMemo(() => generateDimensions10(attributes, unit), [attributes, unit]);
6948
+ const debugData = useMemo(
6949
+ () => debug ? generateBecfB12109DebugSections(attributes) : null,
6950
+ [attributes, debug]
6951
+ );
5934
6952
  const factor = UNIT_FACTOR10[unit] ?? 1;
5935
6953
  const serializeSvg = useCallback((showDimensions) => {
5936
6954
  const svg = svgRef.current;
@@ -5993,7 +7011,8 @@ var DIE_LINE_BECF_B_12109 = forwardRef(
5993
7011
  const vbY = -padding;
5994
7012
  const vbW = dieline.viewBox.width + padding * 2;
5995
7013
  const vbH = dieline.viewBox.height + padding * 2;
5996
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
7014
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
7015
+ const svgChildren = debug && debugData ? /* @__PURE__ */ jsx(DebugOverlay, { data: debugData, fontSize: debugFontSize }) : /* @__PURE__ */ jsxs(Fragment, { children: [
5997
7016
  /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
5998
7017
  /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
5999
7018
  isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension10(d, i, getFontDimensionSize())) })
@@ -6081,31 +7100,22 @@ var TAPER = Math.tan(15 * Math.PI / 180);
6081
7100
  var TAB_W = 8;
6082
7101
  var CORNER = 3;
6083
7102
  var NOTCH = 10;
6084
- function calcKulak7(b) {
6085
- if (b < 100) return 13;
6086
- if (b < 250) return 15;
6087
- if (b < 500) return 20;
6088
- return 25;
7103
+ function calcDil(a, b) {
7104
+ const step = Math.max(0, Math.floor((a + b - 250) / 50));
7105
+ return Math.min(b - 1, 15 + 2.5 * step);
6089
7106
  }
6090
- function calcDil(a, b, c) {
6091
- const base = Math.max(15, Math.min(30, (a + b + 50) / 20));
6092
- return Math.max(9, Math.min(a / 2, b - 1, c / 2, base));
7107
+ function calcFlap(b, dil) {
7108
+ return Math.min(dil / 2 + b / 2 - 0.5, b / 2);
6093
7109
  }
6094
7110
  function calcDip(b) {
6095
- if (b <= 22) return 9;
6096
- if (b <= 28) return Math.floor((b - 4) / 2);
6097
- if (b <= 77) return 12;
6098
- if (b <= 120) return Math.floor(b / 6);
6099
- if (b <= 167) return 20;
6100
- if (b <= 199) return Math.floor(b / 8);
6101
- if (b < 300) return 30;
6102
- if (b < 400) return 35;
6103
- return 40;
7111
+ if (b < 30) return Math.max(9, b * 0.3 + 3);
7112
+ return Math.max(12, Math.min(20, Math.floor(b / 6)));
6104
7113
  }
6105
7114
  function generateBecf10a0a(attr) {
6106
- const { length: A, width: B, height: C } = attr;
6107
- const kulak = calcKulak7(B);
6108
- const dil = calcDil(A, B, C);
7115
+ const { length: A, width: B, height: C, glueArea } = attr;
7116
+ const kulak = glueArea;
7117
+ const dil = calcDil(A, B);
7118
+ const flap = calcFlap(B, dil);
6109
7119
  const dip = calcDip(B);
6110
7120
  const glueTaper = kulak * TAPER;
6111
7121
  const tuckH = B / 2 + ARC_R4;
@@ -6120,9 +7130,9 @@ function generateBecf10a0a(attr) {
6120
7130
  const yTuckFlapTop = B + dil - 1 - tuckH;
6121
7131
  const yFoldTop = B + dil - 1;
6122
7132
  const yFoldBottom = yFoldTop + C;
6123
- const yFoldBottomB2 = yFoldBottom + B / 2;
6124
- const ySideBottom = yFoldBottom + A / 4 + dip + SNAP_R;
6125
- const yBottom = yFoldBottom + B / 2 + dip + SNAP_R;
7133
+ const yFoldBottomFlap = yFoldBottom + flap;
7134
+ const ySideBottom = yFoldBottom + flap + dip + SNAP_R;
7135
+ const yBottom = yFoldBottom + flap + dip + SNAP_R;
6126
7136
  const totalWidth = xEnd;
6127
7137
  const totalHeight = yBottom;
6128
7138
  const cut = [];
@@ -6161,10 +7171,10 @@ function generateBecf10a0a(attr) {
6161
7171
  cut.push(...lockTab(xBack, xSide2, yTop, yTuckTop, yLockCrease, yFoldTop));
6162
7172
  cut.push(...side1TuckFlap(xSide1, xBack, yFoldTop, yTuckFlapTop, tuckH));
6163
7173
  cut.push(...side2TuckFlap(xSide2, xEnd, yFoldTop, yTuckFlapTop, tuckH));
6164
- cut.push(...frontPanelBottom(xFront, xSide1, A, yFoldBottom, yFoldBottomB2, yBottom, dip));
6165
- cut.push(...backPanelBottom(xBack, xSide2, A, yFoldBottom, yFoldBottomB2, yBottom, ySideBottom, dip));
6166
- cut.push(...side1Bottom(xSide1, xBack, B, A, yFoldBottom, ySideBottom, dip));
6167
- cut.push(...side2Bottom(xSide2, xEnd, B, A, yFoldBottom, ySideBottom, dip));
7174
+ cut.push(...frontPanelBottom(xFront, xSide1, A, B, yFoldBottom, yFoldBottomFlap, yBottom, dip));
7175
+ cut.push(...backPanelBottom(xBack, xSide2, A, B, yFoldBottom, yFoldBottomFlap, yBottom, ySideBottom, dip));
7176
+ cut.push(...side1Bottom(xSide1, xBack, B, flap, yFoldBottom, ySideBottom, dip));
7177
+ cut.push(...side2Bottom(xSide2, xEnd, B, flap, yFoldBottom, ySideBottom, dip));
6168
7178
  return { cut, crease, viewBox: { width: totalWidth, height: totalHeight } };
6169
7179
  }
6170
7180
  function line11(x1, y1, x2, y2) {
@@ -6207,46 +7217,44 @@ function side2TuckFlap(xSide2, xEnd, yFoldTop, yTuckFlapTop, tuckH) {
6207
7217
  const rightPath = `M${rightTargetX} ${yTuckFlapTop} L${xEnd - CORNER} ${yFoldTop - TAB_W - CORNER} L${xEnd} ${yFoldTop - TAB_W} L${xEnd} ${yFoldTop}`;
6208
7218
  return [leftTop, rightPath];
6209
7219
  }
6210
- function frontPanelBottom(xFront, xSide1, A, yFoldBottom, yFoldBottomB2, yBottom, dip) {
7220
+ function frontPanelBottom(xFront, xSide1, _A, B, yFoldBottom, yFoldBottomFlap, yBottom, dip) {
6211
7221
  const paths = [];
6212
7222
  paths.push(line11(xFront, yFoldBottom, xFront, yBottom));
6213
7223
  paths.push(line11(xSide1, yBottom, xSide1, yFoldBottom));
6214
- const notchHalfTop = A / 4 + MT5;
6215
7224
  const notchTaperH = (dip + SNAP_R) * TAPER;
6216
- const center = xFront + A / 2;
6217
- const nlt = center - notchHalfTop;
6218
- const nrt = center + notchHalfTop;
7225
+ const nlt = xFront + B / 2;
7226
+ const nrt = xSide1 - B / 2;
6219
7227
  const nlb = nlt + notchTaperH;
6220
7228
  const nrb = nrt - notchTaperH;
6221
7229
  paths.push(line11(xFront, yBottom, nlb, yBottom));
6222
- paths.push(line11(nlb, yBottom, nlt, yFoldBottomB2));
6223
- paths.push(line11(nlt, yFoldBottomB2, nrt, yFoldBottomB2));
6224
- paths.push(line11(nrt, yFoldBottomB2, nrb, yBottom));
7230
+ paths.push(line11(nlb, yBottom, nlt, yFoldBottomFlap));
7231
+ paths.push(line11(nlt, yFoldBottomFlap, nrt, yFoldBottomFlap));
7232
+ paths.push(line11(nrt, yFoldBottomFlap, nrb, yBottom));
6225
7233
  paths.push(line11(nrb, yBottom, xSide1, yBottom));
6226
7234
  return paths;
6227
7235
  }
6228
- function backPanelBottom(xBack, xSide2, A, yFoldBottom, yFoldBottomB2, yBottom, ySideBottom, dip) {
7236
+ function backPanelBottom(xBack, xSide2, _A, B, yFoldBottom, yFoldBottomFlap, yBottom, ySideBottom, dip) {
6229
7237
  const paths = [];
6230
- const diagH = A / 4;
7238
+ const diagH = B / 2;
6231
7239
  paths.push(line11(xBack, yFoldBottom, xBack, ySideBottom));
6232
7240
  paths.push(line11(xSide2, ySideBottom, xSide2, yFoldBottom));
6233
- paths.push(line11(xBack, yFoldBottom, xBack + diagH, yFoldBottomB2));
6234
- paths.push(line11(xSide2, yFoldBottom, xSide2 - diagH, yFoldBottomB2));
6235
- paths.push(line11(xBack + diagH, yFoldBottomB2, xBack + diagH, yFoldBottomB2 + dip));
6236
- paths.push(line11(xSide2 - diagH, yFoldBottomB2 + dip, xSide2 - diagH, yFoldBottomB2));
7241
+ paths.push(line11(xBack, yFoldBottom, xBack + diagH, yFoldBottomFlap));
7242
+ paths.push(line11(xSide2, yFoldBottom, xSide2 - diagH, yFoldBottomFlap));
7243
+ paths.push(line11(xBack + diagH, yFoldBottomFlap, xBack + diagH, yFoldBottomFlap + dip));
7244
+ paths.push(line11(xSide2 - diagH, yFoldBottomFlap + dip, xSide2 - diagH, yFoldBottomFlap));
6237
7245
  paths.push(
6238
- `M${xBack + diagH} ${yFoldBottomB2 + dip} A${SNAP_R} ${SNAP_R} 0 0 0 ${xBack + diagH + SNAP_R} ${yBottom}`
7246
+ `M${xBack + diagH} ${yFoldBottomFlap + dip} A${SNAP_R} ${SNAP_R} 0 0 0 ${xBack + diagH + SNAP_R} ${yBottom}`
6239
7247
  );
6240
7248
  paths.push(
6241
- `M${xSide2 - diagH - SNAP_R} ${yBottom} A${SNAP_R} ${SNAP_R} 0 0 0 ${xSide2 - diagH} ${yFoldBottomB2 + dip}`
7249
+ `M${xSide2 - diagH - SNAP_R} ${yBottom} A${SNAP_R} ${SNAP_R} 0 0 0 ${xSide2 - diagH} ${yFoldBottomFlap + dip}`
6242
7250
  );
6243
7251
  paths.push(line11(xBack + diagH + SNAP_R, yBottom, xSide2 - diagH - SNAP_R, yBottom));
6244
7252
  return paths;
6245
7253
  }
6246
- function side1Bottom(xSide1, xBack, B, A, yFoldBottom, ySideBottom, dip) {
7254
+ function side1Bottom(xSide1, xBack, B, flap, yFoldBottom, ySideBottom, dip) {
6247
7255
  const paths = [];
6248
7256
  const diagEndX = xSide1 + B / 2;
6249
- const diagEndY = yFoldBottom + A / 4;
7257
+ const diagEndY = yFoldBottom + flap;
6250
7258
  const taperV = dip + SNAP_R;
6251
7259
  const taperH = taperV * TAPER;
6252
7260
  paths.push(line11(xSide1, yFoldBottom, diagEndX, diagEndY));
@@ -6254,10 +7262,10 @@ function side1Bottom(xSide1, xBack, B, A, yFoldBottom, ySideBottom, dip) {
6254
7262
  paths.push(line11(diagEndX - taperH, ySideBottom, xBack, ySideBottom));
6255
7263
  return paths;
6256
7264
  }
6257
- function side2Bottom(xSide2, xEnd, B, A, yFoldBottom, ySideBottom, dip) {
7265
+ function side2Bottom(xSide2, xEnd, B, flap, yFoldBottom, ySideBottom, dip) {
6258
7266
  const paths = [];
6259
7267
  const diagEndX = xSide2 + B / 2;
6260
- const diagEndY = yFoldBottom + A / 4;
7268
+ const diagEndY = yFoldBottom + flap;
6261
7269
  const taperV = dip + SNAP_R;
6262
7270
  const taperH = taperV * TAPER;
6263
7271
  paths.push(line11(xEnd, yFoldBottom, diagEndX, diagEndY));
@@ -6266,23 +7274,29 @@ function side2Bottom(xSide2, xEnd, B, A, yFoldBottom, ySideBottom, dip) {
6266
7274
  return paths;
6267
7275
  }
6268
7276
  function generateDimensions11(attr, unit) {
6269
- const { length: A, width: B, height: C } = attr;
6270
- const kulak = calcKulak7(B);
6271
- const dil = calcDil(A, B, C);
7277
+ const { length: A, width: B, height: C, glueArea } = attr;
7278
+ const kulak = glueArea;
7279
+ const dil = calcDil(A, B);
7280
+ const flap = calcFlap(B, dil);
6272
7281
  const dip = calcDip(B);
6273
7282
  const xFront = kulak;
6274
7283
  const xSide1 = kulak + A;
7284
+ const xBack = kulak + A + B;
6275
7285
  const xSide2 = kulak + 2 * A + B;
6276
7286
  const xEnd = kulak + 2 * A + 2 * B - 0.5;
7287
+ const yTop = 0;
7288
+ const yTuckTop = dil - 1;
6277
7289
  const yFoldTop = B + dil - 1;
6278
7290
  const yFoldBottom = yFoldTop + C;
6279
- const yBottom = yFoldBottom + B / 2 + dip + SNAP_R;
7291
+ const yBottom = yFoldBottom + flap + dip + SNAP_R;
6280
7292
  const totalWidth = xEnd;
6281
7293
  const totalHeight = yBottom;
6282
7294
  const factor = unit === "cm" ? 0.1 : unit === "in" ? 1 / 25.4 : 1;
6283
7295
  const suffix = unit;
6284
7296
  const fmt = (v) => `${(v * factor).toFixed(2)} ${suffix}`;
7297
+ const backMidX = (xBack + xSide2) / 2;
6285
7298
  return [
7299
+ // Overall dimensions
6286
7300
  {
6287
7301
  x1: 0,
6288
7302
  y1: 0,
@@ -6301,15 +7315,17 @@ function generateDimensions11(attr, unit) {
6301
7315
  orientation: "horizontal",
6302
7316
  offset: -12
6303
7317
  },
7318
+ // Glue Area (horizontal, same row as A/B at yFoldBottom)
6304
7319
  {
6305
- x1: xSide2,
6306
- y1: yFoldTop,
6307
- x2: xSide2,
7320
+ x1: 0,
7321
+ y1: yFoldBottom,
7322
+ x2: xFront,
6308
7323
  y2: yFoldBottom,
6309
- label: fmt(C),
6310
- orientation: "vertical",
6311
- offset: -14
7324
+ label: fmt(kulak),
7325
+ orientation: "horizontal",
7326
+ offset: -20
6312
7327
  },
7328
+ // A (length)
6313
7329
  {
6314
7330
  x1: xFront,
6315
7331
  y1: yFoldBottom,
@@ -6319,6 +7335,7 @@ function generateDimensions11(attr, unit) {
6319
7335
  orientation: "horizontal",
6320
7336
  offset: -20
6321
7337
  },
7338
+ // B (width)
6322
7339
  {
6323
7340
  x1: xSide1,
6324
7341
  y1: yFoldBottom,
@@ -6327,9 +7344,233 @@ function generateDimensions11(attr, unit) {
6327
7344
  label: fmt(B),
6328
7345
  orientation: "horizontal",
6329
7346
  offset: -20
7347
+ },
7348
+ // Lock Tab height (yTop → yTuckTop)
7349
+ {
7350
+ x1: backMidX,
7351
+ y1: yTop,
7352
+ x2: backMidX,
7353
+ y2: yTuckTop,
7354
+ label: fmt(yTuckTop - yTop),
7355
+ orientation: "vertical",
7356
+ offset: 0
7357
+ },
7358
+ // B / width (yTuckTop → yFoldTop, shows B - 1.5)
7359
+ {
7360
+ x1: backMidX,
7361
+ y1: yTuckTop,
7362
+ x2: backMidX,
7363
+ y2: yFoldTop,
7364
+ label: fmt(B - 1.5),
7365
+ orientation: "vertical",
7366
+ offset: 0
7367
+ },
7368
+ // C / height (yFoldTop → yFoldBottom)
7369
+ {
7370
+ x1: backMidX,
7371
+ y1: yFoldTop,
7372
+ x2: backMidX,
7373
+ y2: yFoldBottom,
7374
+ label: fmt(C),
7375
+ orientation: "vertical",
7376
+ offset: 0
7377
+ },
7378
+ // Back Bottom / Snap Lock (yFoldBottom → yBottom, shows B - 1.5)
7379
+ {
7380
+ x1: backMidX,
7381
+ y1: yFoldBottom,
7382
+ x2: backMidX,
7383
+ y2: yBottom,
7384
+ label: fmt(B - 1.5),
7385
+ orientation: "vertical",
7386
+ offset: 0
6330
7387
  }
6331
7388
  ];
6332
7389
  }
7390
+ function generateBecf10a0aDebug(attr) {
7391
+ const { length: A, width: B, height: C, glueArea } = attr;
7392
+ const kulak = glueArea;
7393
+ const dil = calcDil(A, B);
7394
+ const flap = calcFlap(B, dil);
7395
+ const dip = calcDip(B);
7396
+ const glueTaper = kulak * TAPER;
7397
+ const tuckH = B / 2 + ARC_R4;
7398
+ const xFront = kulak;
7399
+ const xSide1 = kulak + A;
7400
+ const xBack = kulak + A + B;
7401
+ const xSide2 = kulak + 2 * A + B;
7402
+ const xEnd = kulak + 2 * A + 2 * B - 0.5;
7403
+ const yTop = 0;
7404
+ const yTuckTop = dil - 1;
7405
+ const yLockCrease = dil;
7406
+ const yTuckFlapTop = B + dil - 1 - tuckH;
7407
+ const yFoldTop = B + dil - 1;
7408
+ const yFoldBottom = yFoldTop + C;
7409
+ const yFoldBottomFlap = yFoldBottom + flap;
7410
+ const ySideBottom = yFoldBottom + flap + dip + SNAP_R;
7411
+ const yBottom = yFoldBottom + flap + dip + SNAP_R;
7412
+ const totalWidth = xEnd;
7413
+ const totalHeight = yBottom;
7414
+ const crease = [];
7415
+ crease.push(
7416
+ line11(xFront, yFoldTop, xFront, yFoldBottom),
7417
+ line11(xSide1, yFoldTop, xSide1, yFoldBottom),
7418
+ line11(xBack, yFoldTop, xBack, yFoldBottom),
7419
+ line11(xSide2, yFoldTop, xSide2, yFoldBottom)
7420
+ );
7421
+ crease.push(
7422
+ line11(xFront, yFoldBottom, xSide1, yFoldBottom),
7423
+ line11(xSide1, yFoldBottom, xBack, yFoldBottom),
7424
+ line11(xBack, yFoldBottom, xSide2, yFoldBottom),
7425
+ line11(xSide2, yFoldBottom, xEnd, yFoldBottom)
7426
+ );
7427
+ crease.push(
7428
+ line11(xBack, yFoldTop, xSide1 + MT5, yFoldTop),
7429
+ line11(xBack, yFoldTop - MT5, xSide2, yFoldTop - MT5),
7430
+ line11(xSide2, yFoldTop, xEnd, yFoldTop)
7431
+ );
7432
+ crease.push(line11(xBack + NOTCH, yLockCrease, xSide2 - NOTCH, yLockCrease));
7433
+ const pt = (id, x, y, color) => ({ id, x, y, color });
7434
+ const groups = [];
7435
+ const notchTaperH = (dip + SNAP_R) * TAPER;
7436
+ const nlt = xFront + B / 2;
7437
+ const nrt = xSide1 - B / 2;
7438
+ const nlb = nlt + notchTaperH;
7439
+ const nrb = nrt - notchTaperH;
7440
+ const diagH = B / 2;
7441
+ const s1DiagEndX = xSide1 + B / 2;
7442
+ const s2DiagEndX = xSide2 + B / 2;
7443
+ const taperV = dip + SNAP_R;
7444
+ const sideTaperH = taperV * TAPER;
7445
+ groups.push({
7446
+ name: "Glue Flap",
7447
+ color: "#e74c3c",
7448
+ paths: [
7449
+ `M${xFront} ${yFoldBottom} L${0} ${yFoldBottom - glueTaper} L${0} ${yFoldTop + glueTaper} L${xFront} ${yFoldTop}`
7450
+ ],
7451
+ points: [],
7452
+ labelX: kulak / 2,
7453
+ labelY: (yFoldTop + yFoldBottom) / 2
7454
+ });
7455
+ groups.push({
7456
+ name: "Front Panel",
7457
+ color: "#3498db",
7458
+ paths: [
7459
+ line11(xSide1, yFoldTop, xFront, yFoldTop),
7460
+ line11(xSide1, yFoldTop, xSide1 + MT5, yFoldTop)
7461
+ ],
7462
+ points: [],
7463
+ labelX: (xFront + xSide1) / 2,
7464
+ labelY: (yFoldTop + yFoldBottom) / 2
7465
+ });
7466
+ groups.push({
7467
+ name: "Side1 Tuck Flap",
7468
+ color: "#2ecc71",
7469
+ paths: side1TuckFlap(xSide1, xBack, yFoldTop, yTuckFlapTop, tuckH),
7470
+ points: [],
7471
+ labelX: (xSide1 + xBack) / 2,
7472
+ labelY: (yTuckFlapTop + yFoldTop) / 2
7473
+ });
7474
+ groups.push({
7475
+ name: "Lock Tab",
7476
+ color: "#9b59b6",
7477
+ paths: lockTab(xBack, xSide2, yTop, yTuckTop, yLockCrease, yFoldTop),
7478
+ points: [],
7479
+ labelX: (xBack + xSide2) / 2,
7480
+ labelY: (yTop + yFoldTop) / 2
7481
+ });
7482
+ groups.push({
7483
+ name: "Back Panel",
7484
+ color: "#f39c12",
7485
+ paths: [],
7486
+ points: [],
7487
+ labelX: (xBack + xSide2) / 2,
7488
+ labelY: (yFoldTop + yFoldBottom) / 2
7489
+ });
7490
+ groups.push({
7491
+ name: "Side2 Tuck Flap",
7492
+ color: "#1abc9c",
7493
+ paths: side2TuckFlap(xSide2, xEnd, yFoldTop, yTuckFlapTop, tuckH),
7494
+ points: [],
7495
+ labelX: (xSide2 + xEnd) / 2,
7496
+ labelY: (yTuckFlapTop + yFoldTop) / 2
7497
+ });
7498
+ groups.push({
7499
+ name: "Side2 Panel",
7500
+ color: "#e67e22",
7501
+ paths: [line11(xEnd, yFoldTop, xEnd, yFoldBottom)],
7502
+ points: [],
7503
+ labelX: (xSide2 + xEnd) / 2,
7504
+ labelY: (yFoldTop + yFoldBottom) / 2
7505
+ });
7506
+ const cF = "#e74c3c";
7507
+ groups.push({
7508
+ name: "Front Bottom",
7509
+ color: cF,
7510
+ paths: frontPanelBottom(xFront, xSide1, A, B, yFoldBottom, yFoldBottomFlap, yBottom, dip),
7511
+ points: [
7512
+ pt("F1", xFront, yFoldBottom, cF),
7513
+ pt("F2", xFront, yBottom, cF),
7514
+ pt("F3", nlb, yBottom, cF),
7515
+ pt("F4", nlt, yFoldBottomFlap, cF),
7516
+ pt("F5", nrt, yFoldBottomFlap, cF),
7517
+ pt("F6", nrb, yBottom, cF),
7518
+ pt("F7", xSide1, yBottom, cF),
7519
+ pt("F8", xSide1, yFoldBottom, cF)
7520
+ ],
7521
+ labelX: (xFront + xSide1) / 2,
7522
+ labelY: (yFoldBottom + yBottom) / 2
7523
+ });
7524
+ const cS1 = "#2ecc71";
7525
+ groups.push({
7526
+ name: "Side1 Bottom",
7527
+ color: cS1,
7528
+ paths: side1Bottom(xSide1, xBack, B, flap, yFoldBottom, ySideBottom, dip),
7529
+ points: [
7530
+ pt("S1-1", xSide1, yFoldBottom, cS1),
7531
+ pt("S1-2", s1DiagEndX, yFoldBottom + flap, cS1),
7532
+ pt("S1-3", s1DiagEndX - sideTaperH, ySideBottom, cS1),
7533
+ pt("S1-4", xBack, ySideBottom, cS1)
7534
+ ],
7535
+ labelX: (xSide1 + xBack) / 2,
7536
+ labelY: (yFoldBottom + ySideBottom) / 2
7537
+ });
7538
+ const cB = "#9b59b6";
7539
+ groups.push({
7540
+ name: "Back Bottom\n(Snap Lock)",
7541
+ color: cB,
7542
+ paths: backPanelBottom(xBack, xSide2, A, B, yFoldBottom, yFoldBottomFlap, yBottom, ySideBottom, dip),
7543
+ points: [
7544
+ pt("B1", xBack, yFoldBottom, cB),
7545
+ pt("B2", xBack, ySideBottom, cB),
7546
+ pt("B3", xBack + diagH, yFoldBottomFlap, cB),
7547
+ pt("B4", xBack + diagH, yFoldBottomFlap + dip, cB),
7548
+ pt("B5", xBack + diagH + SNAP_R, yBottom, cB),
7549
+ pt("B6", xSide2 - diagH - SNAP_R, yBottom, cB),
7550
+ pt("B7", xSide2 - diagH, yFoldBottomFlap + dip, cB),
7551
+ pt("B8", xSide2 - diagH, yFoldBottomFlap, cB),
7552
+ pt("B9", xSide2, ySideBottom, cB),
7553
+ pt("B10", xSide2, yFoldBottom, cB)
7554
+ ],
7555
+ labelX: (xBack + xSide2) / 2,
7556
+ labelY: (yFoldBottom + yBottom) / 2
7557
+ });
7558
+ const cS2 = "#1abc9c";
7559
+ groups.push({
7560
+ name: "Side2 Bottom",
7561
+ color: cS2,
7562
+ paths: side2Bottom(xSide2, xEnd, B, flap, yFoldBottom, ySideBottom, dip),
7563
+ points: [
7564
+ pt("S2-1", xEnd, yFoldBottom, cS2),
7565
+ pt("S2-2", s2DiagEndX, yFoldBottom + flap, cS2),
7566
+ pt("S2-3", s2DiagEndX + sideTaperH, ySideBottom, cS2),
7567
+ pt("S2-4", xSide2, ySideBottom, cS2)
7568
+ ],
7569
+ labelX: (xSide2 + xEnd) / 2,
7570
+ labelY: (yFoldBottom + ySideBottom) / 2
7571
+ });
7572
+ return { groups, crease, viewBox: { width: totalWidth, height: totalHeight } };
7573
+ }
6333
7574
  var MODEL_ID11 = "BECF-10A0A";
6334
7575
  var UNIT_FACTOR11 = {
6335
7576
  mm: 1,
@@ -6345,8 +7586,28 @@ function renderDimension11(dim, i, fs) {
6345
7586
  const midX = (x1 + x2) / 2;
6346
7587
  return /* @__PURE__ */ jsxs("g", { children: [
6347
7588
  /* @__PURE__ */ jsx("line", { x1, y1: y, x2, y2: y, stroke: "#000", strokeWidth: 0.2 }),
6348
- /* @__PURE__ */ jsx("line", { x1, y1: y - tick, x2: x1, y2: y + tick, stroke: "#000", strokeWidth: 0.3 }),
6349
- /* @__PURE__ */ jsx("line", { x1: x2, y1: y - tick, x2, y2: y + tick, stroke: "#000", strokeWidth: 0.3 }),
7589
+ /* @__PURE__ */ jsx(
7590
+ "line",
7591
+ {
7592
+ x1,
7593
+ y1: y - tick,
7594
+ x2: x1,
7595
+ y2: y + tick,
7596
+ stroke: "#000",
7597
+ strokeWidth: 0.3
7598
+ }
7599
+ ),
7600
+ /* @__PURE__ */ jsx(
7601
+ "line",
7602
+ {
7603
+ x1: x2,
7604
+ y1: y - tick,
7605
+ x2,
7606
+ y2: y + tick,
7607
+ stroke: "#000",
7608
+ strokeWidth: 0.3
7609
+ }
7610
+ ),
6350
7611
  /* @__PURE__ */ jsx(
6351
7612
  "text",
6352
7613
  {
@@ -6365,8 +7626,28 @@ function renderDimension11(dim, i, fs) {
6365
7626
  const midY = (y1 + y2) / 2;
6366
7627
  return /* @__PURE__ */ jsxs("g", { children: [
6367
7628
  /* @__PURE__ */ jsx("line", { x1: x, y1, x2: x, y2, stroke: "#000", strokeWidth: 0.2 }),
6368
- /* @__PURE__ */ jsx("line", { x1: x - tick, y1, x2: x + tick, y2: y1, stroke: "#000", strokeWidth: 0.3 }),
6369
- /* @__PURE__ */ jsx("line", { x1: x - tick, y1: y2, x2: x + tick, y2, stroke: "#000", strokeWidth: 0.3 }),
7629
+ /* @__PURE__ */ jsx(
7630
+ "line",
7631
+ {
7632
+ x1: x - tick,
7633
+ y1,
7634
+ x2: x + tick,
7635
+ y2: y1,
7636
+ stroke: "#000",
7637
+ strokeWidth: 0.3
7638
+ }
7639
+ ),
7640
+ /* @__PURE__ */ jsx(
7641
+ "line",
7642
+ {
7643
+ x1: x - tick,
7644
+ y1: y2,
7645
+ x2: x + tick,
7646
+ y2,
7647
+ stroke: "#000",
7648
+ strokeWidth: 0.3
7649
+ }
7650
+ ),
6370
7651
  /* @__PURE__ */ jsx(
6371
7652
  "text",
6372
7653
  {
@@ -6384,114 +7665,180 @@ function renderDimension11(dim, i, fs) {
6384
7665
  ] }, `dim-${i}`);
6385
7666
  }
6386
7667
  var DIE_LINE_BECF_10A0A = forwardRef(
6387
- ({
6388
- attributes,
6389
- unit = "mm",
6390
- isShowDimensions = false,
6391
- renderAs = "svg"
6392
- }, ref) => {
6393
- const theme = useMemo(
6394
- () => getModelTheme(),
6395
- []
6396
- );
7668
+ ({ attributes, unit = "mm", isShowDimensions = false, renderAs = "svg", debug = false }, ref) => {
7669
+ const theme = useMemo(() => getModelTheme(), []);
6397
7670
  const svgRef = useRef(null);
6398
7671
  const dieline = useMemo(() => generateBecf10a0a(attributes), [attributes]);
7672
+ const debugDieline = useMemo(
7673
+ () => debug ? generateBecf10a0aDebug(attributes) : null,
7674
+ [attributes, debug]
7675
+ );
6399
7676
  const dimensions = useMemo(
6400
7677
  () => generateDimensions11(attributes, unit),
6401
7678
  [attributes, unit]
6402
7679
  );
6403
7680
  const factor = UNIT_FACTOR11[unit] ?? 1;
6404
- const serializeSvg = useCallback(
6405
- (showDimensions) => {
6406
- const svg = svgRef.current;
6407
- if (!svg) throw new Error("SVG not mounted");
6408
- const clone = svg.cloneNode(true);
6409
- if (!showDimensions) {
6410
- const dimGroup = clone.querySelector("#dimensions");
6411
- dimGroup?.remove();
6412
- }
6413
- return new XMLSerializer().serializeToString(clone);
6414
- },
6415
- []
6416
- );
6417
- useImperativeHandle(
6418
- ref,
6419
- () => {
6420
- const { length: A, width: B, height: C } = attributes;
6421
- const kulak = calcKulak7(B);
6422
- const dil = calcDil(A, B, C);
6423
- const dip = calcDip(B);
6424
- const flap = Math.min(A / 2, B / 2 + dil / 2 - 0.5);
6425
- return {
6426
- getAttributes: () => ({
6427
- modelId: MODEL_ID11,
6428
- overallWidth: dieline.viewBox.width * factor,
6429
- overallHeight: dieline.viewBox.height * factor,
6430
- length: A * factor,
6431
- width: B * factor,
6432
- height: C * factor,
6433
- kulak: kulak * factor,
6434
- dil: dil * factor,
6435
- flap: flap * factor,
6436
- dip: dip * factor
6437
- }),
6438
- exportImage: async (options) => {
6439
- const svgStr = serializeSvg(options.isShowDimension);
6440
- const blob = new Blob([svgStr], {
6441
- type: "image/svg+xml;charset=utf-8"
6442
- });
6443
- const url = URL.createObjectURL(blob);
6444
- const img = new Image();
6445
- await new Promise((resolve, reject) => {
6446
- img.onload = () => resolve();
6447
- img.onerror = reject;
6448
- img.src = url;
6449
- });
6450
- const canvas = document.createElement("canvas");
6451
- if (options.originalSize) {
6452
- canvas.width = Math.round(dieline.viewBox.width * PX_PER_MM11);
6453
- canvas.height = Math.round(dieline.viewBox.height * PX_PER_MM11);
6454
- } else {
6455
- canvas.width = 1920;
6456
- canvas.height = 1080;
6457
- }
6458
- const ctx = canvas.getContext("2d");
6459
- ctx.fillStyle = "#ffffff";
6460
- ctx.fillRect(0, 0, canvas.width, canvas.height);
6461
- ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
6462
- URL.revokeObjectURL(url);
6463
- return new Promise((resolve, reject) => {
6464
- canvas.toBlob(
6465
- (b) => b ? resolve(b) : reject(new Error("Export failed")),
6466
- "image/png"
6467
- );
6468
- });
6469
- },
6470
- exportDimension: async () => {
6471
- const dimData = generateDimensions11(attributes, unit);
6472
- return exportDimensionPdf({
6473
- modelId: MODEL_ID11,
6474
- dieline,
6475
- dimensions: dimData,
6476
- attributes,
6477
- unit,
6478
- factor,
6479
- theme
6480
- });
7681
+ const serializeSvg = useCallback((showDimensions) => {
7682
+ const svg = svgRef.current;
7683
+ if (!svg) throw new Error("SVG not mounted");
7684
+ const clone = svg.cloneNode(true);
7685
+ if (!showDimensions) {
7686
+ const dimGroup = clone.querySelector("#dimensions");
7687
+ dimGroup?.remove();
7688
+ }
7689
+ return new XMLSerializer().serializeToString(clone);
7690
+ }, []);
7691
+ useImperativeHandle(ref, () => {
7692
+ const { length: A, width: B, height: C, glueArea } = attributes;
7693
+ const kulak = glueArea;
7694
+ const dil = calcDil(A, B);
7695
+ const flap = calcFlap(B, dil);
7696
+ const dip = calcDip(B);
7697
+ return {
7698
+ getAttributes: () => ({
7699
+ modelId: MODEL_ID11,
7700
+ overallWidth: dieline.viewBox.width * factor,
7701
+ overallHeight: dieline.viewBox.height * factor,
7702
+ length: A * factor,
7703
+ width: B * factor,
7704
+ height: C * factor,
7705
+ glueArea: glueArea * factor,
7706
+ kulak: kulak * factor,
7707
+ dil: dil * factor,
7708
+ flap: flap * factor,
7709
+ dip: dip * factor
7710
+ }),
7711
+ exportImage: async (options) => {
7712
+ const svgStr = serializeSvg(options.isShowDimension);
7713
+ const blob = new Blob([svgStr], {
7714
+ type: "image/svg+xml;charset=utf-8"
7715
+ });
7716
+ const url = URL.createObjectURL(blob);
7717
+ const img = new Image();
7718
+ await new Promise((resolve, reject) => {
7719
+ img.onload = () => resolve();
7720
+ img.onerror = reject;
7721
+ img.src = url;
7722
+ });
7723
+ const canvas = document.createElement("canvas");
7724
+ if (options.originalSize) {
7725
+ canvas.width = Math.round(dieline.viewBox.width * PX_PER_MM11);
7726
+ canvas.height = Math.round(dieline.viewBox.height * PX_PER_MM11);
7727
+ } else {
7728
+ canvas.width = 1920;
7729
+ canvas.height = 1080;
6481
7730
  }
6482
- };
6483
- },
6484
- [attributes, dieline, factor, unit, serializeSvg, theme]
6485
- );
7731
+ const ctx = canvas.getContext("2d");
7732
+ ctx.fillStyle = "#ffffff";
7733
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
7734
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
7735
+ URL.revokeObjectURL(url);
7736
+ return new Promise((resolve, reject) => {
7737
+ canvas.toBlob(
7738
+ (b) => b ? resolve(b) : reject(new Error("Export failed")),
7739
+ "image/png"
7740
+ );
7741
+ });
7742
+ },
7743
+ exportDimension: async () => {
7744
+ const dimData = generateDimensions11(attributes, unit);
7745
+ return exportDimensionPdf({
7746
+ modelId: MODEL_ID11,
7747
+ dieline,
7748
+ dimensions: dimData,
7749
+ attributes,
7750
+ unit,
7751
+ factor,
7752
+ theme
7753
+ });
7754
+ }
7755
+ };
7756
+ }, [attributes, dieline, factor, unit, serializeSvg, theme]);
6486
7757
  const padding = isShowDimensions ? 15 : 0;
6487
7758
  const vbX = -padding;
6488
7759
  const vbY = -padding;
6489
7760
  const vbW = dieline.viewBox.width + padding * 2;
6490
7761
  const vbH = dieline.viewBox.height + padding * 2;
6491
- const svgChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
6492
- /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorFoldLine, strokeWidth: 0.5, strokeDasharray: "2,1" }, `c-${i}`)) }),
6493
- /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx("path", { d, fill: "none", stroke: theme.colorDieLine, strokeWidth: 0.5 }, `t-${i}`)) }),
6494
- isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map((d, i) => renderDimension11(d, i, getFontDimensionSize())) })
7762
+ const debugFontSize = Math.max(3, dieline.viewBox.width / 80);
7763
+ const svgChildren = debug && debugDieline ? /* @__PURE__ */ jsxs(Fragment, { children: [
7764
+ /* @__PURE__ */ jsx("g", { id: "crease", children: debugDieline.crease.map((d, i) => /* @__PURE__ */ jsx(
7765
+ "path",
7766
+ {
7767
+ d,
7768
+ fill: "none",
7769
+ stroke: "#999",
7770
+ strokeWidth: 0.3,
7771
+ strokeDasharray: "2,1"
7772
+ },
7773
+ `c-${i}`
7774
+ )) }),
7775
+ debugDieline.groups.map((group, gi) => /* @__PURE__ */ jsxs("g", { id: `debug-${group.name}`, children: [
7776
+ group.paths.map((d, pi) => /* @__PURE__ */ jsx(
7777
+ "path",
7778
+ {
7779
+ d,
7780
+ fill: "none",
7781
+ stroke: group.color,
7782
+ strokeWidth: 1
7783
+ },
7784
+ `dp-${gi}-${pi}`
7785
+ )),
7786
+ group.name.split("\n").map((ln, li) => /* @__PURE__ */ jsx(
7787
+ "text",
7788
+ {
7789
+ x: group.labelX,
7790
+ y: group.labelY + li * (debugFontSize + 1),
7791
+ textAnchor: "middle",
7792
+ dominantBaseline: "central",
7793
+ fontSize: debugFontSize,
7794
+ fontFamily: "sans-serif",
7795
+ fontWeight: "bold",
7796
+ fill: group.color,
7797
+ children: ln
7798
+ },
7799
+ `label-${gi}-${li}`
7800
+ )),
7801
+ group.points.map((p) => /* @__PURE__ */ jsxs("g", { children: [
7802
+ /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: 1.2, fill: p.color }),
7803
+ /* @__PURE__ */ jsx(
7804
+ "text",
7805
+ {
7806
+ x: p.x + 2,
7807
+ y: p.y - 1.5,
7808
+ fontSize: debugFontSize * 0.7,
7809
+ fontFamily: "monospace",
7810
+ fontWeight: "bold",
7811
+ fill: p.color,
7812
+ children: p.id
7813
+ }
7814
+ )
7815
+ ] }, `pt-${p.id}`))
7816
+ ] }, `debug-${gi}`))
7817
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
7818
+ /* @__PURE__ */ jsx("g", { id: "crease", children: dieline.crease.map((d, i) => /* @__PURE__ */ jsx(
7819
+ "path",
7820
+ {
7821
+ d,
7822
+ fill: "none",
7823
+ stroke: theme.colorFoldLine,
7824
+ strokeWidth: 0.5,
7825
+ strokeDasharray: "2,1"
7826
+ },
7827
+ `c-${i}`
7828
+ )) }),
7829
+ /* @__PURE__ */ jsx("g", { id: "cut", children: dieline.cut.map((d, i) => /* @__PURE__ */ jsx(
7830
+ "path",
7831
+ {
7832
+ d,
7833
+ fill: "none",
7834
+ stroke: theme.colorDieLine,
7835
+ strokeWidth: 0.5
7836
+ },
7837
+ `t-${i}`
7838
+ )) }),
7839
+ isShowDimensions && /* @__PURE__ */ jsx("g", { id: "dimensions", children: dimensions.map(
7840
+ (d, i) => renderDimension11(d, i, getFontDimensionSize())
7841
+ ) })
6495
7842
  ] });
6496
7843
  if (renderAs === "group") {
6497
7844
  return /* @__PURE__ */ jsx("g", { children: svgChildren });
@@ -6509,41 +7856,41 @@ var DIE_LINE_BECF_10A0A = forwardRef(
6509
7856
  );
6510
7857
  }
6511
7858
  );
6512
- var CANVAS_BECF_10A0A = forwardRef(
6513
- (props, ref) => {
6514
- const dieLineRef = useRef(null);
6515
- const canvasRef = useRef(null);
6516
- const { attributes } = props;
6517
- const theme = useMemo(
6518
- () => getModelTheme(),
6519
- []
6520
- );
6521
- const dieline = useMemo(() => generateBecf10a0a(attributes), [attributes]);
6522
- const stablePadding = 15;
6523
- const viewBox = useMemo(
6524
- () => ({
6525
- x: -stablePadding,
6526
- y: -stablePadding,
6527
- width: dieline.viewBox.width + stablePadding * 2,
6528
- height: dieline.viewBox.height + stablePadding * 2
6529
- }),
6530
- [dieline.viewBox.width, dieline.viewBox.height]
6531
- );
6532
- const serializeCanvasSvg = useCallback((showDimensions) => {
6533
- const svg = canvasRef.current?.getSvgElement();
6534
- if (!svg) throw new Error("SVG not mounted");
6535
- const clone = svg.cloneNode(true);
6536
- if (!showDimensions) {
6537
- const dimGroup = clone.querySelector("#dimensions");
6538
- dimGroup?.remove();
6539
- }
6540
- return new XMLSerializer().serializeToString(clone);
6541
- }, []);
6542
- useImperativeHandle(ref, () => ({
7859
+ var CANVAS_BECF_10A0A = forwardRef((props, ref) => {
7860
+ const dieLineRef = useRef(null);
7861
+ const canvasRef = useRef(null);
7862
+ const { attributes } = props;
7863
+ const theme = useMemo(() => getModelTheme(), []);
7864
+ const dieline = useMemo(() => generateBecf10a0a(attributes), [attributes]);
7865
+ const stablePadding = 15;
7866
+ const viewBox = useMemo(
7867
+ () => ({
7868
+ x: -stablePadding,
7869
+ y: -stablePadding,
7870
+ width: dieline.viewBox.width + stablePadding * 2,
7871
+ height: dieline.viewBox.height + stablePadding * 2
7872
+ }),
7873
+ [dieline.viewBox.width, dieline.viewBox.height]
7874
+ );
7875
+ const serializeCanvasSvg = useCallback((showDimensions) => {
7876
+ const svg = canvasRef.current?.getSvgElement();
7877
+ if (!svg) throw new Error("SVG not mounted");
7878
+ const clone = svg.cloneNode(true);
7879
+ if (!showDimensions) {
7880
+ const dimGroup = clone.querySelector("#dimensions");
7881
+ dimGroup?.remove();
7882
+ }
7883
+ return new XMLSerializer().serializeToString(clone);
7884
+ }, []);
7885
+ useImperativeHandle(
7886
+ ref,
7887
+ () => ({
6543
7888
  getAttributes: () => dieLineRef.current.getAttributes(),
6544
7889
  exportImage: async (options) => {
6545
7890
  const svgStr = serializeCanvasSvg(options.isShowDimension);
6546
- const blob = new Blob([svgStr], { type: "image/svg+xml;charset=utf-8" });
7891
+ const blob = new Blob([svgStr], {
7892
+ type: "image/svg+xml;charset=utf-8"
7893
+ });
6547
7894
  const url = URL.createObjectURL(blob);
6548
7895
  const img = new Image();
6549
7896
  await new Promise((resolve, reject) => {
@@ -6574,18 +7921,19 @@ var CANVAS_BECF_10A0A = forwardRef(
6574
7921
  exportDimension: () => dieLineRef.current.exportDimension(),
6575
7922
  resetView: () => canvasRef.current?.resetView(),
6576
7923
  fitView: () => canvasRef.current?.fitView()
6577
- }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
6578
- return /* @__PURE__ */ jsx(
6579
- BaseCanvas,
6580
- {
6581
- ref: canvasRef,
6582
- viewBox,
6583
- backgroundColor: theme.colorBackground,
6584
- children: /* @__PURE__ */ jsx(DIE_LINE_BECF_10A0A, { ref: dieLineRef, ...props, renderAs: "group" })
6585
- }
6586
- );
6587
- }
6588
- );
7924
+ }),
7925
+ [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]
7926
+ );
7927
+ return /* @__PURE__ */ jsx(
7928
+ BaseCanvas,
7929
+ {
7930
+ ref: canvasRef,
7931
+ viewBox,
7932
+ backgroundColor: theme.colorBackground,
7933
+ children: /* @__PURE__ */ jsx(DIE_LINE_BECF_10A0A, { ref: dieLineRef, ...props, renderAs: "group" })
7934
+ }
7935
+ );
7936
+ });
6589
7937
  var MODEL_BECF_10A0A = forwardRef(
6590
7938
  ({ mode = "DIE_LINE", ...props }, ref) => {
6591
7939
  return /* @__PURE__ */ jsx(Fragment, { children: (() => {
@@ -10466,9 +11814,10 @@ var BECF_B_12109_DEFAULT_ATTRIBUTES = {
10466
11814
 
10467
11815
  // src/statics/snap-lock-boxes/becf-10a0a/DEFAULT_ATTRIBUTES.ts
10468
11816
  var BECF_10A0A_DEFAULT_ATTRIBUTES = {
10469
- length: 150,
11817
+ length: 100,
10470
11818
  width: 50,
10471
- height: 150
11819
+ height: 150,
11820
+ glueArea: 13
10472
11821
  };
10473
11822
 
10474
11823
  // src/statics/modelList.ts