kitchen-simulator 1.1.1-test.54 → 1.1.1-test.55
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/KitchenConfigurator.js +1 -1
- package/es/catalog/factories/wall-factory-3d.js +1 -1
- package/es/catalog/properties/property-lenght-measure.js +2 -2
- package/es/catalog/properties/property-length-measure.js +1 -1
- package/es/catalog/properties/property-length-measure_hole.js +2 -2
- package/es/catalog/utils/exporter.js +1 -1
- package/es/catalog/utils/item-loader.js +1 -1
- package/es/class/item.js +1 -1
- package/es/components/viewer2d/area.js +1 -1
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-streak.js +0 -1
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/es/components/viewer2d/item.js +3 -5
- package/es/components/viewer2d/ruler.js +2 -3
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/viewer2d.js +2 -2
- package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
- package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/es/components/viewer3d/scene-creator.js +1 -1
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/models.js +1 -1
- package/es/reducers/viewer2d-reducer.js +1 -1
- package/es/reducers/viewer3d-reducer.js +1 -1
- package/es/utils/convert-units-lite.js +21 -0
- package/es/utils/geometry.js +4 -4
- package/es/utils/helper.js +1 -1
- package/es/utils/molding.js +34 -34
- package/lib/KitchenConfigurator.js +2 -2
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/properties/property-lenght-measure.js +3 -3
- package/lib/catalog/properties/property-length-measure.js +5 -5
- package/lib/catalog/properties/property-length-measure_hole.js +3 -3
- package/lib/catalog/utils/exporter.js +5 -6
- package/lib/catalog/utils/item-loader.js +20 -21
- package/lib/class/item.js +10 -11
- package/lib/components/viewer2d/area.js +2 -2
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-streak.js +0 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -1
- package/lib/components/viewer2d/item.js +7 -8
- package/lib/components/viewer2d/ruler.js +6 -7
- package/lib/components/viewer2d/rulerDist.js +4 -4
- package/lib/components/viewer2d/viewer2d.js +17 -15
- package/lib/components/viewer3d/ruler-utils/itemRect.js +7 -7
- package/lib/components/viewer3d/ruler-utils/layer3D.js +32 -32
- package/lib/components/viewer3d/ruler-utils/scene3D.js +2 -2
- package/lib/components/viewer3d/scene-creator.js +24 -24
- package/lib/components/viewer3d/viewer3d.js +11 -11
- package/lib/models.js +4 -5
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/utils/convert-units-lite.js +27 -0
- package/lib/utils/geometry.js +9 -10
- package/lib/utils/helper.js +6 -7
- package/lib/utils/molding.js +52 -52
- package/package.json +1 -3
package/lib/utils/geometry.js
CHANGED
|
@@ -96,13 +96,12 @@ exports.verticesDistance = verticesDistance;
|
|
|
96
96
|
exports.verticesMidPoint = verticesMidPoint;
|
|
97
97
|
var _math = require("./math.js");
|
|
98
98
|
var _constants = require("../constants");
|
|
99
|
-
var
|
|
99
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
100
100
|
var Three = _interopRequireWildcard(require("three"));
|
|
101
101
|
var _utils = require("../components/viewer2d/utils.js");
|
|
102
102
|
var _helper = require("./helper.js");
|
|
103
103
|
var _export = require("./export.js");
|
|
104
104
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
105
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
106
105
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
107
106
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
108
107
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
@@ -780,9 +779,9 @@ function getAllItems(scene, catalog, allLineRects) {
|
|
|
780
779
|
layoutpos: cat && cat.info.layoutpos,
|
|
781
780
|
is_corner: cat && cat.info.is_corner
|
|
782
781
|
});
|
|
783
|
-
width = (0,
|
|
784
|
-
height = (0,
|
|
785
|
-
depth = (0,
|
|
782
|
+
width = (0, _convertUnitsLite.convert)(sizeinfo.width).from(sizeinfo.widthUnit).to(scene.unit);
|
|
783
|
+
height = (0, _convertUnitsLite.convert)(sizeinfo.depth).from(sizeinfo.depthUnit).to(scene.unit);
|
|
784
|
+
depth = (0, _convertUnitsLite.convert)(sizeinfo.height).from(sizeinfo.heightUnit).to(scene.unit);
|
|
786
785
|
val.size = {
|
|
787
786
|
width: width,
|
|
788
787
|
height: height,
|
|
@@ -841,7 +840,7 @@ function getAllItemSpecified(scene, catalog, filter) {
|
|
|
841
840
|
var getSize = function getSize(key) {
|
|
842
841
|
var _props$getIn;
|
|
843
842
|
var length = props === null || props === void 0 || (_props$getIn = props.getIn) === null || _props$getIn === void 0 ? void 0 : _props$getIn.call(props, [key, '_length']);
|
|
844
|
-
return length != null ? (0,
|
|
843
|
+
return length != null ? (0, _convertUnitsLite.convert)(length).from('in').to(scene.unit) : 0;
|
|
845
844
|
};
|
|
846
845
|
val.size = {
|
|
847
846
|
width: getSize('width'),
|
|
@@ -1717,7 +1716,7 @@ function calcSnap2(allItemRect, allItemSnap, allLineRects, allLineSnap, allRect,
|
|
|
1717
1716
|
//Check case.
|
|
1718
1717
|
//If item is 'blind base cabinet', it must be pulled from other 3".
|
|
1719
1718
|
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.startsWith('BBC')) {
|
|
1720
|
-
var offset3inch = (0,
|
|
1719
|
+
var offset3inch = (0, _convertUnitsLite.convert)(3).from('in').to('cm');
|
|
1721
1720
|
var tx = nx,
|
|
1722
1721
|
ty = ny;
|
|
1723
1722
|
if (allItemRect.cur && allItemRect.cur.itemInfo.sku_number.endsWith('-L')) {
|
|
@@ -2070,14 +2069,14 @@ function needSnap(curItem, othItem) {
|
|
|
2070
2069
|
var blSnap = false;
|
|
2071
2070
|
if (curItem == undefined || curItem == null) return false;
|
|
2072
2071
|
var altitude = curItem.selectedItem.properties.get('altitude');
|
|
2073
|
-
var heightFromFloor = (0,
|
|
2072
|
+
var heightFromFloor = (0, _convertUnitsLite.convert)(altitude.get('_length')).from(altitude.get('_unit')).to('in');
|
|
2074
2073
|
var height = curItem.cat.info.sizeinfo.height;
|
|
2075
2074
|
var currentItem = {
|
|
2076
2075
|
heightFromFloor: heightFromFloor,
|
|
2077
2076
|
height: height
|
|
2078
2077
|
};
|
|
2079
2078
|
altitude = othItem.item.properties.get('altitude');
|
|
2080
|
-
heightFromFloor = (0,
|
|
2079
|
+
heightFromFloor = (0, _convertUnitsLite.convert)(altitude.get('_length')).from(altitude.get('_unit')).to('in');
|
|
2081
2080
|
height = othItem.cat && othItem.cat.info.sizeinfo.height;
|
|
2082
2081
|
var otherItem = {
|
|
2083
2082
|
heightFromFloor: heightFromFloor,
|
|
@@ -2138,7 +2137,7 @@ function isRightWall(v0, v1) {
|
|
|
2138
2137
|
* OVERLAP_LINK: two lines are linked at the common point, so they can be merged to one line
|
|
2139
2138
|
* OVERLAP_INCLUDED: destLine includes srcLine
|
|
2140
2139
|
* OVERLAP_SOME: two lines are overlapped with some common range, then returns the trimmed segments of srcLine
|
|
2141
|
-
*
|
|
2140
|
+
*
|
|
2142
2141
|
* //////// test - start /////////////
|
|
2143
2142
|
const p1 = { x1: 1413.1313131313132, y1: 1044.949494949495 };
|
|
2144
2143
|
const p2 = { x1: 1476.2626262626263, y1: 1108.0808080808079 };
|
package/lib/utils/helper.js
CHANGED
|
@@ -23,9 +23,8 @@ var _HDRCubeTextureLoader = require("three/examples/jsm/loaders/HDRCubeTextureLo
|
|
|
23
23
|
var _constants = require("../constants");
|
|
24
24
|
var Three = _interopRequireWildcard(require("three"));
|
|
25
25
|
var _utils = require("./../components/viewer2d/utils");
|
|
26
|
-
var
|
|
26
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
27
27
|
var _math = require("./math");
|
|
28
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
29
28
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
29
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
31
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -89,9 +88,9 @@ var refineProductForSummaryPdf = exports.refineProductForSummaryPdf = function r
|
|
|
89
88
|
thumbnail: review.img,
|
|
90
89
|
sku: itemSKU,
|
|
91
90
|
sizeInfo: {
|
|
92
|
-
width: Math.round((0,
|
|
93
|
-
depth: Math.round((0,
|
|
94
|
-
height: Math.round((0,
|
|
91
|
+
width: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.width).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
92
|
+
depth: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.depth).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
93
|
+
height: Math.round((0, _convertUnitsLite.convert)(review.info.sizeinfo.height).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
95
94
|
_unit: measurementUnit._unit
|
|
96
95
|
},
|
|
97
96
|
doorstyle: doorStyleName,
|
|
@@ -207,7 +206,7 @@ var animateDoor = exports.animateDoor = function animateDoor(offsetData, doorObj
|
|
|
207
206
|
|
|
208
207
|
// Opening or Closing the drawer action
|
|
209
208
|
var translateDrawer = exports.translateDrawer = function translateDrawer(item, drawerObj, open_doors, mode) {
|
|
210
|
-
var animate_translate_unit = (0,
|
|
209
|
+
var animate_translate_unit = (0, _convertUnitsLite.convert)(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / _constants.ANIMATE_STEP_MAX * 0.01;
|
|
211
210
|
// Check whether the object's drawer is opened in 2D.
|
|
212
211
|
if (mode === 'Opened2D') animate_translate_unit *= _constants.ANIMATE_STEP_MAX;
|
|
213
212
|
drawerObj.translateZ(open_doors ? -animate_translate_unit : animate_translate_unit);
|
|
@@ -270,7 +269,7 @@ function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
|
270
269
|
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
271
270
|
var altitude = item.properties.getIn(['altitude', '_length']);
|
|
272
271
|
var altitudeUnit = item.properties.getIn(['altitude', '_unit']);
|
|
273
|
-
var totalHeight = (0,
|
|
272
|
+
var totalHeight = (0, _convertUnitsLite.convert)(height).from(heightUnit).to(ceilUnit._unit) + (0, _convertUnitsLite.convert)(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
274
273
|
return totalHeight > ceilHeight;
|
|
275
274
|
});
|
|
276
275
|
}
|
package/lib/utils/molding.js
CHANGED
|
@@ -23,7 +23,7 @@ exports.sortItemsByDistance = sortItemsByDistance;
|
|
|
23
23
|
exports.tryMergeMDItem = tryMergeMDItem;
|
|
24
24
|
var _constants = require("../constants");
|
|
25
25
|
var Three = _interopRequireWildcard(require("three"));
|
|
26
|
-
var
|
|
26
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
27
27
|
var _idBroker = _interopRequireDefault(require("./id-broker"));
|
|
28
28
|
var _utils = require("../components/viewer2d/utils");
|
|
29
29
|
var _export = require("./export");
|
|
@@ -48,10 +48,10 @@ function getItemRect(item) {
|
|
|
48
48
|
var rotRad = item.rotation / 180 * Math.PI;
|
|
49
49
|
var itemWidth = item.properties.get('width').get('_length');
|
|
50
50
|
var itemWidthUnit = item.properties.get('width').get('_unit') || 'cm';
|
|
51
|
-
itemWidth = (0,
|
|
51
|
+
itemWidth = (0, _convertUnitsLite.convert)(itemWidth / 2).from(itemWidthUnit).to('cm');
|
|
52
52
|
var itemDepth = item.properties.get('depth').get('_length');
|
|
53
53
|
var itemDepthUnit = item.properties.get('depth').get('_unit') || 'cm';
|
|
54
|
-
itemDepth = (0,
|
|
54
|
+
itemDepth = (0, _convertUnitsLite.convert)(itemDepth / 2).from(itemDepthUnit).to('cm');
|
|
55
55
|
var mx = x - itemWidth * Math.cos(rotRad);
|
|
56
56
|
var my = y - itemWidth * Math.sin(rotRad);
|
|
57
57
|
var x0 = mx + itemDepth * Math.sin(rotRad);
|
|
@@ -93,16 +93,16 @@ function isEnableItemForMolding(layer, selItem) {
|
|
|
93
93
|
else return result && hasMoldingLayout(molding, selItem.layoutpos);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
/**
|
|
97
|
-
* Check two line segments are overlap. The direction of the two line segments must be opposite.
|
|
98
|
-
* s1 c2 s2 c1
|
|
99
|
-
* |--------|------|-----------|
|
|
100
|
-
* Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
|
|
101
|
-
* @param {*} selRectPos1
|
|
102
|
-
* @param {*} selRectPos2
|
|
103
|
-
* @param {*} curRectPos1
|
|
104
|
-
* @param {*} curRectPos2
|
|
105
|
-
* @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
|
|
96
|
+
/**
|
|
97
|
+
* Check two line segments are overlap. The direction of the two line segments must be opposite.
|
|
98
|
+
* s1 c2 s2 c1
|
|
99
|
+
* |--------|------|-----------|
|
|
100
|
+
* Decision Formular: L(s1,c1) + L(s2, c2) = L(s1, s2) + L(c1, c2)
|
|
101
|
+
* @param {*} selRectPos1
|
|
102
|
+
* @param {*} selRectPos2
|
|
103
|
+
* @param {*} curRectPos1
|
|
104
|
+
* @param {*} curRectPos2
|
|
105
|
+
* @returns L(s1,c1) + L(s2, c2) - L(s1, s2) - L(c1, c2)
|
|
106
106
|
*/
|
|
107
107
|
function getDelta(selRectPos1, selRectPos2, curRectPos1, curRectPos2) {
|
|
108
108
|
return (
|
|
@@ -142,16 +142,16 @@ function isSameMoldingLayoutpos(curItem, item) {
|
|
|
142
142
|
function isItemSameItemByLocation(item1, item2, location) {
|
|
143
143
|
var item1Altitude = item1.properties.get('altitude').get('_length');
|
|
144
144
|
var item1AltitudeUnit = item1.properties.get('altitude').get('_unit');
|
|
145
|
-
item1Altitude = (0,
|
|
145
|
+
item1Altitude = (0, _convertUnitsLite.convert)(item1Altitude).from(item1AltitudeUnit).to('cm');
|
|
146
146
|
var item1Height = item1.properties.get('height').get('_length');
|
|
147
147
|
var item1HeightUnit = item1.properties.get('height').get('_unit');
|
|
148
|
-
item1Height = (0,
|
|
148
|
+
item1Height = (0, _convertUnitsLite.convert)(item1Height).from(item1HeightUnit).to('cm');
|
|
149
149
|
var item2Altitude = item2.properties.get('altitude').get('_length');
|
|
150
150
|
var item2AltitudeUnit = item2.properties.get('altitude').get('_unit');
|
|
151
|
-
item2Altitude = (0,
|
|
151
|
+
item2Altitude = (0, _convertUnitsLite.convert)(item2Altitude).from(item2AltitudeUnit).to('cm');
|
|
152
152
|
var item2Height = item2.properties.get('height').get('_length');
|
|
153
153
|
var item2HeightUnit = item2.properties.get('height').get('_unit');
|
|
154
|
-
item2Height = (0,
|
|
154
|
+
item2Height = (0, _convertUnitsLite.convert)(item2Height).from(item2HeightUnit).to('cm');
|
|
155
155
|
var flag = false;
|
|
156
156
|
switch (location) {
|
|
157
157
|
case _constants.TOP_MOLDING_LOCATION:
|
|
@@ -192,11 +192,11 @@ function tryMergeItemWithLocation(curItem, itemGroup, location) {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
/**
|
|
196
|
-
* Make the molding group array with [items].
|
|
197
|
-
* @param {*} layer
|
|
198
|
-
* @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
|
|
199
|
-
* @returns MG array
|
|
195
|
+
/**
|
|
196
|
+
* Make the molding group array with [items].
|
|
197
|
+
* @param {*} layer
|
|
198
|
+
* @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
|
|
199
|
+
* @returns MG array
|
|
200
200
|
*/
|
|
201
201
|
function getAllMoldingGroups(layer) {
|
|
202
202
|
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
@@ -268,10 +268,10 @@ function getLinesOfItem(item, allLineRects, catalog) {
|
|
|
268
268
|
// get edge lines
|
|
269
269
|
var newWidth = item.properties.get('width').get('_length');
|
|
270
270
|
var wUnit = item.properties.get('width').get('_unit') || 'cm';
|
|
271
|
-
newWidth = (0,
|
|
271
|
+
newWidth = (0, _convertUnitsLite.convert)(newWidth).from(wUnit).to('cm');
|
|
272
272
|
var newDepth = item.properties.get('depth').get('_length');
|
|
273
273
|
var hUnit = item.properties.get('depth').get('_unit') || 'cm';
|
|
274
|
-
newDepth = (0,
|
|
274
|
+
newDepth = (0, _convertUnitsLite.convert)(newDepth).from(hUnit).to('cm');
|
|
275
275
|
if (item) {
|
|
276
276
|
// Get Outline Data of Selected Item
|
|
277
277
|
outline = element.info.outline;
|
|
@@ -371,12 +371,12 @@ function mergeOverlappedLines(line1, line2) {
|
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
/**
|
|
375
|
-
* Get the contour line array of moldingGroup items
|
|
376
|
-
* @param {*} moldingGroup
|
|
377
|
-
* @param {*} layer
|
|
378
|
-
* @param {*} catalog
|
|
379
|
-
* @returns contour line array of moldingGroup items
|
|
374
|
+
/**
|
|
375
|
+
* Get the contour line array of moldingGroup items
|
|
376
|
+
* @param {*} moldingGroup
|
|
377
|
+
* @param {*} layer
|
|
378
|
+
* @param {*} catalog
|
|
379
|
+
* @returns contour line array of moldingGroup items
|
|
380
380
|
*/
|
|
381
381
|
function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
382
382
|
// wall lines
|
|
@@ -393,10 +393,10 @@ function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
393
393
|
var itemLines = getLinesOfItem(item, allLineRects, catalog);
|
|
394
394
|
var itemAltitude = item.properties.get('altitude').get('_length');
|
|
395
395
|
var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
|
|
396
|
-
itemAltitude = (0,
|
|
396
|
+
itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
397
397
|
var itemHeight = item.properties.get('height').get('_length');
|
|
398
398
|
var itemHeightUnit = item.properties.get('height').get('_unit');
|
|
399
|
-
itemHeight = (0,
|
|
399
|
+
itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
|
|
400
400
|
itemLines.forEach(function (line) {
|
|
401
401
|
line.push({
|
|
402
402
|
altitude: itemAltitude,
|
|
@@ -412,10 +412,10 @@ function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
412
412
|
items.forEach(function (item) {
|
|
413
413
|
var itemAltitude = item.properties.get('altitude').get('_length');
|
|
414
414
|
var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
|
|
415
|
-
itemAltitude = (0,
|
|
415
|
+
itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
416
416
|
var itemHeight = item.properties.get('height').get('_length');
|
|
417
417
|
var itemHeightUnit = item.properties.get('height').get('_unit');
|
|
418
|
-
itemHeight = (0,
|
|
418
|
+
itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
|
|
419
419
|
var itemLines = getLinesOfItem(item, allLineRects, catalog);
|
|
420
420
|
|
|
421
421
|
// remove the edge that overlapped with other snapped items
|
|
@@ -531,13 +531,13 @@ function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
531
531
|
return newMGlines;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
/**
|
|
535
|
-
* Get the line that colinear linked with [line], and merge them to a new line
|
|
536
|
-
* @param {*} line
|
|
537
|
-
* @param {*} MGlines
|
|
538
|
-
* @returns
|
|
539
|
-
* - returns merged new line
|
|
540
|
-
* - returns filtered new line group (remove linked line from [MGlines])
|
|
534
|
+
/**
|
|
535
|
+
* Get the line that colinear linked with [line], and merge them to a new line
|
|
536
|
+
* @param {*} line
|
|
537
|
+
* @param {*} MGlines
|
|
538
|
+
* @returns
|
|
539
|
+
* - returns merged new line
|
|
540
|
+
* - returns filtered new line group (remove linked line from [MGlines])
|
|
541
541
|
*/
|
|
542
542
|
function getMergedLine(line, MGlines, cnt) {
|
|
543
543
|
try {
|
|
@@ -590,11 +590,11 @@ function getMergedLine(line, MGlines, cnt) {
|
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
/**
|
|
594
|
-
* Get the contour line segments from [lineSegs]
|
|
595
|
-
* @param {*} lineSegs
|
|
596
|
-
* @param {*} otherLines
|
|
597
|
-
* @returns
|
|
593
|
+
/**
|
|
594
|
+
* Get the contour line segments from [lineSegs]
|
|
595
|
+
* @param {*} lineSegs
|
|
596
|
+
* @param {*} otherLines
|
|
597
|
+
* @returns
|
|
598
598
|
*/
|
|
599
599
|
function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
|
|
600
600
|
try {
|
|
@@ -692,16 +692,16 @@ function getLinesFromItems(moldingGroup, layer, catalog) {
|
|
|
692
692
|
snapped_other_items.forEach(function (item) {
|
|
693
693
|
var itemAltitude = item.properties.get('altitude').get('_length');
|
|
694
694
|
var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
|
|
695
|
-
itemAltitude = (0,
|
|
695
|
+
itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
696
696
|
var itemHeight = item.properties.get('height').get('_length');
|
|
697
697
|
var itemHeightUnit = item.properties.get('height').get('_unit');
|
|
698
|
-
itemHeight = (0,
|
|
698
|
+
itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
|
|
699
699
|
var mgroupAltitude = items[0].properties.get('altitude').get('_length');
|
|
700
700
|
var mgroupAltitudeUnit = items[0].properties.get('altitude').get('_unit');
|
|
701
|
-
mgroupAltitude = (0,
|
|
701
|
+
mgroupAltitude = (0, _convertUnitsLite.convert)(mgroupAltitude).from(mgroupAltitudeUnit).to('cm');
|
|
702
702
|
var mgroupHeight = items[0].properties.get('height').get('_length');
|
|
703
703
|
var mgroupHeightUnit = items[0].properties.get('height').get('_unit');
|
|
704
|
-
mgroupHeight = (0,
|
|
704
|
+
mgroupHeight = (0, _convertUnitsLite.convert)(mgroupHeight).from(mgroupHeightUnit).to('cm');
|
|
705
705
|
var flag = false;
|
|
706
706
|
switch (moldingGroup.location_type) {
|
|
707
707
|
case _constants.TOP_MOLDING_LOCATION:
|
|
@@ -860,10 +860,10 @@ function getMDPoints(newMD) {
|
|
|
860
860
|
}
|
|
861
861
|
var z = newMD.items[0].properties.get('altitude').get('_length');
|
|
862
862
|
var zUnit = newMD.items[0].properties.get('altitude').get('_unit') || 'cm';
|
|
863
|
-
z = (0,
|
|
863
|
+
z = (0, _convertUnitsLite.convert)(z).from(zUnit).to('cm');
|
|
864
864
|
var height = newMD.items[0].properties.get('height').get('_length');
|
|
865
865
|
var heightUnit = newMD.items[0].properties.get('height').get('_unit') || 'cm';
|
|
866
|
-
height = (0,
|
|
866
|
+
height = (0, _convertUnitsLite.convert)(height).from(heightUnit).to('cm');
|
|
867
867
|
switch (newMD.location_type) {
|
|
868
868
|
case _constants.TOP_MOLDING_LOCATION:
|
|
869
869
|
z += height;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kitchen-simulator",
|
|
3
|
-
"version": "1.1.1-test.
|
|
3
|
+
"version": "1.1.1-test.55",
|
|
4
4
|
"description": "It is a kitchen simulator.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"redux"
|
|
59
59
|
],
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"convert-units": "2.3.4",
|
|
62
61
|
"hoist-non-react-statics": "2.5.5",
|
|
63
62
|
"immutable": "3.8.2",
|
|
64
63
|
"immutablediff": "0.4.4",
|
|
@@ -99,7 +98,6 @@
|
|
|
99
98
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
|
100
99
|
"babel-plugin-transform-rename-import": "^2.3.0",
|
|
101
100
|
"const-version": "2.0.0",
|
|
102
|
-
"convert-units": "2.3.4",
|
|
103
101
|
"cross-env": "^5.2.0",
|
|
104
102
|
"css-loader": "*",
|
|
105
103
|
"file-loader": "6.2.0",
|