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