kitchen-simulator 4.4.3 → 4.4.6
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/es/constants/catalog/skinPanel.js +9 -0
- package/es/constants.js +1 -10
- package/es/utils/skinPanelEngine.js +214 -24
- package/lib/constants/catalog/skinPanel.js +15 -0
- package/lib/constants.js +3 -12
- package/lib/utils/skinPanelEngine.js +217 -27
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// skin panel SKU
|
|
2
|
+
export var SKIN_SKU_BSV_24 = 'BSV'; // 23.25" x 34.5" : For base cabinets
|
|
3
|
+
export var SKIN_SKU_BSV_48 = 'BSV48'; // 48" x 34.5" : For base cabinets back-to-back or island backs
|
|
4
|
+
export var SKIN_SKU_WSV_1242 = 'WSV1242'; // 11.25" x 42" : For 12" deep wall cabinets
|
|
5
|
+
export var SKIN_SKU_WSV_2442 = 'WSV2442'; // 23.25" x 42" : For 24" deep wall cabinets
|
|
6
|
+
export var SKIN_SKU_WSV_2460 = 'WSV2460'; // Usually used for CT3DR or CT2DR SKUs + stacked wall cabinets
|
|
7
|
+
export var SKIN_SKU_USV245325 = 'USV2453.25'; // 23.25" x 53.25" : For tall cabinets
|
|
8
|
+
|
|
9
|
+
export var SKIN_HEIGHT_53_25 = 53.25; // in inch, height of the skin with SKU USV245325
|
package/es/constants.js
CHANGED
|
@@ -452,7 +452,7 @@ export var UNIT_FOOT = 'ft';
|
|
|
452
452
|
export var UNIT_MILE = 'mi';
|
|
453
453
|
export var UNITS_LENGTH = [UNIT_MILLIMETER, UNIT_CENTIMETER, UNIT_METER, UNIT_INCH, UNIT_FOOT, UNIT_MILE];
|
|
454
454
|
export var CEIL_UNITS_LENGTH = [UNIT_CENTIMETER, UNIT_METER, UNIT_INCH, UNIT_FOOT];
|
|
455
|
-
export var EPSILON =
|
|
455
|
+
export var EPSILON = 0.5;
|
|
456
456
|
|
|
457
457
|
// distance between item and wall
|
|
458
458
|
export var DISTANCE_EPSILON = 5.0; //5.08; // 2 inch
|
|
@@ -771,13 +771,4 @@ export var ROOM_SHAPE_TYPE = {
|
|
|
771
771
|
export var DOORSTYLE_SCOPE_ALL = 'all';
|
|
772
772
|
export var DOORSTYLE_SCOPE_SINGLE = 'single';
|
|
773
773
|
export var DOORSTYLE_SCOPE_MULTIPLE = 'multiple';
|
|
774
|
-
|
|
775
|
-
// skin panel SKU
|
|
776
|
-
export var SKIN_SKU_BSV_24 = 'BSV'; // 23.25" x 34.5" : For base cabinets
|
|
777
|
-
export var SKIN_SKU_BSV_48 = 'BSV48'; // 48" x 34.5" : For base cabinets back-to-back or island backs
|
|
778
|
-
export var SKIN_SKU_WSV_1242 = 'WSV1242'; // 11.25" x 42" : For 12" deep wall cabinets
|
|
779
|
-
export var SKIN_SKU_WSV_2442 = 'WSV2442'; // 23.25" x 42" : For 24" deep wall cabinets
|
|
780
|
-
export var SKIN_SKU_WSV_2460 = 'WSV2460'; // Usually used for CT3DR or CT2DR SKUs + stacked wall cabinets
|
|
781
|
-
export var SKIN_SKU_USV245325 = 'USV2453.25'; // 23.25" x 53.25" : For tall cabinets
|
|
782
|
-
|
|
783
774
|
export var DEFAULT_MOLDING_PIECE_LENGTH = 96; // in inch, 8 feet, standard length for molding pieces
|
|
@@ -2,11 +2,12 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
3
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
import { BASE_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, OVERLAP_INCLUDED, OVERLAP_SAME, OVERLAP_LINK, OVERLAP_SOME, EPSILON,
|
|
5
|
+
import { BASE_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, OVERLAP_INCLUDED, OVERLAP_SAME, OVERLAP_LINK, OVERLAP_SOME, EPSILON, VANITY_CABINET_LAYOUTPOS } from "../constants";
|
|
6
6
|
import { buildRectFromLines, getAllLines, pointsDistance, relationshipOfTwoOverlappedLines, rotatePointAroundPoint } from "./geometry";
|
|
7
7
|
import { MathUtils } from "./export";
|
|
8
8
|
import { convert } from "./convert-units-lite";
|
|
9
9
|
import { getSkuAliasFromCatalog, isEmpty } from "./helper";
|
|
10
|
+
import { SKIN_SKU_BSV_24, SKIN_SKU_BSV_48, SKIN_SKU_WSV_1242, SKIN_SKU_WSV_2442, SKIN_SKU_WSV_2460, SKIN_SKU_USV245325, SKIN_HEIGHT_53_25 } from "../constants/catalog/skinPanel";
|
|
10
11
|
function toCm(item, prop) {
|
|
11
12
|
var unit = item.properties.get(prop).get('_unit') || 'cm';
|
|
12
13
|
var value = item.properties.get(prop).get('_length');
|
|
@@ -30,7 +31,8 @@ export function getSideFaces(item, layer) {
|
|
|
30
31
|
var overlapList = [OVERLAP_INCLUDED, OVERLAP_SAME, OVERLAP_SOME];
|
|
31
32
|
var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
|
|
32
33
|
for (var i = 0; i < 4; i++) {
|
|
33
|
-
if (i === 0
|
|
34
|
+
if (i === 0) continue; // only left & right & base cabinet's back
|
|
35
|
+
if (i === 2 && item.layoutpos !== BASE_CABINET_LAYOUTPOS) continue;
|
|
34
36
|
var isSnappedToWall = false;
|
|
35
37
|
var v0 = rotateCorner(pos[i], item, widthCm, depthCm);
|
|
36
38
|
var v1 = rotateCorner(pos[(i + 1) % 4], item, widthCm, depthCm);
|
|
@@ -64,7 +66,8 @@ export function getSideFaces(item, layer) {
|
|
|
64
66
|
var skinPanelSKU = 'unknown';
|
|
65
67
|
switch (item.layoutpos) {
|
|
66
68
|
case BASE_CABINET_LAYOUTPOS:
|
|
67
|
-
|
|
69
|
+
case VANITY_CABINET_LAYOUTPOS:
|
|
70
|
+
skinPanelSKU = i === 2 ? 'unknown' : SKIN_SKU_BSV_24;
|
|
68
71
|
break;
|
|
69
72
|
case WALL_CABINET_LAYOUTPOS:
|
|
70
73
|
if (Math.abs(depthInch - 12) <= 1) skinPanelSKU = SKIN_SKU_WSV_1242;else if (Math.abs(depthInch - 24) <= 1) skinPanelSKU = SKIN_SKU_WSV_2442;
|
|
@@ -84,6 +87,7 @@ export function getSideFaces(item, layer) {
|
|
|
84
87
|
// inch unit
|
|
85
88
|
height: heightInch,
|
|
86
89
|
// inch unit
|
|
90
|
+
isBackFace: i === 2 ? true : false,
|
|
87
91
|
skinPanelSKU: skinPanelSKU,
|
|
88
92
|
itemInfo: item.toJS()
|
|
89
93
|
});
|
|
@@ -93,7 +97,7 @@ export function getSideFaces(item, layer) {
|
|
|
93
97
|
}
|
|
94
98
|
function collectLayerItems(layer) {
|
|
95
99
|
var _layer$items;
|
|
96
|
-
var skinLayouts = new Set([BASE_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS]);
|
|
100
|
+
var skinLayouts = new Set([BASE_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, VANITY_CABINET_LAYOUTPOS]);
|
|
97
101
|
var skinPanelItems = [];
|
|
98
102
|
var otherItems = [];
|
|
99
103
|
layer === null || layer === void 0 || (_layer$items = layer.items) === null || _layer$items === void 0 || _layer$items.forEach(function (it) {
|
|
@@ -113,26 +117,142 @@ function collectFaces(items, layer) {
|
|
|
113
117
|
}
|
|
114
118
|
return faces;
|
|
115
119
|
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @param {*} faceSegs
|
|
123
|
+
* @param {*} otherFaces
|
|
124
|
+
* @returns
|
|
125
|
+
*/
|
|
126
|
+
function getTrimmedFaceSegs(faceSegs, otherFaces, cnt) {
|
|
127
|
+
try {
|
|
128
|
+
cnt++;
|
|
129
|
+
if (cnt > 5000) {
|
|
130
|
+
console.log('getTrimmedFaceSegs has limited!');
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
var returnSegs = [];
|
|
134
|
+
var _loop = function _loop() {
|
|
135
|
+
var iFace = faceSegs[i];
|
|
136
|
+
var srcLine = iFace.sectionLine;
|
|
137
|
+
var bContourSeg = true;
|
|
138
|
+
var _loop2 = function _loop2(j) {
|
|
139
|
+
var destLine = otherFaces[j].sectionLine;
|
|
140
|
+
var rst = relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
141
|
+
if (rst.result == OVERLAP_SAME || rst.result == OVERLAP_INCLUDED) {
|
|
142
|
+
bContourSeg = false;
|
|
143
|
+
return 0; // break
|
|
144
|
+
} else if (rst.result == OVERLAP_SOME) {
|
|
145
|
+
var trimmedFaceSegs = [];
|
|
146
|
+
rst.trimmedSegs.forEach(function (lineSeg) {
|
|
147
|
+
trimmedFaceSegs.push({
|
|
148
|
+
sectionLine: lineSeg,
|
|
149
|
+
// cm unit
|
|
150
|
+
zBottom: iFace.zBottom,
|
|
151
|
+
// cm unit
|
|
152
|
+
zTop: iFace.zTop,
|
|
153
|
+
// cm unit
|
|
154
|
+
depth: iFace.depthInch,
|
|
155
|
+
// inch unit
|
|
156
|
+
height: iFace.heightInch,
|
|
157
|
+
// inch unit
|
|
158
|
+
isBackFace: iFace.isBackFace,
|
|
159
|
+
skinPanelSKU: iFace.skinPanelSKU,
|
|
160
|
+
itemInfo: iFace.itemInfo
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
var tFaceSegs = getTrimmedFaceSegs(trimmedFaceSegs, otherFaces.filter(function (v, idx) {
|
|
164
|
+
return idx !== j;
|
|
165
|
+
}), cnt);
|
|
166
|
+
if (tFaceSegs.length > 0) returnSegs = [].concat(_toConsumableArray(returnSegs), _toConsumableArray(tFaceSegs));
|
|
167
|
+
bContourSeg = false;
|
|
168
|
+
return 0; // break
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
_ret;
|
|
172
|
+
for (var j = 0; j < otherFaces.length; j++) {
|
|
173
|
+
_ret = _loop2(j);
|
|
174
|
+
if (_ret === 0) break;
|
|
175
|
+
}
|
|
176
|
+
if (bContourSeg) returnSegs.push(faceSegs[i]);
|
|
177
|
+
};
|
|
178
|
+
for (var i = 0; i < faceSegs.length; i++) {
|
|
179
|
+
_loop();
|
|
180
|
+
}
|
|
181
|
+
return returnSegs;
|
|
182
|
+
} catch (e) {
|
|
183
|
+
console.log('getTrimmedFaceSegs catched :', e);
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
116
187
|
function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
|
|
117
188
|
var overlapList = [OVERLAP_INCLUDED, OVERLAP_SAME];
|
|
118
189
|
var removeIdxs = [];
|
|
119
|
-
|
|
190
|
+
var newFaces = []; // new countour edge segment that except the overlapped part
|
|
191
|
+
var _loop3 = function _loop3(i) {
|
|
120
192
|
var iFace = sourceFaces[i];
|
|
121
193
|
for (var j = 0; j < blockingFaces.length; j++) {
|
|
194
|
+
var _relationship$trimmed;
|
|
122
195
|
if (sourceFaces === blockingFaces && i === j) continue;
|
|
123
196
|
var jFace = blockingFaces[j];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
197
|
+
var verticallyIncluded = (iFace.zBottom > jFace.zBottom || Math.abs(iFace.zBottom - jFace.zBottom) < EPSILON) && (iFace.zTop < jFace.zTop || Math.abs(iFace.zTop - jFace.zTop) < EPSILON);
|
|
198
|
+
var verticallyOverlappedTopPart = jFace.zBottom < iFace.zTop && jFace.zBottom > iFace.zBottom && Math.abs(jFace.zBottom - iFace.zTop) > EPSILON && Math.abs(jFace.zBottom - iFace.zBottom) > EPSILON;
|
|
199
|
+
var verticallyOverlappedBottomPart = jFace.zTop < iFace.zTop && jFace.zTop > iFace.zBottom && Math.abs(jFace.zTop - iFace.zTop) > EPSILON && Math.abs(jFace.zTop - iFace.zBottom) > EPSILON;
|
|
200
|
+
var relationship = relationshipOfTwoOverlappedLines(iFace.sectionLine, jFace.sectionLine);
|
|
201
|
+
if (overlapList.includes(relationship.result)) {
|
|
202
|
+
if (verticallyIncluded) removeIdxs.push(i);else if (verticallyOverlappedTopPart) {
|
|
127
203
|
removeIdxs.push(i);
|
|
128
|
-
|
|
204
|
+
newFaces.push({
|
|
205
|
+
sectionLine: iFace.sectionLine,
|
|
206
|
+
// cm unit
|
|
207
|
+
zBottom: iFace.zBottom,
|
|
208
|
+
// cm unit
|
|
209
|
+
zTop: jFace.zBottom,
|
|
210
|
+
// cm unit
|
|
211
|
+
depth: iFace.depthInch,
|
|
212
|
+
// inch unit
|
|
213
|
+
height: toIn(jFace.zBottom - iFace.zBottom),
|
|
214
|
+
// inch unit
|
|
215
|
+
isBackFace: iFace.isBackFace,
|
|
216
|
+
skinPanelSKU: iFace.skinPanelSKU,
|
|
217
|
+
itemInfo: iFace.itemInfo
|
|
218
|
+
});
|
|
219
|
+
} else if (verticallyOverlappedBottomPart) {
|
|
220
|
+
removeIdxs.push(i);
|
|
221
|
+
newFaces.push({
|
|
222
|
+
sectionLine: iFace.sectionLine,
|
|
223
|
+
// cm unit
|
|
224
|
+
zBottom: jFace.zTop,
|
|
225
|
+
// cm unit
|
|
226
|
+
zTop: iFace.zTop,
|
|
227
|
+
// cm unit
|
|
228
|
+
depth: iFace.depthInch,
|
|
229
|
+
// inch unit
|
|
230
|
+
height: toIn(iFace.zTop - jFace.zTop),
|
|
231
|
+
// inch unit
|
|
232
|
+
isBackFace: iFace.isBackFace,
|
|
233
|
+
skinPanelSKU: iFace.skinPanelSKU,
|
|
234
|
+
itemInfo: iFace.itemInfo
|
|
235
|
+
});
|
|
129
236
|
}
|
|
237
|
+
break;
|
|
238
|
+
} else if (relationship.result === OVERLAP_SOME && ((_relationship$trimmed = relationship.trimmedSegs) === null || _relationship$trimmed === void 0 ? void 0 : _relationship$trimmed.length) > 0 && verticallyIncluded) {
|
|
239
|
+
removeIdxs.push(i);
|
|
240
|
+
var tFaceSegs = getTrimmedFaceSegs([iFace], sourceFaces === blockingFaces ? blockingFaces.filter(function (v, idx) {
|
|
241
|
+
return idx !== i;
|
|
242
|
+
}) : blockingFaces, 0);
|
|
243
|
+
if (tFaceSegs.length > 0) newFaces = [].concat(_toConsumableArray(newFaces), _toConsumableArray(tFaceSegs));
|
|
244
|
+
break;
|
|
130
245
|
}
|
|
131
246
|
}
|
|
247
|
+
};
|
|
248
|
+
for (var i = 0; i < sourceFaces.length; i++) {
|
|
249
|
+
_loop3(i);
|
|
132
250
|
}
|
|
133
|
-
|
|
251
|
+
sourceFaces = sourceFaces.filter(function (face, idx) {
|
|
134
252
|
return !removeIdxs.includes(idx);
|
|
135
253
|
});
|
|
254
|
+
if (newFaces.length > 0) sourceFaces = [].concat(_toConsumableArray(sourceFaces), _toConsumableArray(newFaces));
|
|
255
|
+
return sourceFaces;
|
|
136
256
|
}
|
|
137
257
|
function applyGroupingRules(faces) {
|
|
138
258
|
var _applyHorizontalGroup = applyHorizontalGrouping(faces),
|
|
@@ -173,7 +293,8 @@ function applyHorizontalGrouping(faces) {
|
|
|
173
293
|
// inch unit
|
|
174
294
|
height: jFace.height,
|
|
175
295
|
// inch unit
|
|
176
|
-
|
|
296
|
+
isBackFace: jFace.isBackFace,
|
|
297
|
+
skinPanelSKU: jFace.isBackFace ? 'unknown' : SKIN_SKU_BSV_48,
|
|
177
298
|
itemInfo: jFace.itemInfo // [TODO] how to select the doorstyle of grouped skin
|
|
178
299
|
});
|
|
179
300
|
removeIdxs.push(i);
|
|
@@ -216,6 +337,7 @@ function applyVerticalGrouping(faces) {
|
|
|
216
337
|
// inch unit
|
|
217
338
|
height: jFace.height,
|
|
218
339
|
// inch unit
|
|
340
|
+
isBackFace: jFace.isBackFace,
|
|
219
341
|
skinPanelSKU: SKIN_SKU_WSV_2460,
|
|
220
342
|
itemInfo: jFace.itemInfo // [TODO] how to select the doorstyle of grouped skin
|
|
221
343
|
});
|
|
@@ -243,9 +365,10 @@ function resolveTallCabinetBundle(face) {
|
|
|
243
365
|
if (isMP3TallCabinet(item.sku_number)) {
|
|
244
366
|
return [SKIN_SKU_BSV_24, SKIN_SKU_BSV_24, SKIN_SKU_WSV_2442];
|
|
245
367
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
368
|
+
if (face.height > SKIN_HEIGHT_53_25) {
|
|
369
|
+
return [SKIN_SKU_USV245325, SKIN_SKU_WSV_2442];
|
|
370
|
+
}
|
|
371
|
+
return face !== null && face !== void 0 && face.skinPanelSKU ? [face.skinPanelSKU] : [];
|
|
249
372
|
}
|
|
250
373
|
|
|
251
374
|
/**
|
|
@@ -263,34 +386,38 @@ function resolveSkinPanelSKU(face) {
|
|
|
263
386
|
* Make skin panel data with grouping skinPanelSKU & doorStyle
|
|
264
387
|
*/
|
|
265
388
|
function buildSkinPanelData(faces) {
|
|
266
|
-
var
|
|
267
|
-
var
|
|
389
|
+
var tempResult = [];
|
|
390
|
+
var _loop4 = function _loop4() {
|
|
268
391
|
var sf = faces[i];
|
|
269
392
|
var skus = resolveSkinPanelSKU(sf);
|
|
270
393
|
var _iterator = _createForOfIteratorHelper(skus),
|
|
271
394
|
_step;
|
|
272
395
|
try {
|
|
273
|
-
var
|
|
396
|
+
var _loop6 = function _loop6() {
|
|
274
397
|
var sku = _step.value;
|
|
275
|
-
var idx =
|
|
398
|
+
var idx = tempResult.findIndex(function (v) {
|
|
276
399
|
var _sf$itemInfo;
|
|
277
|
-
return v.itemSKU === sku && v.doorStyleId === ((_sf$itemInfo = sf.itemInfo) === null || _sf$itemInfo === void 0 || (_sf$itemInfo = _sf$itemInfo.doorStyle) === null || _sf$itemInfo === void 0 ? void 0 : _sf$itemInfo.id);
|
|
400
|
+
return v.itemSKU === sku && v.doorStyleId === ((_sf$itemInfo = sf.itemInfo) === null || _sf$itemInfo === void 0 || (_sf$itemInfo = _sf$itemInfo.doorStyle) === null || _sf$itemInfo === void 0 ? void 0 : _sf$itemInfo.id) && v.isBackFace === sf.isBackFace;
|
|
278
401
|
});
|
|
279
402
|
if (idx < 0) {
|
|
280
403
|
var _sf$itemInfo$doorStyl, _sf$itemInfo2, _sf$itemInfo$doorStyl2, _sf$itemInfo3;
|
|
281
|
-
|
|
404
|
+
tempResult.push({
|
|
282
405
|
itemSKU: sku,
|
|
283
406
|
doorStyle: (_sf$itemInfo$doorStyl = (_sf$itemInfo2 = sf.itemInfo) === null || _sf$itemInfo2 === void 0 || (_sf$itemInfo2 = _sf$itemInfo2.doorStyle) === null || _sf$itemInfo2 === void 0 ? void 0 : _sf$itemInfo2.name) !== null && _sf$itemInfo$doorStyl !== void 0 ? _sf$itemInfo$doorStyl : '',
|
|
284
407
|
doorStyleId: (_sf$itemInfo$doorStyl2 = (_sf$itemInfo3 = sf.itemInfo) === null || _sf$itemInfo3 === void 0 || (_sf$itemInfo3 = _sf$itemInfo3.doorStyle) === null || _sf$itemInfo3 === void 0 ? void 0 : _sf$itemInfo3.id) !== null && _sf$itemInfo$doorStyl2 !== void 0 ? _sf$itemInfo$doorStyl2 : '',
|
|
285
408
|
installationType: 'standard',
|
|
286
|
-
quantity: 1
|
|
409
|
+
quantity: 1,
|
|
410
|
+
totalLength: toIn(pointsDistance(sf.sectionLine.x1, sf.sectionLine.y1, sf.sectionLine.x2, sf.sectionLine.y2)),
|
|
411
|
+
isBackFace: sf.isBackFace
|
|
287
412
|
});
|
|
288
413
|
} else {
|
|
289
|
-
|
|
414
|
+
var faceLength = pointsDistance(sf.sectionLine.x1, sf.sectionLine.y1, sf.sectionLine.x2, sf.sectionLine.y2);
|
|
415
|
+
tempResult[idx].totalLength += toIn(faceLength);
|
|
416
|
+
tempResult[idx].quantity += 1;
|
|
290
417
|
}
|
|
291
418
|
};
|
|
292
419
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
293
|
-
|
|
420
|
+
_loop6();
|
|
294
421
|
}
|
|
295
422
|
} catch (err) {
|
|
296
423
|
_iterator.e(err);
|
|
@@ -299,8 +426,71 @@ function buildSkinPanelData(faces) {
|
|
|
299
426
|
}
|
|
300
427
|
};
|
|
301
428
|
for (var i = 0; i < faces.length; i++) {
|
|
302
|
-
|
|
429
|
+
_loop4();
|
|
303
430
|
}
|
|
431
|
+
|
|
432
|
+
// calculate back face panel quantity of island base cabinets
|
|
433
|
+
var removeIdxs = [];
|
|
434
|
+
var newDatas = [];
|
|
435
|
+
var _loop5 = function _loop5() {
|
|
436
|
+
var iData = tempResult[_i];
|
|
437
|
+
if (iData.isBackFace) {
|
|
438
|
+
removeIdxs.push(_i);
|
|
439
|
+
var count48 = Math.floor(iData.totalLength / 48);
|
|
440
|
+
var count24 = iData.totalLength % 48 > 0 ? 1 : 0;
|
|
441
|
+
var idx48 = tempResult.findIndex(function (v) {
|
|
442
|
+
return v.itemSKU === SKIN_SKU_BSV_48 && v.doorStyleId === iData.doorStyleId;
|
|
443
|
+
});
|
|
444
|
+
var idx24 = tempResult.findIndex(function (v) {
|
|
445
|
+
return v.itemSKU === SKIN_SKU_BSV_24 && v.doorStyleId === iData.doorStyleId;
|
|
446
|
+
});
|
|
447
|
+
if (idx48 < 0) {
|
|
448
|
+
if (count48 > 0) newDatas.push({
|
|
449
|
+
itemSKU: SKIN_SKU_BSV_48,
|
|
450
|
+
doorStyle: iData.doorStyle,
|
|
451
|
+
doorStyleId: iData.doorStyleId,
|
|
452
|
+
installationType: iData.installationType,
|
|
453
|
+
quantity: count48,
|
|
454
|
+
totalLength: count48 * 48,
|
|
455
|
+
isBackFace: iData.isBackFace
|
|
456
|
+
});
|
|
457
|
+
} else {
|
|
458
|
+
tempResult[idx48].quantity += count48;
|
|
459
|
+
tempResult[idx48].totalLength += count48 * 48;
|
|
460
|
+
}
|
|
461
|
+
if (idx24 < 0) {
|
|
462
|
+
if (count24 > 0) newDatas.push({
|
|
463
|
+
itemSKU: SKIN_SKU_BSV_24,
|
|
464
|
+
doorStyle: iData.doorStyle,
|
|
465
|
+
doorStyleId: iData.doorStyleId,
|
|
466
|
+
installationType: iData.installationType,
|
|
467
|
+
quantity: count24,
|
|
468
|
+
totalLength: count24 * 24,
|
|
469
|
+
isBackFace: iData.isBackFace
|
|
470
|
+
});
|
|
471
|
+
} else {
|
|
472
|
+
tempResult[idx24].quantity += count24;
|
|
473
|
+
tempResult[idx24].totalLength += count24 * 24;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
for (var _i = 0; _i < tempResult.length; _i++) {
|
|
478
|
+
_loop5();
|
|
479
|
+
}
|
|
480
|
+
tempResult = tempResult.filter(function (data, idx) {
|
|
481
|
+
return !removeIdxs.includes(idx);
|
|
482
|
+
});
|
|
483
|
+
if (newDatas.length > 0) tempResult = [].concat(_toConsumableArray(tempResult), newDatas);
|
|
484
|
+
var result = [];
|
|
485
|
+
tempResult.forEach(function (v) {
|
|
486
|
+
return result.push({
|
|
487
|
+
itemSKU: v.itemSKU,
|
|
488
|
+
doorStyle: v.doorStyle,
|
|
489
|
+
doorStyleId: v.doorStyleId,
|
|
490
|
+
installationType: v.installationType,
|
|
491
|
+
quantity: v.quantity
|
|
492
|
+
});
|
|
493
|
+
});
|
|
304
494
|
return result;
|
|
305
495
|
}
|
|
306
496
|
function shouldExcludeSkinPanel(itemJS, exclusionSet, catalog) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SKIN_SKU_WSV_2460 = exports.SKIN_SKU_WSV_2442 = exports.SKIN_SKU_WSV_1242 = exports.SKIN_SKU_USV245325 = exports.SKIN_SKU_BSV_48 = exports.SKIN_SKU_BSV_24 = exports.SKIN_HEIGHT_53_25 = void 0;
|
|
7
|
+
// skin panel SKU
|
|
8
|
+
var SKIN_SKU_BSV_24 = exports.SKIN_SKU_BSV_24 = 'BSV'; // 23.25" x 34.5" : For base cabinets
|
|
9
|
+
var SKIN_SKU_BSV_48 = exports.SKIN_SKU_BSV_48 = 'BSV48'; // 48" x 34.5" : For base cabinets back-to-back or island backs
|
|
10
|
+
var SKIN_SKU_WSV_1242 = exports.SKIN_SKU_WSV_1242 = 'WSV1242'; // 11.25" x 42" : For 12" deep wall cabinets
|
|
11
|
+
var SKIN_SKU_WSV_2442 = exports.SKIN_SKU_WSV_2442 = 'WSV2442'; // 23.25" x 42" : For 24" deep wall cabinets
|
|
12
|
+
var SKIN_SKU_WSV_2460 = exports.SKIN_SKU_WSV_2460 = 'WSV2460'; // Usually used for CT3DR or CT2DR SKUs + stacked wall cabinets
|
|
13
|
+
var SKIN_SKU_USV245325 = exports.SKIN_SKU_USV245325 = 'USV2453.25'; // 23.25" x 53.25" : For tall cabinets
|
|
14
|
+
|
|
15
|
+
var SKIN_HEIGHT_53_25 = exports.SKIN_HEIGHT_53_25 = 53.25; // in inch, height of the skin with SKU USV245325
|
package/lib/constants.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.END_DRAWING_ITEM = exports.END_DRAWING_HOLE_3D = exports.END_DRAWING_HOLE = exports.END_DRAGGING_VERTEX = exports.END_DRAGGING_LINE = exports.END_DRAGGING_ITEM_3D = exports.END_DRAGGING_ITEM = exports.END_DRAGGING_HOLE_3D = exports.END_DRAGGING_HOLE = exports.END_CREATING_HOLE = exports.END_CREATING_CABINET = exports.ELEVATION_VIEW_TITLE = exports.ELEVATION_VIEW_RIGHT = exports.ELEVATION_VIEW_LEFT = exports.ELEVATION_VIEW_KEYWORD = exports.ELEVATION_VIEW_FRONT = exports.ELEVATION_VIEW_BACK = exports.ELEVATION_VIEW = exports.ELEMENT_VERTEX = exports.ELEMENT_LINE = exports.ELEMENT_ITEM = exports.ELEMENT_HOLE = exports.ELEMENT_AREA = exports.EDIT_WIDTH = exports.EDIT = exports.DUPLICATE_SELECTED = exports.DOORSTYLE_SCOPE_SINGLE = exports.DOORSTYLE_SCOPE_MULTIPLE = exports.DOORSTYLE_SCOPE_ALL = exports.DISTANCE_MEASUREMENT_LINE_COLOR = exports.DISTANCE_EPSILON = exports.DIFFERENT_VALUES_PATH_LENGTH = exports.DELTA = exports.DEFAULT_MOLDING_PIECE_LENGTH = exports.DEFAULT_FONT_FAMILY = exports.DECIMAL_PLACES_3 = exports.DECIMAL_PLACES_2 = exports.DASH_LINE_COLOR = exports.CREATE_ROOM_WITH_SHAPE = exports.COPY_PROPERTIES = exports.CLIENTS_NAME = exports.CHANGE_WINDOW_DOOR_MEASURE = exports.CHANGE_WALL_LENGTH_MEASURE = exports.CHANGE_WALL_CABINET_MEASURE = exports.CHANGE_MEASUREMENT_UNIT = exports.CHANGE_CATALOG_PAGE = exports.CHANGE_BASE_CABINET_MEASURE = exports.CEIL_UNITS_LENGTH = exports.BROWN_COLOR = exports.BOTTOM_MOLDING_LOCATION = exports.BOTTOM = exports.BG_COLOR_OVERLAY = exports.BG_COLOR_HOVER = exports.BG_COLOR_1 = exports.BG_COLOR_0 = exports.BEGIN_UPLOADING_IMAGE = exports.BEGIN_ROTATING_ITEM_3D = exports.BEGIN_ROTATING_ITEM = exports.BEGIN_FITTING_IMAGE = exports.BEGIN_DRAWING_LINE = exports.BEGIN_DRAGGING_VERTEX = exports.BEGIN_DRAGGING_LINE = exports.BEGIN_DRAGGING_ITEM_3D = exports.BEGIN_DRAGGING_ITEM = exports.BEGIN_DRAGGING_HOLE_3D = exports.BEGIN_DRAGGING_HOLE = exports.BASE_ITEM_MEASUREMENT_LINE_COLOR = exports.BASE_CABINET_LAYOUTPOS = exports.BACK_DIST_ANG = exports.ATT_VERTEXT_TWO = exports.ATT_VERTEXT_ONE = exports.ATT_LINE_LENGTH = exports.ATT_ITEM_ROTATION = exports.ATT_ITEM_POS = exports.ATT_HOLE_OFFSET_B = exports.ATT_HOLE_OFFSET_A = exports.ARROW_TEXT_FORECOLOR = exports.ARROW_TEXT_FONTFACE = exports.ARROW_TEXT_BACKCOLOR = exports.ARROW_COLOR = exports.ARRAY_ELEVATION_VIEW_MODES = exports.ARRAY_3D_MODES = exports.AREA_ACTIONS = exports.API_SERVER_URL = exports.ANIMATE_STEP_MIN = exports.ANIMATE_STEP_MAX = exports.ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT = exports.ANIMATE_OBJECT = exports.ALTERATE_STATE = exports.ADD_VERTICAL_GUIDE = exports.ADD_TO_GROUP = exports.ADD_LAYER = exports.ADD_HORIZONTAL_GUIDE = exports.ADD_GROUP_FROM_SELECTED = exports.ADD_GROUP = exports.ADD_ELEMENT_TO_CATALOG = exports.ADD_CIRCULAR_GUIDE = exports.ADD_CABINETS = exports.ADD_APPLIANCES = exports.ACCENT_COLOR = void 0;
|
|
7
7
|
exports.MODE_DRAGGING_LINE = exports.MODE_DRAGGING_ITEM_3D = exports.MODE_DRAGGING_ITEM = exports.MODE_DRAGGING_HOLE_3D = exports.MODE_DRAGGING_HOLE = exports.MODE_CONFIGURING_PROJECT = exports.MODE_BACK_ELEVATION_VIEW = exports.MODE_3D_VIEW = exports.MODE_3D_FIRST_PERSON = exports.MODE_2D_ZOOM_OUT = exports.MODE_2D_ZOOM_IN = exports.MODE_2D_PAN = exports.MODE = exports.MIN_ANGLE_DISALLOW_DRAW_WALL = exports.MIDDLE_MOLDING_LOCATION = exports.MEPSILON = exports.MAX_ZOOM_IN_SCALE = exports.MAX_ANGLE_SCALE = exports.MAKE_FLOOR_PLAN = exports.LOGOUT = exports.LOGIN_SUCCESS = exports.LOGIN_ERROR = exports.LOCAL_STORAGE_TOKEN_VALUE = exports.LOCAL_STORAGE_TOKEN_NAME = exports.LOCAL_STORAGE_ORIGINAL_TOKEN = exports.LOCAL_STORAGE_CUSTOMER_INFO = exports.LOCAL_STORAGE_CART_ACTION = exports.LOAD_PROJECT = exports.LIST_QUANTITIES = exports.LIST_PARTS = exports.LINE_THICKNESS = exports.LINE_ACTIONS = exports.LEFT_DIST_ANG = exports.LEFT = exports.LABEL_COLOR = exports.KITCHEN_KONFIGURATOR = exports.KEYBOARD_BUTTON_CODE = exports.ITEM_TYPE = exports.ITEM_MOVE_UP = exports.ITEMS_ACTIONS = exports.INVERT = exports.INTERNAL_EVENT_UNSELECT_ALL = exports.INTERNAL_EVENT_TOGGLE_TO_ELEVATION = exports.INTERNAL_EVENT_SYNC_SCENE = exports.INTERNAL_EVENT_START_DRAW_WALL = exports.INTERNAL_EVENT_SELECT_ELEMENT = exports.INTERNAL_EVENT_ROTATE_ELEMENT = exports.INTERNAL_EVENT_REPLACE_CABINET = exports.INTERNAL_EVENT_ITEMS_CATALOG = exports.INTERNAL_EVENT_DRAW_ELEMENT = exports.INTERNAL_EVENT_DRAG_ELEMENT = exports.INSTALLATION_TYPE_SKU_SUFFIX = exports.INSTALLATION_TYPE_NAME = exports.INSTALLATION_SUFFIX_TYPE = exports.INIT_CATALOG = exports.HOLE_NAMES = exports.HOLE_ACTIONS = exports.HDR_URLS = exports.HAS_LOADINGBAR = exports.GROUP_TRANSLATE = exports.GROUP_ROTATE = exports.GROUP_ACTIONS = exports.GO_BACK_TO_CATALOG_PAGE = exports.FRONT_DIST_ANG = exports.FINISHING_TYPE = exports.FINISHING_TOUCH = exports.EXTERNAL_EVENT_ZOOM_OUT = exports.EXTERNAL_EVENT_ZOOM_IN = exports.EXTERNAL_EVENT_UPDATE_PROPERTY = exports.EXTERNAL_EVENT_UPDATE_ATTRIBUTE = exports.EXTERNAL_EVENT_UNDO = exports.EXTERNAL_EVENT_TOGGLE_TO_ELEVATION = exports.EXTERNAL_EVENT_TOGGLE_TO_3D = exports.EXTERNAL_EVENT_TOGGLE_TO_2D = exports.EXTERNAL_EVENT_SYNC_SCENE = exports.EXTERNAL_EVENT_SET_MOLDING = exports.EXTERNAL_EVENT_SET_FINISHING = exports.EXTERNAL_EVENT_ROTATE_PAN = exports.EXTERNAL_EVENT_REPLACE_CABINET = exports.EXTERNAL_EVENT_REDO = exports.EXTERNAL_EVENT_PROJECT_SETTING = exports.EXTERNAL_EVENT_NEW_PROJECT = exports.EXTERNAL_EVENT_MOVE_PAN = exports.EXTERNAL_EVENT_LOAD_PROJECT = exports.EXTERNAL_EVENT_DUPLICATE_ELEMENT = exports.EXTERNAL_EVENT_DELETE_ELEMENT = exports.EXTERNAL_EVENT_CHANGE_DOORSTYLE = exports.EXTERNAL_EVENT_CENTERING_2D = exports.EXTERNAL_EVENT_ADD_WALL = exports.EXTERNAL_EVENT_ADD_ROOM_SHAPE = exports.EXTERNAL_EVENT_ADD_ITEM = exports.EXTERNAL_EVENT_ADD_HOLE = exports.ERROR_DATABASE = exports.EPSILON = exports.END_UPLOADING_IMAGE = exports.END_ROTATING_ITEM_3D = exports.END_ROTATING_ITEM = exports.END_LOADING = exports.END_FITTING_IMAGE = exports.END_DRAWING_LINE = void 0;
|
|
8
8
|
exports.SET_BACKSPLASH = exports.SET_APPLIANCE_MATERIAL = exports.SELECT_TOOL_ZOOM_OUT = exports.SELECT_TOOL_ZOOM_IN = exports.SELECT_TOOL_UPLOAD_IMAGE = exports.SELECT_TOOL_PAN = exports.SELECT_TOOL_EDIT = exports.SELECT_TOOL_DRAWING_LINE = exports.SELECT_TOOL_DRAWING_ITEM_3D = exports.SELECT_TOOL_DRAWING_ITEM = exports.SELECT_TOOL_DRAWING_HOLE_3D = exports.SELECT_TOOL_DRAWING_HOLE = exports.SELECT_TOOL_3D_VIEW = exports.SELECT_TOOL_3D_FIRST_PERSON = exports.SELECT_LINE = exports.SELECT_LAYER = exports.SELECT_ITEM = exports.SELECT_HOLE = exports.SELECT_GROUP = exports.SELECT_DOOR_STYLE = exports.SELECT_AREA = exports.SELECT_ALL = exports.SELECTALL = exports.SECONDARY_PURPLE_COLOR = exports.SECONDARY_BLUE_COLOR = exports.SCENE_ACTIONS = exports.SAVE_PROJECT = exports.SAVE_DESIGN = exports.ROOM_SHAPE_TYPE = exports.ROOM_SHAPE_MEASUREMENT_LINE_COLOR = exports.ROOM_ELEMENT_MEASUREMENT_LINE_COLOR = exports.ROLLBACK = exports.RIGHT_DIST_ANG = exports.RIGHT = exports.REVIEW_AND_QUOTE = exports.REQUEST_ASSISTANCE = exports.REPLACE_SUBMODULE = exports.REPLACE_ITEM = exports.REMOVE_VERTICAL_GUIDE = exports.REMOVE_REPLACE_SUBMODULE = exports.REMOVE_LINEAR = exports.REMOVE_LAYER = exports.REMOVE_HORIZONTAL_GUIDE = exports.REMOVE_GROUP_AND_DELETE_ELEMENTS = exports.REMOVE_GROUP = exports.REMOVE_FROM_GROUP = exports.REMOVE_DRAWING_SUPPORT = exports.REMOVE_CIRCULAR_GUIDE = exports.REMOVE = exports.REDO = exports.RECREATE = exports.PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY = exports.PROP_RESIZE_WIDTH = exports.PROP_RESIZE_HEIGHT = exports.PROP_RESIZE_DEPTH = exports.PROP_OPEN_DOORS = exports.PROP_FLIP_DOOR_HANDLE = exports.PROP_ALTITUDE = exports.PROJECT_SETTING_OPTION = exports.PROJECT_RE_NAME = exports.PROJECT_NAME_LENGTH_LIMIT = exports.PROJECT_ACTIONS = exports.PRODUCT = exports.PRIMARY_GREEN_COLOR = exports.PASTE_PROPERTIES = exports.OVERLAP_SOME = exports.OVERLAP_SAME = exports.OVERLAP_NONE = exports.OVERLAP_LINK = exports.OVERLAP_INCLUDED = exports.OPEN_PROJECT_CONFIGURATOR = exports.OPEN_CATALOG = exports.OBJTYPE_MESH = exports.OBJTYPE_GROUP = exports.NO_DATA_DATABASE = exports.NEW_PROJECT_BTN = exports.NEW_PROJECT = exports.NEW_DESIGN = exports.MOVE_COMPONENT = exports.MOLDING_LOCATIONS = exports.MODE_WAITING_DRAWING_LINE = exports.MODE_VIEWING_CATALOG = exports.MODE_UPLOADING_IMAGE = exports.MODE_SNAPPING = exports.MODE_ROTATING_ITEM_3D = exports.MODE_ROTATING_ITEM = exports.MODE_RIGHT_ELEVATION_VIEW = exports.MODE_LEFT_ELEVATION_VIEW = exports.MODE_IDLE_3D = exports.MODE_IDLE = exports.MODE_FRONT_VIEW = exports.MODE_FRONT_ELEVATION_VIEW = exports.MODE_FITTING_IMAGE = exports.MODE_ELEVATION_VIEW = exports.MODE_DRAWING_LINE = exports.MODE_DRAWING_ITEM_3D = exports.MODE_DRAWING_ITEM = exports.MODE_DRAWING_HOLE_3D = exports.MODE_DRAWING_HOLE = exports.MODE_DRAGGING_VERTEX = void 0;
|
|
9
|
-
exports.UPDATE_3D_CEIL_HEIGHT = exports.UPDATE_2D_CAMERA = exports.UNSELECT_GROUP = exports.UNSELECT_ALL = exports.UNIT_MILLIMETER = exports.UNIT_MILE = exports.UNIT_METER = exports.UNIT_INCH_LONG = exports.UNIT_INCH = exports.UNIT_FOOT = exports.UNIT_CENTIMETER = exports.UNIT_ANGLE = exports.UNITS_LENGTH = exports.UNDO = exports.UNCREATE = exports.TWO_D_FLOOR_PLAN = exports.TOP_MOLDING_LOCATION = exports.TOP = exports.TOGGLE_SNAP = exports.TOGGLE_LOADING_CABINET = exports.TOE_KICK_MOLDING = exports.TITLE_SMALL_COLOR = exports.TITLE_COLOR = exports.THROW_WARNING = exports.THROW_ERROR = exports.TEXT_COLOR_NEUTRAL_7 = exports.TEXT_COLOR_NEUTRAL_6 = exports.TEXT_COLOR_NEUTRAL_5 = exports.TEXT_COLOR_NEUTRAL_4 = exports.TEXT_COLOR_NEUTRAL_3 = exports.TEXT_COLOR_NEUTRAL_2 = exports.TEXT_COLOR_NEUTRAL_1 = exports.TEXT_COLOR_NEUTRAL_0 = exports.TEXT_COLOR = exports.TECHNICAL_VIEW = exports.TALL_CABINET_LAYOUTPOS = exports.TAKE_PICTURE = exports.SUBTOTAL = exports.SUBMIT_REQUEST_ASSIST = exports.SUBMIT_DESIGN = exports.SUBMIT_ADD_CART = exports.STORE_DIST_ARRAY = exports.STOP_DRAWING_LINE = exports.STEP_CABINET_CHOOSE_PRODUCT = exports.STATUS_WARNING_LIGHT_COLOR = exports.STATUS_WARNING_COLOR = exports.STATUS_POSITIVE_LIGHT_COLOR = exports.STATUS_POSITIVE_COLOR = exports.STATUS_OVERDUE_LIGHT_COLOR = exports.STATUS_OVERDUE_COLOR = exports.STATUS_NEGATIVE_LIGHT_COLOR = exports.STATUS_NEGATIVE_COLOR = exports.STATUS_INFO_LIGHT_COLOR = exports.STATUS_INFO_COLOR = exports.
|
|
10
|
-
exports.ZOOM_VARIABLE = exports.WARRANTY_VIEW = exports.WARRANTY_SUPPORT = exports.WARNING_MESSAGE = exports.WALL_ITEM_MEASUREMENT_LINE_COLOR = exports.WALL_CABINET_LAYOUTPOS = exports.VIEWER3D_ACTIONS = exports.VIEWER2D_ACTIONS = exports.VERTEX_ACTIONS = exports.VANITY_CABINET_LAYOUTPOS = exports.VALIDATE_ITEM_POSTIONS = exports.USER_ACTIONS = exports.UPDATE_ZOOM_SCALE = exports.UPDATE_ROTATING_ITEM_CHANGED = exports.UPDATE_ROTATING_ITEM = exports.UPDATE_ROTATING = exports.UPDATE_POPUP_OPEN = exports.UPDATE_MOVING_STATE = exports.UPDATE_MOUSE_COORDS = exports.UPDATE_MOLDING = exports.UPDATE_ITEM_POSITION = exports.UPDATE_DRAWING_LINE = exports.UPDATE_DRAWING_ITEM = exports.UPDATE_DRAWING_HOLE_3D = exports.UPDATE_DRAWING_HOLE = exports.UPDATE_DRAGGING_VERTEX = exports.UPDATE_DRAGGING_LINE = exports.UPDATE_DRAGGING_ITEM_CHANGED = exports.UPDATE_DRAGGING_ITEM_3DY = exports.UPDATE_DRAGGING_ITEM_3DX = exports.UPDATE_DRAGGING_ITEM = exports.UPDATE_DRAGGING_HOLE_RULER_CHANGED =
|
|
9
|
+
exports.UPDATE_DRAGGING_HOLE_CHANGED = exports.UPDATE_DRAGGING_HOLE_3D = exports.UPDATE_DRAGGING_HOLE = exports.UPDATE_CEIL_HEIGHT_UNIT = exports.UPDATE_CEIL_HEIGHT = exports.UPDATE_3D_CEIL_HEIGHT_UNIT = exports.UPDATE_3D_CEIL_HEIGHT = exports.UPDATE_2D_CAMERA = exports.UNSELECT_GROUP = exports.UNSELECT_ALL = exports.UNIT_MILLIMETER = exports.UNIT_MILE = exports.UNIT_METER = exports.UNIT_INCH_LONG = exports.UNIT_INCH = exports.UNIT_FOOT = exports.UNIT_CENTIMETER = exports.UNIT_ANGLE = exports.UNITS_LENGTH = exports.UNDO = exports.UNCREATE = exports.TWO_D_FLOOR_PLAN = exports.TOP_MOLDING_LOCATION = exports.TOP = exports.TOGGLE_SNAP = exports.TOGGLE_LOADING_CABINET = exports.TOE_KICK_MOLDING = exports.TITLE_SMALL_COLOR = exports.TITLE_COLOR = exports.THROW_WARNING = exports.THROW_ERROR = exports.TEXT_COLOR_NEUTRAL_7 = exports.TEXT_COLOR_NEUTRAL_6 = exports.TEXT_COLOR_NEUTRAL_5 = exports.TEXT_COLOR_NEUTRAL_4 = exports.TEXT_COLOR_NEUTRAL_3 = exports.TEXT_COLOR_NEUTRAL_2 = exports.TEXT_COLOR_NEUTRAL_1 = exports.TEXT_COLOR_NEUTRAL_0 = exports.TEXT_COLOR = exports.TECHNICAL_VIEW = exports.TALL_CABINET_LAYOUTPOS = exports.TAKE_PICTURE = exports.SUBTOTAL = exports.SUBMIT_REQUEST_ASSIST = exports.SUBMIT_DESIGN = exports.SUBMIT_ADD_CART = exports.STORE_DIST_ARRAY = exports.STOP_DRAWING_LINE = exports.STEP_CABINET_CHOOSE_PRODUCT = exports.STATUS_WARNING_LIGHT_COLOR = exports.STATUS_WARNING_COLOR = exports.STATUS_POSITIVE_LIGHT_COLOR = exports.STATUS_POSITIVE_COLOR = exports.STATUS_OVERDUE_LIGHT_COLOR = exports.STATUS_OVERDUE_COLOR = exports.STATUS_NEGATIVE_LIGHT_COLOR = exports.STATUS_NEGATIVE_COLOR = exports.STATUS_INFO_LIGHT_COLOR = exports.STATUS_INFO_COLOR = exports.SHIFT2DON = exports.SHIFT2DOFF = exports.SHAPE_SVG_WIDTH = exports.SHAPE_SVG_PADDING = exports.SHAPE_SVG_DEPTH = exports.SHADE_LIGHT_PURPLE_COLOR = exports.SHADE_LIGHT_GREEN_COLOR = exports.SHADE_LIGHT_BLUE_COLOR = exports.SHADE_DARK_PURPLE_COLOR = exports.SHADE_DARK_GREEN_COLOR = exports.SHADE_DARK_BLUE_COLOR = exports.SET_WALL_COLOR = exports.SET_USER_DATA = exports.SET_STATE_PROPERTIES = exports.SET_ROTATE_STATUS = exports.SET_RELATED_LINE = exports.SET_PROPERTIES = exports.SET_PROJECT_PROPERTIES = exports.SET_PROJECT_ID = exports.SET_MOVE_STATUS = exports.SET_MOLDING = exports.SET_MODELLING = exports.SET_MODE = exports.SET_LINES_ATTRIBUTES = exports.SET_LAYER_PROPERTIES = exports.SET_ITEMS_ATTRIBUTES = exports.SET_IS_HELP = exports.SET_IS_CABINET_DRAWING = exports.SET_INITIAL_DOOR_STYLE = exports.SET_HOLES_ATTRIBUTES = exports.SET_HANDLE_MATERIAL = exports.SET_GROUP_PROPERTIES = exports.SET_GROUP_BARYCENTER = exports.SET_GROUP_ATTRIBUTES = exports.SET_FLOOR_STYLES = exports.SET_DOOR_STYLE = exports.SET_DOOR_HANDLE = exports.SET_DISTANT = exports.SET_COUNTER_TOP = exports.SET_BACKSPLASH_VISIBLE = void 0;
|
|
10
|
+
exports.ZOOM_VARIABLE = exports.WARRANTY_VIEW = exports.WARRANTY_SUPPORT = exports.WARNING_MESSAGE = exports.WALL_ITEM_MEASUREMENT_LINE_COLOR = exports.WALL_CABINET_LAYOUTPOS = exports.VIEWER3D_ACTIONS = exports.VIEWER2D_ACTIONS = exports.VERTEX_ACTIONS = exports.VANITY_CABINET_LAYOUTPOS = exports.VALIDATE_ITEM_POSTIONS = exports.USER_ACTIONS = exports.UPDATE_ZOOM_SCALE = exports.UPDATE_ROTATING_ITEM_CHANGED = exports.UPDATE_ROTATING_ITEM = exports.UPDATE_ROTATING = exports.UPDATE_POPUP_OPEN = exports.UPDATE_MOVING_STATE = exports.UPDATE_MOUSE_COORDS = exports.UPDATE_MOLDING = exports.UPDATE_ITEM_POSITION = exports.UPDATE_DRAWING_LINE = exports.UPDATE_DRAWING_ITEM = exports.UPDATE_DRAWING_HOLE_3D = exports.UPDATE_DRAWING_HOLE = exports.UPDATE_DRAGGING_VERTEX = exports.UPDATE_DRAGGING_LINE = exports.UPDATE_DRAGGING_ITEM_CHANGED = exports.UPDATE_DRAGGING_ITEM_3DY = exports.UPDATE_DRAGGING_ITEM_3DX = exports.UPDATE_DRAGGING_ITEM = exports.UPDATE_DRAGGING_HOLE_RULER_CHANGED = void 0;
|
|
11
11
|
//API server
|
|
12
12
|
// export const API_SERVER = 'http://localhost:3000/';
|
|
13
13
|
// ACTIONS project
|
|
@@ -462,7 +462,7 @@ var UNIT_FOOT = exports.UNIT_FOOT = 'ft';
|
|
|
462
462
|
var UNIT_MILE = exports.UNIT_MILE = 'mi';
|
|
463
463
|
var UNITS_LENGTH = exports.UNITS_LENGTH = [UNIT_MILLIMETER, UNIT_CENTIMETER, UNIT_METER, UNIT_INCH, UNIT_FOOT, UNIT_MILE];
|
|
464
464
|
var CEIL_UNITS_LENGTH = exports.CEIL_UNITS_LENGTH = [UNIT_CENTIMETER, UNIT_METER, UNIT_INCH, UNIT_FOOT];
|
|
465
|
-
var EPSILON = exports.EPSILON =
|
|
465
|
+
var EPSILON = exports.EPSILON = 0.5;
|
|
466
466
|
|
|
467
467
|
// distance between item and wall
|
|
468
468
|
var DISTANCE_EPSILON = exports.DISTANCE_EPSILON = 5.0; //5.08; // 2 inch
|
|
@@ -781,13 +781,4 @@ var ROOM_SHAPE_TYPE = exports.ROOM_SHAPE_TYPE = {
|
|
|
781
781
|
var DOORSTYLE_SCOPE_ALL = exports.DOORSTYLE_SCOPE_ALL = 'all';
|
|
782
782
|
var DOORSTYLE_SCOPE_SINGLE = exports.DOORSTYLE_SCOPE_SINGLE = 'single';
|
|
783
783
|
var DOORSTYLE_SCOPE_MULTIPLE = exports.DOORSTYLE_SCOPE_MULTIPLE = 'multiple';
|
|
784
|
-
|
|
785
|
-
// skin panel SKU
|
|
786
|
-
var SKIN_SKU_BSV_24 = exports.SKIN_SKU_BSV_24 = 'BSV'; // 23.25" x 34.5" : For base cabinets
|
|
787
|
-
var SKIN_SKU_BSV_48 = exports.SKIN_SKU_BSV_48 = 'BSV48'; // 48" x 34.5" : For base cabinets back-to-back or island backs
|
|
788
|
-
var SKIN_SKU_WSV_1242 = exports.SKIN_SKU_WSV_1242 = 'WSV1242'; // 11.25" x 42" : For 12" deep wall cabinets
|
|
789
|
-
var SKIN_SKU_WSV_2442 = exports.SKIN_SKU_WSV_2442 = 'WSV2442'; // 23.25" x 42" : For 24" deep wall cabinets
|
|
790
|
-
var SKIN_SKU_WSV_2460 = exports.SKIN_SKU_WSV_2460 = 'WSV2460'; // Usually used for CT3DR or CT2DR SKUs + stacked wall cabinets
|
|
791
|
-
var SKIN_SKU_USV245325 = exports.SKIN_SKU_USV245325 = 'USV2453.25'; // 23.25" x 53.25" : For tall cabinets
|
|
792
|
-
|
|
793
784
|
var DEFAULT_MOLDING_PIECE_LENGTH = exports.DEFAULT_MOLDING_PIECE_LENGTH = 96; // in inch, 8 feet, standard length for molding pieces
|
|
@@ -12,6 +12,7 @@ var _geometry = require("./geometry");
|
|
|
12
12
|
var _export = require("./export");
|
|
13
13
|
var _convertUnitsLite = require("./convert-units-lite");
|
|
14
14
|
var _helper = require("./helper");
|
|
15
|
+
var _skinPanel = require("../constants/catalog/skinPanel");
|
|
15
16
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
16
17
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
18
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -38,7 +39,8 @@ function getSideFaces(item, layer) {
|
|
|
38
39
|
var overlapList = [_constants.OVERLAP_INCLUDED, _constants.OVERLAP_SAME, _constants.OVERLAP_SOME];
|
|
39
40
|
var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
|
|
40
41
|
for (var i = 0; i < 4; i++) {
|
|
41
|
-
if (i === 0
|
|
42
|
+
if (i === 0) continue; // only left & right & base cabinet's back
|
|
43
|
+
if (i === 2 && item.layoutpos !== _constants.BASE_CABINET_LAYOUTPOS) continue;
|
|
42
44
|
var isSnappedToWall = false;
|
|
43
45
|
var v0 = rotateCorner(pos[i], item, widthCm, depthCm);
|
|
44
46
|
var v1 = rotateCorner(pos[(i + 1) % 4], item, widthCm, depthCm);
|
|
@@ -72,13 +74,14 @@ function getSideFaces(item, layer) {
|
|
|
72
74
|
var skinPanelSKU = 'unknown';
|
|
73
75
|
switch (item.layoutpos) {
|
|
74
76
|
case _constants.BASE_CABINET_LAYOUTPOS:
|
|
75
|
-
|
|
77
|
+
case _constants.VANITY_CABINET_LAYOUTPOS:
|
|
78
|
+
skinPanelSKU = i === 2 ? 'unknown' : _skinPanel.SKIN_SKU_BSV_24;
|
|
76
79
|
break;
|
|
77
80
|
case _constants.WALL_CABINET_LAYOUTPOS:
|
|
78
|
-
if (Math.abs(depthInch - 12) <= 1) skinPanelSKU =
|
|
81
|
+
if (Math.abs(depthInch - 12) <= 1) skinPanelSKU = _skinPanel.SKIN_SKU_WSV_1242;else if (Math.abs(depthInch - 24) <= 1) skinPanelSKU = _skinPanel.SKIN_SKU_WSV_2442;
|
|
79
82
|
break;
|
|
80
83
|
case _constants.TALL_CABINET_LAYOUTPOS:
|
|
81
|
-
skinPanelSKU =
|
|
84
|
+
skinPanelSKU = _skinPanel.SKIN_SKU_USV245325;
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
84
87
|
sideFaces.push({
|
|
@@ -92,6 +95,7 @@ function getSideFaces(item, layer) {
|
|
|
92
95
|
// inch unit
|
|
93
96
|
height: heightInch,
|
|
94
97
|
// inch unit
|
|
98
|
+
isBackFace: i === 2 ? true : false,
|
|
95
99
|
skinPanelSKU: skinPanelSKU,
|
|
96
100
|
itemInfo: item.toJS()
|
|
97
101
|
});
|
|
@@ -101,7 +105,7 @@ function getSideFaces(item, layer) {
|
|
|
101
105
|
}
|
|
102
106
|
function collectLayerItems(layer) {
|
|
103
107
|
var _layer$items;
|
|
104
|
-
var skinLayouts = new Set([_constants.BASE_CABINET_LAYOUTPOS, _constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS]);
|
|
108
|
+
var skinLayouts = new Set([_constants.BASE_CABINET_LAYOUTPOS, _constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS, _constants.VANITY_CABINET_LAYOUTPOS]);
|
|
105
109
|
var skinPanelItems = [];
|
|
106
110
|
var otherItems = [];
|
|
107
111
|
layer === null || layer === void 0 || (_layer$items = layer.items) === null || _layer$items === void 0 || _layer$items.forEach(function (it) {
|
|
@@ -121,26 +125,142 @@ function collectFaces(items, layer) {
|
|
|
121
125
|
}
|
|
122
126
|
return faces;
|
|
123
127
|
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @param {*} faceSegs
|
|
131
|
+
* @param {*} otherFaces
|
|
132
|
+
* @returns
|
|
133
|
+
*/
|
|
134
|
+
function getTrimmedFaceSegs(faceSegs, otherFaces, cnt) {
|
|
135
|
+
try {
|
|
136
|
+
cnt++;
|
|
137
|
+
if (cnt > 5000) {
|
|
138
|
+
console.log('getTrimmedFaceSegs has limited!');
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
var returnSegs = [];
|
|
142
|
+
var _loop = function _loop() {
|
|
143
|
+
var iFace = faceSegs[i];
|
|
144
|
+
var srcLine = iFace.sectionLine;
|
|
145
|
+
var bContourSeg = true;
|
|
146
|
+
var _loop2 = function _loop2(j) {
|
|
147
|
+
var destLine = otherFaces[j].sectionLine;
|
|
148
|
+
var rst = (0, _geometry.relationshipOfTwoOverlappedLines)(srcLine, destLine);
|
|
149
|
+
if (rst.result == _constants.OVERLAP_SAME || rst.result == _constants.OVERLAP_INCLUDED) {
|
|
150
|
+
bContourSeg = false;
|
|
151
|
+
return 0; // break
|
|
152
|
+
} else if (rst.result == _constants.OVERLAP_SOME) {
|
|
153
|
+
var trimmedFaceSegs = [];
|
|
154
|
+
rst.trimmedSegs.forEach(function (lineSeg) {
|
|
155
|
+
trimmedFaceSegs.push({
|
|
156
|
+
sectionLine: lineSeg,
|
|
157
|
+
// cm unit
|
|
158
|
+
zBottom: iFace.zBottom,
|
|
159
|
+
// cm unit
|
|
160
|
+
zTop: iFace.zTop,
|
|
161
|
+
// cm unit
|
|
162
|
+
depth: iFace.depthInch,
|
|
163
|
+
// inch unit
|
|
164
|
+
height: iFace.heightInch,
|
|
165
|
+
// inch unit
|
|
166
|
+
isBackFace: iFace.isBackFace,
|
|
167
|
+
skinPanelSKU: iFace.skinPanelSKU,
|
|
168
|
+
itemInfo: iFace.itemInfo
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
var tFaceSegs = getTrimmedFaceSegs(trimmedFaceSegs, otherFaces.filter(function (v, idx) {
|
|
172
|
+
return idx !== j;
|
|
173
|
+
}), cnt);
|
|
174
|
+
if (tFaceSegs.length > 0) returnSegs = [].concat((0, _toConsumableArray2["default"])(returnSegs), (0, _toConsumableArray2["default"])(tFaceSegs));
|
|
175
|
+
bContourSeg = false;
|
|
176
|
+
return 0; // break
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
_ret;
|
|
180
|
+
for (var j = 0; j < otherFaces.length; j++) {
|
|
181
|
+
_ret = _loop2(j);
|
|
182
|
+
if (_ret === 0) break;
|
|
183
|
+
}
|
|
184
|
+
if (bContourSeg) returnSegs.push(faceSegs[i]);
|
|
185
|
+
};
|
|
186
|
+
for (var i = 0; i < faceSegs.length; i++) {
|
|
187
|
+
_loop();
|
|
188
|
+
}
|
|
189
|
+
return returnSegs;
|
|
190
|
+
} catch (e) {
|
|
191
|
+
console.log('getTrimmedFaceSegs catched :', e);
|
|
192
|
+
return [];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
124
195
|
function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
|
|
125
196
|
var overlapList = [_constants.OVERLAP_INCLUDED, _constants.OVERLAP_SAME];
|
|
126
197
|
var removeIdxs = [];
|
|
127
|
-
|
|
198
|
+
var newFaces = []; // new countour edge segment that except the overlapped part
|
|
199
|
+
var _loop3 = function _loop3(i) {
|
|
128
200
|
var iFace = sourceFaces[i];
|
|
129
201
|
for (var j = 0; j < blockingFaces.length; j++) {
|
|
202
|
+
var _relationship$trimmed;
|
|
130
203
|
if (sourceFaces === blockingFaces && i === j) continue;
|
|
131
204
|
var jFace = blockingFaces[j];
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
205
|
+
var verticallyIncluded = (iFace.zBottom > jFace.zBottom || Math.abs(iFace.zBottom - jFace.zBottom) < _constants.EPSILON) && (iFace.zTop < jFace.zTop || Math.abs(iFace.zTop - jFace.zTop) < _constants.EPSILON);
|
|
206
|
+
var verticallyOverlappedTopPart = jFace.zBottom < iFace.zTop && jFace.zBottom > iFace.zBottom && Math.abs(jFace.zBottom - iFace.zTop) > _constants.EPSILON && Math.abs(jFace.zBottom - iFace.zBottom) > _constants.EPSILON;
|
|
207
|
+
var verticallyOverlappedBottomPart = jFace.zTop < iFace.zTop && jFace.zTop > iFace.zBottom && Math.abs(jFace.zTop - iFace.zTop) > _constants.EPSILON && Math.abs(jFace.zTop - iFace.zBottom) > _constants.EPSILON;
|
|
208
|
+
var relationship = (0, _geometry.relationshipOfTwoOverlappedLines)(iFace.sectionLine, jFace.sectionLine);
|
|
209
|
+
if (overlapList.includes(relationship.result)) {
|
|
210
|
+
if (verticallyIncluded) removeIdxs.push(i);else if (verticallyOverlappedTopPart) {
|
|
135
211
|
removeIdxs.push(i);
|
|
136
|
-
|
|
212
|
+
newFaces.push({
|
|
213
|
+
sectionLine: iFace.sectionLine,
|
|
214
|
+
// cm unit
|
|
215
|
+
zBottom: iFace.zBottom,
|
|
216
|
+
// cm unit
|
|
217
|
+
zTop: jFace.zBottom,
|
|
218
|
+
// cm unit
|
|
219
|
+
depth: iFace.depthInch,
|
|
220
|
+
// inch unit
|
|
221
|
+
height: toIn(jFace.zBottom - iFace.zBottom),
|
|
222
|
+
// inch unit
|
|
223
|
+
isBackFace: iFace.isBackFace,
|
|
224
|
+
skinPanelSKU: iFace.skinPanelSKU,
|
|
225
|
+
itemInfo: iFace.itemInfo
|
|
226
|
+
});
|
|
227
|
+
} else if (verticallyOverlappedBottomPart) {
|
|
228
|
+
removeIdxs.push(i);
|
|
229
|
+
newFaces.push({
|
|
230
|
+
sectionLine: iFace.sectionLine,
|
|
231
|
+
// cm unit
|
|
232
|
+
zBottom: jFace.zTop,
|
|
233
|
+
// cm unit
|
|
234
|
+
zTop: iFace.zTop,
|
|
235
|
+
// cm unit
|
|
236
|
+
depth: iFace.depthInch,
|
|
237
|
+
// inch unit
|
|
238
|
+
height: toIn(iFace.zTop - jFace.zTop),
|
|
239
|
+
// inch unit
|
|
240
|
+
isBackFace: iFace.isBackFace,
|
|
241
|
+
skinPanelSKU: iFace.skinPanelSKU,
|
|
242
|
+
itemInfo: iFace.itemInfo
|
|
243
|
+
});
|
|
137
244
|
}
|
|
245
|
+
break;
|
|
246
|
+
} else if (relationship.result === _constants.OVERLAP_SOME && ((_relationship$trimmed = relationship.trimmedSegs) === null || _relationship$trimmed === void 0 ? void 0 : _relationship$trimmed.length) > 0 && verticallyIncluded) {
|
|
247
|
+
removeIdxs.push(i);
|
|
248
|
+
var tFaceSegs = getTrimmedFaceSegs([iFace], sourceFaces === blockingFaces ? blockingFaces.filter(function (v, idx) {
|
|
249
|
+
return idx !== i;
|
|
250
|
+
}) : blockingFaces, 0);
|
|
251
|
+
if (tFaceSegs.length > 0) newFaces = [].concat((0, _toConsumableArray2["default"])(newFaces), (0, _toConsumableArray2["default"])(tFaceSegs));
|
|
252
|
+
break;
|
|
138
253
|
}
|
|
139
254
|
}
|
|
255
|
+
};
|
|
256
|
+
for (var i = 0; i < sourceFaces.length; i++) {
|
|
257
|
+
_loop3(i);
|
|
140
258
|
}
|
|
141
|
-
|
|
259
|
+
sourceFaces = sourceFaces.filter(function (face, idx) {
|
|
142
260
|
return !removeIdxs.includes(idx);
|
|
143
261
|
});
|
|
262
|
+
if (newFaces.length > 0) sourceFaces = [].concat((0, _toConsumableArray2["default"])(sourceFaces), (0, _toConsumableArray2["default"])(newFaces));
|
|
263
|
+
return sourceFaces;
|
|
144
264
|
}
|
|
145
265
|
function applyGroupingRules(faces) {
|
|
146
266
|
var _applyHorizontalGroup = applyHorizontalGrouping(faces),
|
|
@@ -181,7 +301,8 @@ function applyHorizontalGrouping(faces) {
|
|
|
181
301
|
// inch unit
|
|
182
302
|
height: jFace.height,
|
|
183
303
|
// inch unit
|
|
184
|
-
|
|
304
|
+
isBackFace: jFace.isBackFace,
|
|
305
|
+
skinPanelSKU: jFace.isBackFace ? 'unknown' : _skinPanel.SKIN_SKU_BSV_48,
|
|
185
306
|
itemInfo: jFace.itemInfo // [TODO] how to select the doorstyle of grouped skin
|
|
186
307
|
});
|
|
187
308
|
removeIdxs.push(i);
|
|
@@ -224,7 +345,8 @@ function applyVerticalGrouping(faces) {
|
|
|
224
345
|
// inch unit
|
|
225
346
|
height: jFace.height,
|
|
226
347
|
// inch unit
|
|
227
|
-
|
|
348
|
+
isBackFace: jFace.isBackFace,
|
|
349
|
+
skinPanelSKU: _skinPanel.SKIN_SKU_WSV_2460,
|
|
228
350
|
itemInfo: jFace.itemInfo // [TODO] how to select the doorstyle of grouped skin
|
|
229
351
|
});
|
|
230
352
|
removeIdxs.push(i);
|
|
@@ -249,11 +371,12 @@ function isMP3TallCabinet(sku) {
|
|
|
249
371
|
function resolveTallCabinetBundle(face) {
|
|
250
372
|
var item = face.itemInfo;
|
|
251
373
|
if (isMP3TallCabinet(item.sku_number)) {
|
|
252
|
-
return [
|
|
374
|
+
return [_skinPanel.SKIN_SKU_BSV_24, _skinPanel.SKIN_SKU_BSV_24, _skinPanel.SKIN_SKU_WSV_2442];
|
|
253
375
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
376
|
+
if (face.height > _skinPanel.SKIN_HEIGHT_53_25) {
|
|
377
|
+
return [_skinPanel.SKIN_SKU_USV245325, _skinPanel.SKIN_SKU_WSV_2442];
|
|
378
|
+
}
|
|
379
|
+
return face !== null && face !== void 0 && face.skinPanelSKU ? [face.skinPanelSKU] : [];
|
|
257
380
|
}
|
|
258
381
|
|
|
259
382
|
/**
|
|
@@ -271,34 +394,38 @@ function resolveSkinPanelSKU(face) {
|
|
|
271
394
|
* Make skin panel data with grouping skinPanelSKU & doorStyle
|
|
272
395
|
*/
|
|
273
396
|
function buildSkinPanelData(faces) {
|
|
274
|
-
var
|
|
275
|
-
var
|
|
397
|
+
var tempResult = [];
|
|
398
|
+
var _loop4 = function _loop4() {
|
|
276
399
|
var sf = faces[i];
|
|
277
400
|
var skus = resolveSkinPanelSKU(sf);
|
|
278
401
|
var _iterator = _createForOfIteratorHelper(skus),
|
|
279
402
|
_step;
|
|
280
403
|
try {
|
|
281
|
-
var
|
|
404
|
+
var _loop6 = function _loop6() {
|
|
282
405
|
var sku = _step.value;
|
|
283
|
-
var idx =
|
|
406
|
+
var idx = tempResult.findIndex(function (v) {
|
|
284
407
|
var _sf$itemInfo;
|
|
285
|
-
return v.itemSKU === sku && v.doorStyleId === ((_sf$itemInfo = sf.itemInfo) === null || _sf$itemInfo === void 0 || (_sf$itemInfo = _sf$itemInfo.doorStyle) === null || _sf$itemInfo === void 0 ? void 0 : _sf$itemInfo.id);
|
|
408
|
+
return v.itemSKU === sku && v.doorStyleId === ((_sf$itemInfo = sf.itemInfo) === null || _sf$itemInfo === void 0 || (_sf$itemInfo = _sf$itemInfo.doorStyle) === null || _sf$itemInfo === void 0 ? void 0 : _sf$itemInfo.id) && v.isBackFace === sf.isBackFace;
|
|
286
409
|
});
|
|
287
410
|
if (idx < 0) {
|
|
288
411
|
var _sf$itemInfo$doorStyl, _sf$itemInfo2, _sf$itemInfo$doorStyl2, _sf$itemInfo3;
|
|
289
|
-
|
|
412
|
+
tempResult.push({
|
|
290
413
|
itemSKU: sku,
|
|
291
414
|
doorStyle: (_sf$itemInfo$doorStyl = (_sf$itemInfo2 = sf.itemInfo) === null || _sf$itemInfo2 === void 0 || (_sf$itemInfo2 = _sf$itemInfo2.doorStyle) === null || _sf$itemInfo2 === void 0 ? void 0 : _sf$itemInfo2.name) !== null && _sf$itemInfo$doorStyl !== void 0 ? _sf$itemInfo$doorStyl : '',
|
|
292
415
|
doorStyleId: (_sf$itemInfo$doorStyl2 = (_sf$itemInfo3 = sf.itemInfo) === null || _sf$itemInfo3 === void 0 || (_sf$itemInfo3 = _sf$itemInfo3.doorStyle) === null || _sf$itemInfo3 === void 0 ? void 0 : _sf$itemInfo3.id) !== null && _sf$itemInfo$doorStyl2 !== void 0 ? _sf$itemInfo$doorStyl2 : '',
|
|
293
416
|
installationType: 'standard',
|
|
294
|
-
quantity: 1
|
|
417
|
+
quantity: 1,
|
|
418
|
+
totalLength: toIn((0, _geometry.pointsDistance)(sf.sectionLine.x1, sf.sectionLine.y1, sf.sectionLine.x2, sf.sectionLine.y2)),
|
|
419
|
+
isBackFace: sf.isBackFace
|
|
295
420
|
});
|
|
296
421
|
} else {
|
|
297
|
-
|
|
422
|
+
var faceLength = (0, _geometry.pointsDistance)(sf.sectionLine.x1, sf.sectionLine.y1, sf.sectionLine.x2, sf.sectionLine.y2);
|
|
423
|
+
tempResult[idx].totalLength += toIn(faceLength);
|
|
424
|
+
tempResult[idx].quantity += 1;
|
|
298
425
|
}
|
|
299
426
|
};
|
|
300
427
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
301
|
-
|
|
428
|
+
_loop6();
|
|
302
429
|
}
|
|
303
430
|
} catch (err) {
|
|
304
431
|
_iterator.e(err);
|
|
@@ -307,8 +434,71 @@ function buildSkinPanelData(faces) {
|
|
|
307
434
|
}
|
|
308
435
|
};
|
|
309
436
|
for (var i = 0; i < faces.length; i++) {
|
|
310
|
-
|
|
437
|
+
_loop4();
|
|
311
438
|
}
|
|
439
|
+
|
|
440
|
+
// calculate back face panel quantity of island base cabinets
|
|
441
|
+
var removeIdxs = [];
|
|
442
|
+
var newDatas = [];
|
|
443
|
+
var _loop5 = function _loop5() {
|
|
444
|
+
var iData = tempResult[_i];
|
|
445
|
+
if (iData.isBackFace) {
|
|
446
|
+
removeIdxs.push(_i);
|
|
447
|
+
var count48 = Math.floor(iData.totalLength / 48);
|
|
448
|
+
var count24 = iData.totalLength % 48 > 0 ? 1 : 0;
|
|
449
|
+
var idx48 = tempResult.findIndex(function (v) {
|
|
450
|
+
return v.itemSKU === _skinPanel.SKIN_SKU_BSV_48 && v.doorStyleId === iData.doorStyleId;
|
|
451
|
+
});
|
|
452
|
+
var idx24 = tempResult.findIndex(function (v) {
|
|
453
|
+
return v.itemSKU === _skinPanel.SKIN_SKU_BSV_24 && v.doorStyleId === iData.doorStyleId;
|
|
454
|
+
});
|
|
455
|
+
if (idx48 < 0) {
|
|
456
|
+
if (count48 > 0) newDatas.push({
|
|
457
|
+
itemSKU: _skinPanel.SKIN_SKU_BSV_48,
|
|
458
|
+
doorStyle: iData.doorStyle,
|
|
459
|
+
doorStyleId: iData.doorStyleId,
|
|
460
|
+
installationType: iData.installationType,
|
|
461
|
+
quantity: count48,
|
|
462
|
+
totalLength: count48 * 48,
|
|
463
|
+
isBackFace: iData.isBackFace
|
|
464
|
+
});
|
|
465
|
+
} else {
|
|
466
|
+
tempResult[idx48].quantity += count48;
|
|
467
|
+
tempResult[idx48].totalLength += count48 * 48;
|
|
468
|
+
}
|
|
469
|
+
if (idx24 < 0) {
|
|
470
|
+
if (count24 > 0) newDatas.push({
|
|
471
|
+
itemSKU: _skinPanel.SKIN_SKU_BSV_24,
|
|
472
|
+
doorStyle: iData.doorStyle,
|
|
473
|
+
doorStyleId: iData.doorStyleId,
|
|
474
|
+
installationType: iData.installationType,
|
|
475
|
+
quantity: count24,
|
|
476
|
+
totalLength: count24 * 24,
|
|
477
|
+
isBackFace: iData.isBackFace
|
|
478
|
+
});
|
|
479
|
+
} else {
|
|
480
|
+
tempResult[idx24].quantity += count24;
|
|
481
|
+
tempResult[idx24].totalLength += count24 * 24;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
for (var _i = 0; _i < tempResult.length; _i++) {
|
|
486
|
+
_loop5();
|
|
487
|
+
}
|
|
488
|
+
tempResult = tempResult.filter(function (data, idx) {
|
|
489
|
+
return !removeIdxs.includes(idx);
|
|
490
|
+
});
|
|
491
|
+
if (newDatas.length > 0) tempResult = [].concat((0, _toConsumableArray2["default"])(tempResult), newDatas);
|
|
492
|
+
var result = [];
|
|
493
|
+
tempResult.forEach(function (v) {
|
|
494
|
+
return result.push({
|
|
495
|
+
itemSKU: v.itemSKU,
|
|
496
|
+
doorStyle: v.doorStyle,
|
|
497
|
+
doorStyleId: v.doorStyleId,
|
|
498
|
+
installationType: v.installationType,
|
|
499
|
+
quantity: v.quantity
|
|
500
|
+
});
|
|
501
|
+
});
|
|
312
502
|
return result;
|
|
313
503
|
}
|
|
314
504
|
function shouldExcludeSkinPanel(itemJS, exclusionSet, catalog) {
|