kitchen-simulator 11.9.0 → 11.11.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.
@@ -1226,7 +1226,7 @@ export default function Viewer2D(_ref, _ref2) {
1226
1226
  case constants.MODE_DRAWING_ITEM:
1227
1227
  {
1228
1228
  var itemData = state.getIn(['scene', 'layers', layerID, elementData === null || elementData === void 0 ? void 0 : elementData.prototype, elementData === null || elementData === void 0 ? void 0 : elementData.id]);
1229
- itemsActions.endDrawingItem(layerID, itemData.isInitialPos ? itemData.x : endPoint.x, itemData.isInitialPos ? itemData.y : endPoint.y);
1229
+ if (!isEmpty(itemData)) itemsActions.endDrawingItem(layerID, itemData.isInitialPos ? itemData.x : endPoint.x, itemData.isInitialPos ? itemData.y : endPoint.y);
1230
1230
  }
1231
1231
  break;
1232
1232
  case constants.MODE_DRAGGING_LINE:
@@ -109,10 +109,10 @@ function _parseTempPlaceholdersFromCabinetPayload() {
109
109
  tempData['sink'].push(element.name);
110
110
  // Resolve sink asset via ccdf.assets3d based on placeholder_name
111
111
  var sinkPlaceholderName = sink_match[1]; // e.g. sink_farm_large
112
- var assets3d = cabinetPayload === null || cabinetPayload === void 0 || (_cabinetPayload$ccdf_ = cabinetPayload.ccdf_list) === null || _cabinetPayload$ccdf_ === void 0 ? void 0 : _cabinetPayload$ccdf_.find(function (ccdf) {
112
+ var assets3d = cabinetPayload === null || cabinetPayload === void 0 || (_cabinetPayload$ccdf_ = cabinetPayload.ccdf_list) === null || _cabinetPayload$ccdf_ === void 0 || (_cabinetPayload$ccdf_ = _cabinetPayload$ccdf_.find(function (ccdf) {
113
113
  return ccdf.cabinet_id === cabinetPayload.itemID;
114
- }).assets3d;
115
- var sinkAsset = Array.isArray(assets3d) && assets3d.find(function (a) {
114
+ })) === null || _cabinetPayload$ccdf_ === void 0 ? void 0 : _cabinetPayload$ccdf_.assets3d;
115
+ var sinkAsset = !isEmpty(assets3d) && Array.isArray(assets3d) && assets3d.find(function (a) {
116
116
  return a && (a.placeholder_name === sinkPlaceholderName || a.placeholder_name.startsWith('sink_')) && a.gltf;
117
117
  });
118
118
  if (sinkAsset !== null && sinkAsset !== void 0 && sinkAsset.gltf && cabinetPayload !== null && cabinetPayload !== void 0 && cabinetPayload.structure_json) cabinetPayload.structure_json.sink = sinkAsset.gltf;
@@ -524,8 +524,8 @@ export function addItemToCatalog(_x4, _x5, _x6, _x7) {
524
524
  // Get attributs of current selected element
525
525
  function _addItemToCatalog() {
526
526
  _addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(element, state, catalogInstance, projectActions) {
527
- var _elementJs, _elementJs3;
528
- var elementJs, outlineSVGData, _state$getIn, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
527
+ var _elementJs, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, _elementJs$structure_4, _elementJs3;
528
+ var elementJs, outlineSVGData, _state$getIn, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
529
529
  return _regeneratorRuntime.wrap(function (_context5) {
530
530
  while (1) switch (_context5.prev = _context5.next) {
531
531
  case 0:
@@ -540,27 +540,25 @@ function _addItemToCatalog() {
540
540
  return loadSVGsByItem(elementJs);
541
541
  case 2:
542
542
  outlineSVGData = _context5.sent;
543
- if (!(((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet')) {
544
- _context5.next = 4;
545
- break;
546
- }
547
- // move the tempPlaceholder of current door style to first of tempPlaceholders array
548
- cds = (_state$getIn = state.getIn(['scene', 'layers', 'layer-1', 'doorStyle'])) === null || _state$getIn === void 0 ? void 0 : _state$getIn.cds;
549
- if (cds) {
550
- currentCdsId = (_cds$find = cds.find(function (c) {
551
- return c.itemID === elementJs.itemID;
552
- })) === null || _cds$find === void 0 ? void 0 : _cds$find.cabinet_door_style_id;
553
- cdsIdx = (_elementJs2 = elementJs) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.structure_json) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.tempPlaceholders) === null || _elementJs2 === void 0 ? void 0 : _elementJs2.findIndex(function (tph) {
554
- return tph.id === currentCdsId;
555
- }); // swap
556
- if (currentCdsId && cdsIdx >= 0) {
557
- ttph = elementJs.structure_json.tempPlaceholders[0];
558
- elementJs.structure_json.tempPlaceholders[0] = elementJs.structure_json.tempPlaceholders[cdsIdx];
559
- elementJs.structure_json.tempPlaceholders[cdsIdx] = ttph;
543
+ if (((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet') {
544
+ // move the tempPlaceholder of current door style to first of tempPlaceholders array
545
+ cds = (_state$getIn = state.getIn(['scene', 'layers', 'layer-1', 'doorStyle'])) === null || _state$getIn === void 0 ? void 0 : _state$getIn.cds;
546
+ if (cds) {
547
+ currentCdsId = (_cds$find = cds.find(function (c) {
548
+ return c.itemID === elementJs.itemID;
549
+ })) === null || _cds$find === void 0 ? void 0 : _cds$find.cabinet_door_style_id;
550
+ cdsIdx = (_elementJs2 = elementJs) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.structure_json) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.tempPlaceholders) === null || _elementJs2 === void 0 ? void 0 : _elementJs2.findIndex(function (tph) {
551
+ return tph.id === currentCdsId;
552
+ }); // swap
553
+ if (currentCdsId && cdsIdx >= 0) {
554
+ ttph = elementJs.structure_json.tempPlaceholders[0];
555
+ elementJs.structure_json.tempPlaceholders[0] = elementJs.structure_json.tempPlaceholders[cdsIdx];
556
+ elementJs.structure_json.tempPlaceholders[cdsIdx] = ttph;
557
+ }
560
558
  }
561
559
  }
562
560
  // make placeholders of element and tempPlaceholder
563
- updatedStructureJson = _objectSpread(_objectSpread({}, elementJs.structure_json), (_elementJs$structure_ = (_elementJs$structure_2 = elementJs.structure_json) === null || _elementJs$structure_2 === void 0 || (_elementJs$structure_2 = _elementJs$structure_2.tempPlaceholders[0]) === null || _elementJs$structure_2 === void 0 ? void 0 : _elementJs$structure_2.structure) !== null && _elementJs$structure_ !== void 0 ? _elementJs$structure_ : {});
561
+ updatedStructureJson = (_elementJs$structure_ = elementJs.structure_json) !== null && _elementJs$structure_ !== void 0 && _elementJs$structure_.tempPlaceholders ? _objectSpread(_objectSpread({}, elementJs.structure_json), (_elementJs$structure_2 = (_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 || (_elementJs$structure_3 = _elementJs$structure_3.tempPlaceholders[0]) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.structure) !== null && _elementJs$structure_2 !== void 0 ? _elementJs$structure_2 : {}) : _objectSpread({}, elementJs.structure_json);
564
562
  elementJs.structure_json = updatedStructureJson;
565
563
  elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
566
564
  cds: {
@@ -568,7 +566,7 @@ function _addItemToCatalog() {
568
566
  itemID: elementJs.itemID
569
567
  }
570
568
  });
571
- if (isEmpty((_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.tempPlaceholders)) {
569
+ if (isEmpty((_elementJs$structure_4 = elementJs.structure_json) === null || _elementJs$structure_4 === void 0 ? void 0 : _elementJs$structure_4.tempPlaceholders)) {
572
570
  _context5.next = 4;
573
571
  break;
574
572
  }
@@ -69,9 +69,9 @@ export function ccdfMapper(ccdf_list, layer) {
69
69
  });
70
70
  }
71
71
  // make structure_json
72
- structure_json = {
72
+ if (cd.category === 'cabinet') structure_json = {
73
73
  tempPlaceholders: tempPlaceholders
74
- };
74
+ };else structure_json = structure;
75
75
  // make cabinet definition using structure_json and catalog
76
76
  cabinetDefinition = {
77
77
  type: cd.category,
@@ -31,8 +31,10 @@ export function getSideFaces(item, layer) {
31
31
  var overlapList = [OVERLAP_INCLUDED, OVERLAP_SAME, OVERLAP_SOME];
32
32
  var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
33
33
  for (var i = 0; i < 4; i++) {
34
- if (i === 0) continue; // only left & right & base cabinet's back
35
- if (i === 2 && item.layoutpos !== BASE_CABINET_LAYOUTPOS) continue;
34
+ if (item.is_corner !== true) {
35
+ if (i === 0) continue; // only left & right & base cabinet's back
36
+ if (i === 2 && item.layoutpos !== BASE_CABINET_LAYOUTPOS) continue;
37
+ }
36
38
  var isSnappedToWall = false;
37
39
  var v0 = rotateCorner(pos[i], item, widthCm, depthCm);
38
40
  var v1 = rotateCorner(pos[(i + 1) % 4], item, widthCm, depthCm);
@@ -117,6 +119,11 @@ function collectFaces(items, layer) {
117
119
  }
118
120
  return faces;
119
121
  }
122
+ function isSnappedWithCornerCabient(srcItem, desItem) {
123
+ if (srcItem.is_corner === true || desItem.is_corner === true) {
124
+ return true;
125
+ } else return false;
126
+ }
120
127
 
121
128
  /**
122
129
  * @param {*} faceSegs
@@ -142,9 +149,10 @@ function getTrimmedFaceSegs(faceSegs, otherFaces, cnt) {
142
149
  bContourSeg = false;
143
150
  return 0; // break
144
151
  } else if (rst.result == OVERLAP_SOME) {
152
+ var isCornerFlag = isSnappedWithCornerCabient(iFace.itemInfo, otherFaces[j].itemInfo);
145
153
  var trimmedFaceSegs = [];
146
154
  rst.trimmedSegs.forEach(function (lineSeg) {
147
- trimmedFaceSegs.push({
155
+ !isCornerFlag && trimmedFaceSegs.push({
148
156
  sectionLine: lineSeg,
149
157
  // cm unit
150
158
  zBottom: iFace.zBottom,
@@ -204,7 +212,8 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
204
212
  break;
205
213
  } else if (verticallyOverlappedTopPart) {
206
214
  removeIdxs.push(i);
207
- var newFace = {
215
+ var isCornerFlag = isSnappedWithCornerCabient(iFace.itemInfo, jFace.itemInfo);
216
+ var newFace = !isCornerFlag ? {
208
217
  sectionLine: iFace.sectionLine,
209
218
  // cm unit
210
219
  zBottom: iFace.zBottom,
@@ -218,7 +227,7 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
218
227
  isBackFace: iFace.isBackFace,
219
228
  skinPanelSKU: iFace.skinPanelSKU,
220
229
  itemInfo: iFace.itemInfo
221
- };
230
+ } : {};
222
231
  var contourFaces = filterFacesBlockedByFaces([newFace], sourceFaces === blockingFaces ? blockingFaces.filter(function (v, idx) {
223
232
  return idx !== i;
224
233
  }) : blockingFaces, 0);
@@ -226,7 +235,8 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
226
235
  break;
227
236
  } else if (verticallyOverlappedBottomPart) {
228
237
  removeIdxs.push(i);
229
- var _newFace = {
238
+ var _isCornerFlag = isSnappedWithCornerCabient(iFace.itemInfo, jFace.itemInfo);
239
+ var _newFace = !_isCornerFlag ? {
230
240
  sectionLine: iFace.sectionLine,
231
241
  // cm unit
232
242
  zBottom: jFace.zTop,
@@ -240,7 +250,7 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
240
250
  isBackFace: iFace.isBackFace,
241
251
  skinPanelSKU: iFace.skinPanelSKU,
242
252
  itemInfo: iFace.itemInfo
243
- };
253
+ } : {};
244
254
  var _contourFaces = filterFacesBlockedByFaces([_newFace], sourceFaces === blockingFaces ? blockingFaces.filter(function (v, idx) {
245
255
  return idx !== i;
246
256
  }) : blockingFaces, 0);
@@ -1235,7 +1235,7 @@ function Viewer2D(_ref, _ref2) {
1235
1235
  case constants.MODE_DRAWING_ITEM:
1236
1236
  {
1237
1237
  var itemData = state.getIn(['scene', 'layers', layerID, elementData === null || elementData === void 0 ? void 0 : elementData.prototype, elementData === null || elementData === void 0 ? void 0 : elementData.id]);
1238
- itemsActions.endDrawingItem(layerID, itemData.isInitialPos ? itemData.x : endPoint.x, itemData.isInitialPos ? itemData.y : endPoint.y);
1238
+ if (!(0, _helper.isEmpty)(itemData)) itemsActions.endDrawingItem(layerID, itemData.isInitialPos ? itemData.x : endPoint.x, itemData.isInitialPos ? itemData.y : endPoint.y);
1239
1239
  }
1240
1240
  break;
1241
1241
  case constants.MODE_DRAGGING_LINE:
@@ -122,10 +122,10 @@ function _parseTempPlaceholdersFromCabinetPayload() {
122
122
  tempData['sink'].push(element.name);
123
123
  // Resolve sink asset via ccdf.assets3d based on placeholder_name
124
124
  var sinkPlaceholderName = sink_match[1]; // e.g. sink_farm_large
125
- var assets3d = cabinetPayload === null || cabinetPayload === void 0 || (_cabinetPayload$ccdf_ = cabinetPayload.ccdf_list) === null || _cabinetPayload$ccdf_ === void 0 ? void 0 : _cabinetPayload$ccdf_.find(function (ccdf) {
125
+ var assets3d = cabinetPayload === null || cabinetPayload === void 0 || (_cabinetPayload$ccdf_ = cabinetPayload.ccdf_list) === null || _cabinetPayload$ccdf_ === void 0 || (_cabinetPayload$ccdf_ = _cabinetPayload$ccdf_.find(function (ccdf) {
126
126
  return ccdf.cabinet_id === cabinetPayload.itemID;
127
- }).assets3d;
128
- var sinkAsset = Array.isArray(assets3d) && assets3d.find(function (a) {
127
+ })) === null || _cabinetPayload$ccdf_ === void 0 ? void 0 : _cabinetPayload$ccdf_.assets3d;
128
+ var sinkAsset = !(0, _helper.isEmpty)(assets3d) && Array.isArray(assets3d) && assets3d.find(function (a) {
129
129
  return a && (a.placeholder_name === sinkPlaceholderName || a.placeholder_name.startsWith('sink_')) && a.gltf;
130
130
  });
131
131
  if (sinkAsset !== null && sinkAsset !== void 0 && sinkAsset.gltf && cabinetPayload !== null && cabinetPayload !== void 0 && cabinetPayload.structure_json) cabinetPayload.structure_json.sink = sinkAsset.gltf;
@@ -535,8 +535,8 @@ function addItemToCatalog(_x4, _x5, _x6, _x7) {
535
535
  } // Get attributs of current selected element
536
536
  function _addItemToCatalog() {
537
537
  _addItemToCatalog = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(element, state, catalogInstance, projectActions) {
538
- var _elementJs, _elementJs3;
539
- var elementJs, outlineSVGData, _state$getIn, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
538
+ var _elementJs, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, _elementJs$structure_4, _elementJs3;
539
+ var elementJs, outlineSVGData, _state$getIn, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
540
540
  return _regenerator["default"].wrap(function (_context5) {
541
541
  while (1) switch (_context5.prev = _context5.next) {
542
542
  case 0:
@@ -551,27 +551,25 @@ function _addItemToCatalog() {
551
551
  return loadSVGsByItem(elementJs);
552
552
  case 2:
553
553
  outlineSVGData = _context5.sent;
554
- if (!(((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet')) {
555
- _context5.next = 4;
556
- break;
557
- }
558
- // move the tempPlaceholder of current door style to first of tempPlaceholders array
559
- cds = (_state$getIn = state.getIn(['scene', 'layers', 'layer-1', 'doorStyle'])) === null || _state$getIn === void 0 ? void 0 : _state$getIn.cds;
560
- if (cds) {
561
- currentCdsId = (_cds$find = cds.find(function (c) {
562
- return c.itemID === elementJs.itemID;
563
- })) === null || _cds$find === void 0 ? void 0 : _cds$find.cabinet_door_style_id;
564
- cdsIdx = (_elementJs2 = elementJs) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.structure_json) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.tempPlaceholders) === null || _elementJs2 === void 0 ? void 0 : _elementJs2.findIndex(function (tph) {
565
- return tph.id === currentCdsId;
566
- }); // swap
567
- if (currentCdsId && cdsIdx >= 0) {
568
- ttph = elementJs.structure_json.tempPlaceholders[0];
569
- elementJs.structure_json.tempPlaceholders[0] = elementJs.structure_json.tempPlaceholders[cdsIdx];
570
- elementJs.structure_json.tempPlaceholders[cdsIdx] = ttph;
554
+ if (((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet') {
555
+ // move the tempPlaceholder of current door style to first of tempPlaceholders array
556
+ cds = (_state$getIn = state.getIn(['scene', 'layers', 'layer-1', 'doorStyle'])) === null || _state$getIn === void 0 ? void 0 : _state$getIn.cds;
557
+ if (cds) {
558
+ currentCdsId = (_cds$find = cds.find(function (c) {
559
+ return c.itemID === elementJs.itemID;
560
+ })) === null || _cds$find === void 0 ? void 0 : _cds$find.cabinet_door_style_id;
561
+ cdsIdx = (_elementJs2 = elementJs) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.structure_json) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.tempPlaceholders) === null || _elementJs2 === void 0 ? void 0 : _elementJs2.findIndex(function (tph) {
562
+ return tph.id === currentCdsId;
563
+ }); // swap
564
+ if (currentCdsId && cdsIdx >= 0) {
565
+ ttph = elementJs.structure_json.tempPlaceholders[0];
566
+ elementJs.structure_json.tempPlaceholders[0] = elementJs.structure_json.tempPlaceholders[cdsIdx];
567
+ elementJs.structure_json.tempPlaceholders[cdsIdx] = ttph;
568
+ }
571
569
  }
572
570
  }
573
571
  // make placeholders of element and tempPlaceholder
574
- updatedStructureJson = _objectSpread(_objectSpread({}, elementJs.structure_json), (_elementJs$structure_ = (_elementJs$structure_2 = elementJs.structure_json) === null || _elementJs$structure_2 === void 0 || (_elementJs$structure_2 = _elementJs$structure_2.tempPlaceholders[0]) === null || _elementJs$structure_2 === void 0 ? void 0 : _elementJs$structure_2.structure) !== null && _elementJs$structure_ !== void 0 ? _elementJs$structure_ : {});
572
+ updatedStructureJson = (_elementJs$structure_ = elementJs.structure_json) !== null && _elementJs$structure_ !== void 0 && _elementJs$structure_.tempPlaceholders ? _objectSpread(_objectSpread({}, elementJs.structure_json), (_elementJs$structure_2 = (_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 || (_elementJs$structure_3 = _elementJs$structure_3.tempPlaceholders[0]) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.structure) !== null && _elementJs$structure_2 !== void 0 ? _elementJs$structure_2 : {}) : _objectSpread({}, elementJs.structure_json);
575
573
  elementJs.structure_json = updatedStructureJson;
576
574
  elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
577
575
  cds: {
@@ -579,7 +577,7 @@ function _addItemToCatalog() {
579
577
  itemID: elementJs.itemID
580
578
  }
581
579
  });
582
- if ((0, _helper.isEmpty)((_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.tempPlaceholders)) {
580
+ if ((0, _helper.isEmpty)((_elementJs$structure_4 = elementJs.structure_json) === null || _elementJs$structure_4 === void 0 ? void 0 : _elementJs$structure_4.tempPlaceholders)) {
583
581
  _context5.next = 4;
584
582
  break;
585
583
  }
@@ -76,9 +76,9 @@ function ccdfMapper(ccdf_list, layer) {
76
76
  });
77
77
  }
78
78
  // make structure_json
79
- structure_json = {
79
+ if (cd.category === 'cabinet') structure_json = {
80
80
  tempPlaceholders: tempPlaceholders
81
- };
81
+ };else structure_json = structure;
82
82
  // make cabinet definition using structure_json and catalog
83
83
  cabinetDefinition = {
84
84
  type: cd.category,
@@ -39,8 +39,10 @@ function getSideFaces(item, layer) {
39
39
  var overlapList = [_constants.OVERLAP_INCLUDED, _constants.OVERLAP_SAME, _constants.OVERLAP_SOME];
40
40
  var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
41
41
  for (var i = 0; i < 4; i++) {
42
- if (i === 0) continue; // only left & right & base cabinet's back
43
- if (i === 2 && item.layoutpos !== _constants.BASE_CABINET_LAYOUTPOS) continue;
42
+ if (item.is_corner !== true) {
43
+ if (i === 0) continue; // only left & right & base cabinet's back
44
+ if (i === 2 && item.layoutpos !== _constants.BASE_CABINET_LAYOUTPOS) continue;
45
+ }
44
46
  var isSnappedToWall = false;
45
47
  var v0 = rotateCorner(pos[i], item, widthCm, depthCm);
46
48
  var v1 = rotateCorner(pos[(i + 1) % 4], item, widthCm, depthCm);
@@ -125,6 +127,11 @@ function collectFaces(items, layer) {
125
127
  }
126
128
  return faces;
127
129
  }
130
+ function isSnappedWithCornerCabient(srcItem, desItem) {
131
+ if (srcItem.is_corner === true || desItem.is_corner === true) {
132
+ return true;
133
+ } else return false;
134
+ }
128
135
 
129
136
  /**
130
137
  * @param {*} faceSegs
@@ -150,9 +157,10 @@ function getTrimmedFaceSegs(faceSegs, otherFaces, cnt) {
150
157
  bContourSeg = false;
151
158
  return 0; // break
152
159
  } else if (rst.result == _constants.OVERLAP_SOME) {
160
+ var isCornerFlag = isSnappedWithCornerCabient(iFace.itemInfo, otherFaces[j].itemInfo);
153
161
  var trimmedFaceSegs = [];
154
162
  rst.trimmedSegs.forEach(function (lineSeg) {
155
- trimmedFaceSegs.push({
163
+ !isCornerFlag && trimmedFaceSegs.push({
156
164
  sectionLine: lineSeg,
157
165
  // cm unit
158
166
  zBottom: iFace.zBottom,
@@ -212,7 +220,8 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
212
220
  break;
213
221
  } else if (verticallyOverlappedTopPart) {
214
222
  removeIdxs.push(i);
215
- var newFace = {
223
+ var isCornerFlag = isSnappedWithCornerCabient(iFace.itemInfo, jFace.itemInfo);
224
+ var newFace = !isCornerFlag ? {
216
225
  sectionLine: iFace.sectionLine,
217
226
  // cm unit
218
227
  zBottom: iFace.zBottom,
@@ -226,7 +235,7 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
226
235
  isBackFace: iFace.isBackFace,
227
236
  skinPanelSKU: iFace.skinPanelSKU,
228
237
  itemInfo: iFace.itemInfo
229
- };
238
+ } : {};
230
239
  var contourFaces = filterFacesBlockedByFaces([newFace], sourceFaces === blockingFaces ? blockingFaces.filter(function (v, idx) {
231
240
  return idx !== i;
232
241
  }) : blockingFaces, 0);
@@ -234,7 +243,8 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
234
243
  break;
235
244
  } else if (verticallyOverlappedBottomPart) {
236
245
  removeIdxs.push(i);
237
- var _newFace = {
246
+ var _isCornerFlag = isSnappedWithCornerCabient(iFace.itemInfo, jFace.itemInfo);
247
+ var _newFace = !_isCornerFlag ? {
238
248
  sectionLine: iFace.sectionLine,
239
249
  // cm unit
240
250
  zBottom: jFace.zTop,
@@ -248,7 +258,7 @@ function filterFacesBlockedByFaces(sourceFaces, blockingFaces) {
248
258
  isBackFace: iFace.isBackFace,
249
259
  skinPanelSKU: iFace.skinPanelSKU,
250
260
  itemInfo: iFace.itemInfo
251
- };
261
+ } : {};
252
262
  var _contourFaces = filterFacesBlockedByFaces([_newFace], sourceFaces === blockingFaces ? blockingFaces.filter(function (v, idx) {
253
263
  return idx !== i;
254
264
  }) : blockingFaces, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "11.9.0",
3
+ "version": "11.11.0",
4
4
  "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",