kitchen-simulator 1.1.1-test.60 → 1.1.1-test.62
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/@history.js +10 -2
- package/es/AppContext.js +10 -3
- package/es/KitchenConfigurator.js +92 -96
- package/es/KitchenConfiguratorApp.js +143 -136
- package/es/actions/area-actions.js +12 -5
- package/es/actions/export.js +29 -12
- package/es/actions/groups-actions.js +45 -27
- package/es/actions/holes-actions.js +55 -34
- package/es/actions/items-actions.js +145 -94
- package/es/actions/lines-actions.js +36 -21
- package/es/actions/project-actions.js +145 -94
- package/es/actions/scene-actions.js +21 -11
- package/es/actions/vertices-actions.js +15 -7
- package/es/actions/viewer2d-actions.js +36 -21
- package/es/actions/viewer3d-actions.js +18 -9
- package/es/catalog/areas/area/planner-element.js +9 -2
- package/es/catalog/catalog.js +21 -24
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -14
- package/es/catalog/factories/export.js +24 -6
- package/es/catalog/factories/wall-factory-3d.js +41 -31
- package/es/catalog/factories/wall-factory.js +31 -21
- package/es/catalog/holes/door-closet/planner-element.js +24 -15
- package/es/catalog/holes/door-double/planner-element.js +24 -15
- package/es/catalog/holes/door-exterior/planner-element.js +25 -16
- package/es/catalog/holes/door-interior/planner-element.js +25 -16
- package/es/catalog/holes/door-panic/planner-element.js +16 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
- package/es/catalog/holes/door-sliding/planner-element.js +25 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
- package/es/catalog/holes/export.js +97 -13
- package/es/catalog/holes/window-clear/planner-element.js +19 -10
- package/es/catalog/holes/window-cross/planner-element.js +19 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
- package/es/catalog/holes/window-vertical/planner-element.js +19 -10
- package/es/catalog/lines/wall/planner-element.js +9 -2
- package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
- package/es/catalog/properties/export.js +80 -20
- package/es/catalog/properties/property-checkbox.js +31 -27
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +31 -29
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -39
- package/es/catalog/properties/property-length-measure.js +43 -42
- package/es/catalog/properties/property-length-measure_hole.js +45 -39
- package/es/catalog/properties/property-number.js +24 -17
- package/es/catalog/properties/property-read-only.js +23 -16
- package/es/catalog/properties/property-string.js +23 -16
- package/es/catalog/properties/property-toggle.js +23 -16
- package/es/catalog/properties/shared-property-style.js +7 -1
- package/es/catalog/utils/FuseUtils.js +15 -11
- package/es/catalog/utils/exporter.js +15 -11
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -91
- package/es/catalog/utils/load-obj.js +28 -20
- package/es/catalog/utils/mtl-loader.js +8 -3
- package/es/catalog/utils/obj-loader.js +8 -3
- package/es/class/FuseUtils.js +15 -11
- package/es/class/area.js +28 -26
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -62
- package/es/class/guide.js +21 -19
- package/es/class/hole.js +89 -87
- package/es/class/item.js +147 -150
- package/es/class/layer.js +65 -63
- package/es/class/line.js +143 -144
- package/es/class/project.js +98 -94
- package/es/class/vertex.js +35 -33
- package/es/components/content.js +28 -19
- package/es/components/disclaimer/disclaimer.js +18 -10
- package/es/components/export.js +32 -8
- package/es/components/style/button.js +31 -30
- package/es/components/style/cancel-button.js +14 -8
- package/es/components/style/content-container.js +16 -12
- package/es/components/style/content-title.js +20 -15
- package/es/components/style/delete-button.js +17 -9
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -12
- package/es/components/style/form-color-input.js +14 -8
- package/es/components/style/form-label.js +15 -12
- package/es/components/style/form-number-input.js +49 -47
- package/es/components/style/form-number-input_2.js +44 -42
- package/es/components/style/form-select.js +24 -26
- package/es/components/style/form-slider.js +17 -11
- package/es/components/style/form-submit-button.js +17 -9
- package/es/components/style/form-text-input.js +34 -33
- package/es/components/viewer2d/area.js +24 -17
- package/es/components/viewer2d/export.js +120 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-streak.js +17 -10
- package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -10
- package/es/components/viewer2d/grids/grids.js +19 -15
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -66
- package/es/components/viewer2d/layer.js +30 -23
- package/es/components/viewer2d/line.js +111 -101
- package/es/components/viewer2d/ruler.js +29 -22
- package/es/components/viewer2d/rulerDist.js +28 -21
- package/es/components/viewer2d/rulerX.js +47 -45
- package/es/components/viewer2d/rulerY.js +45 -43
- package/es/components/viewer2d/scene.js +41 -45
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -23
- package/es/components/viewer2d/utils.js +37 -29
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +163 -164
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -24
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -17
- package/es/components/viewer3d/grid-creator.js +17 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
- package/es/components/viewer3d/grids/grid-streak.js +13 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
- package/es/components/viewer3d/libs/first-person-controls.js +9 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
- package/es/components/viewer3d/libs/mtl-loader.js +7 -1
- package/es/components/viewer3d/libs/obj-loader.js +7 -1
- package/es/components/viewer3d/libs/orbit-controls.js +8 -2
- package/es/components/viewer3d/libs/pointer-lock-controls.js +8 -2
- package/es/components/viewer3d/lrm.js +7 -1
- package/es/components/viewer3d/model.js +7 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -42
- package/es/components/viewer3d/ruler-utils/scene3D.js +17 -9
- package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
- package/es/components/viewer3d/scene-creator.js +227 -198
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -46
- package/es/components/viewer3d/viewer3d.js +202 -202
- package/es/constants.js +358 -349
- package/es/index.js +15 -14
- package/es/models.js +184 -183
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -8
- package/es/plugins/export.js +32 -8
- package/es/plugins/keyboard.js +35 -29
- package/es/reducers/areas-reducer.js +13 -7
- package/es/reducers/export.js +96 -24
- package/es/reducers/groups-reducer.js +37 -31
- package/es/reducers/holes-reducer.js +49 -43
- package/es/reducers/items-reducer.js +112 -106
- package/es/reducers/lines-reducer.js +34 -28
- package/es/reducers/project-reducer.js +111 -105
- package/es/reducers/reducer.js +23 -16
- package/es/reducers/scene-reducer.js +21 -15
- package/es/reducers/user-reducer.js +11 -5
- package/es/reducers/vertices-reducer.js +17 -11
- package/es/reducers/viewer2d-reducer.js +24 -18
- package/es/reducers/viewer3d-reducer.js +22 -16
- package/es/shared-style.js +16 -10
- package/es/styles/export.js +11 -3
- package/es/translator/en.js +7 -1
- package/es/translator/it.js +7 -1
- package/es/translator/ru.js +7 -1
- package/es/translator/translator.js +19 -17
- package/es/utils/browser.js +9 -2
- package/es/utils/convert-units-lite.js +7 -1
- package/es/utils/email-validator.js +7 -1
- package/es/utils/export.js +46 -15
- package/es/utils/geometry.js +278 -190
- package/es/utils/get-edges-of-subgraphs.js +9 -2
- package/es/utils/graph-cycles.js +11 -8
- package/es/utils/graph-inner-cycles.js +18 -10
- package/es/utils/graph.js +17 -13
- package/es/utils/helper.js +63 -41
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -12
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +144 -125
- package/es/utils/name-generator.js +13 -11
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -6
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -32
- package/es/utils/snap.js +59 -51
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -17
- package/es/version.js +7 -1
- package/lib/@history.js +1 -1
- package/lib/AppContext.js +1 -1
- package/lib/KitchenConfigurator.js +37 -49
- package/lib/KitchenConfiguratorApp.js +60 -61
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +1 -1
- package/lib/catalog/catalog.js +7 -15
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +4 -6
- package/lib/catalog/factories/export.js +1 -1
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/factories/wall-factory.js +2 -2
- package/lib/catalog/holes/door-closet/planner-element.js +2 -2
- package/lib/catalog/holes/door-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -2
- package/lib/catalog/holes/door-interior/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -2
- package/lib/catalog/holes/export.js +2 -2
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/holes/window-cross/planner-element.js +2 -2
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -2
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -2
- package/lib/catalog/lines/wall/planner-element.js +1 -1
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +3 -6
- package/lib/catalog/properties/property-color.js +1 -1
- package/lib/catalog/properties/property-enum.js +4 -9
- package/lib/catalog/properties/property-hidden.js +1 -1
- package/lib/catalog/properties/property-lenght-measure.js +5 -6
- package/lib/catalog/properties/property-length-measure.js +7 -13
- package/lib/catalog/properties/property-length-measure_hole.js +5 -6
- package/lib/catalog/properties/property-number.js +1 -1
- package/lib/catalog/properties/property-read-only.js +1 -1
- package/lib/catalog/properties/property-string.js +1 -1
- package/lib/catalog/properties/property-toggle.js +1 -1
- package/lib/catalog/utils/FuseUtils.js +8 -10
- package/lib/catalog/utils/exporter.js +3 -5
- package/lib/catalog/utils/geom-utils.js +1 -1
- package/lib/catalog/utils/item-loader.js +9 -14
- package/lib/class/FuseUtils.js +8 -10
- package/lib/class/area.js +7 -10
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +11 -19
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +5 -8
- package/lib/class/item.js +10 -18
- package/lib/class/layer.js +5 -8
- package/lib/class/line.js +12 -19
- package/lib/class/project.js +8 -10
- package/lib/class/vertex.js +7 -10
- package/lib/components/content.js +2 -2
- package/lib/components/disclaimer/disclaimer.js +1 -1
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +15 -21
- package/lib/components/style/cancel-button.js +5 -6
- package/lib/components/style/content-container.js +3 -6
- package/lib/components/style/content-title.js +8 -11
- package/lib/components/style/delete-button.js +6 -7
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +7 -11
- package/lib/components/style/form-color-input.js +5 -6
- package/lib/components/style/form-label.js +7 -11
- package/lib/components/style/form-number-input.js +13 -18
- package/lib/components/style/form-number-input_2.js +13 -18
- package/lib/components/style/form-select.js +10 -19
- package/lib/components/style/form-slider.js +5 -6
- package/lib/components/style/form-submit-button.js +6 -7
- package/lib/components/style/form-text-input.js +17 -22
- package/lib/components/viewer2d/area.js +1 -1
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer2d/grids/grids.js +4 -9
- package/lib/components/viewer2d/group.js +2 -2
- package/lib/components/viewer2d/item.js +5 -10
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +2 -2
- package/lib/components/viewer2d/ruler.js +1 -1
- package/lib/components/viewer2d/rulerDist.js +1 -1
- package/lib/components/viewer2d/rulerX.js +13 -18
- package/lib/components/viewer2d/rulerY.js +13 -18
- package/lib/components/viewer2d/scene.js +21 -32
- package/lib/components/viewer2d/snap.js +2 -2
- package/lib/components/viewer2d/state.js +5 -10
- package/lib/components/viewer2d/utils.js +5 -9
- package/lib/components/viewer2d/vertex.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +13 -23
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/front3D.js +4 -9
- package/lib/components/viewer3d/grid-creator.js +2 -2
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +1 -1
- package/lib/components/viewer3d/ruler-utils/layer3D.js +1 -1
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +3 -6
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/ruler-utils/state3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +16 -21
- package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +11 -16
- package/lib/components/viewer3d/viewer3d.js +15 -20
- package/lib/index.js +8 -14
- package/lib/models.js +51 -56
- package/lib/plugins/console-debugger.js +3 -6
- package/lib/plugins/export.js +1 -1
- package/lib/reducers/export.js +1 -1
- package/lib/styles/export.js +1 -1
- package/lib/translator/translator.js +5 -9
- package/lib/utils/export.js +2 -2
- package/lib/utils/geometry.js +11 -18
- package/lib/utils/graph-inner-cycles.js +1 -1
- package/lib/utils/graph.js +7 -10
- package/lib/utils/helper.js +7 -7
- package/lib/utils/history.js +1 -1
- package/lib/utils/id-broker.js +5 -8
- package/lib/utils/molding.js +14 -19
- package/lib/utils/name-generator.js +5 -8
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +1 -1
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +14 -14
- package/package.json +24 -18
package/es/utils/molding.js
CHANGED
|
@@ -1,33 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createMonldingGroup = createMonldingGroup;
|
|
9
|
+
exports.getAllMoldingGroups = getAllMoldingGroups;
|
|
10
|
+
exports.getItemGroupFromMolding = getItemGroupFromMolding;
|
|
11
|
+
exports.getItemRect = getItemRect;
|
|
12
|
+
exports.getLinesFromItems = getLinesFromItems;
|
|
13
|
+
exports.getLinesFromItems2 = getLinesFromItems2;
|
|
14
|
+
exports.getLinesOfItem = getLinesOfItem;
|
|
15
|
+
exports.hasMoldingLayout = hasMoldingLayout;
|
|
16
|
+
exports.isEnableItemForMolding = isEnableItemForMolding;
|
|
17
|
+
exports.isItemSameItemByLocation = isItemSameItemByLocation;
|
|
18
|
+
exports.isItemSnappedGroup = isItemSnappedGroup;
|
|
19
|
+
exports.isItemSnappedItem = isItemSnappedItem;
|
|
20
|
+
exports.isLinesOverlapped = isLinesOverlapped;
|
|
21
|
+
exports.isSameMoldingLayoutpos = isSameMoldingLayoutpos;
|
|
22
|
+
exports.mergeOverlappedLines = mergeOverlappedLines;
|
|
23
|
+
exports.sortItemsByDistance = sortItemsByDistance;
|
|
24
|
+
exports.tryMergeMDItem = tryMergeMDItem;
|
|
25
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
26
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
27
|
+
var _constants = require("../constants");
|
|
28
|
+
var Three = _interopRequireWildcard(require("three"));
|
|
29
|
+
var _convertUnitsLite = require("./convert-units-lite");
|
|
30
|
+
var _idBroker = _interopRequireDefault(require("./id-broker"));
|
|
31
|
+
var _utils = require("../components/viewer2d/utils");
|
|
32
|
+
var _export = require("./export");
|
|
33
|
+
var _helper = require("./helper");
|
|
34
|
+
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); }
|
|
2
35
|
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; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
8
|
-
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."); }
|
|
9
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
10
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
36
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
37
|
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; } } }; }
|
|
12
38
|
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; } }
|
|
13
39
|
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; }
|
|
14
|
-
|
|
15
|
-
import * as Three from 'three';
|
|
16
|
-
import { convert } from "./convert-units-lite";
|
|
17
|
-
import IDBroker from "./id-broker";
|
|
18
|
-
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
19
|
-
import { GeometryUtils } from "./export";
|
|
20
|
-
import { isEmpty } from "./helper";
|
|
21
|
-
export function getItemRect(item) {
|
|
40
|
+
function getItemRect(item) {
|
|
22
41
|
var x = item.x;
|
|
23
42
|
var y = item.y;
|
|
24
43
|
var rotRad = item.rotation / 180 * Math.PI;
|
|
25
44
|
var itemWidth = item.properties.get('width').get('_length');
|
|
26
45
|
var itemWidthUnit = item.properties.get('width').get('_unit') || 'cm';
|
|
27
|
-
itemWidth = convert(itemWidth / 2).from(itemWidthUnit).to('cm');
|
|
46
|
+
itemWidth = (0, _convertUnitsLite.convert)(itemWidth / 2).from(itemWidthUnit).to('cm');
|
|
28
47
|
var itemDepth = item.properties.get('depth').get('_length');
|
|
29
48
|
var itemDepthUnit = item.properties.get('depth').get('_unit') || 'cm';
|
|
30
|
-
itemDepth = convert(itemDepth / 2).from(itemDepthUnit).to('cm');
|
|
49
|
+
itemDepth = (0, _convertUnitsLite.convert)(itemDepth / 2).from(itemDepthUnit).to('cm');
|
|
31
50
|
var mx = x - itemWidth * Math.cos(rotRad);
|
|
32
51
|
var my = y - itemWidth * Math.sin(rotRad);
|
|
33
52
|
var x0 = mx + itemDepth * Math.sin(rotRad);
|
|
@@ -54,17 +73,17 @@ export function getItemRect(item) {
|
|
|
54
73
|
}]
|
|
55
74
|
};
|
|
56
75
|
}
|
|
57
|
-
|
|
76
|
+
function hasMoldingLayout(molding, layoutpos) {
|
|
58
77
|
var types = molding === null || molding === void 0 ? void 0 : molding.molding_type;
|
|
59
78
|
return (Array.isArray(types) || typeof types === 'string') && types.includes(layoutpos);
|
|
60
79
|
}
|
|
61
|
-
|
|
80
|
+
function isEnableItemForMolding(layer, selItem) {
|
|
62
81
|
var molding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
63
|
-
var allLineRects = GeometryUtils.buildRectFromLines(layer, GeometryUtils.getAllLines(layer));
|
|
64
|
-
var result = !isEmpty(selItem) && selItem.category === 'cabinet' && (selItem.layoutpos === BASE_CABINET_LAYOUTPOS && !GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects) || (selItem.layoutpos === WALL_CABINET_LAYOUTPOS || selItem.layoutpos === TALL_CABINET_LAYOUTPOS) && GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects));
|
|
82
|
+
var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
|
|
83
|
+
var result = !(0, _helper.isEmpty)(selItem) && selItem.category === 'cabinet' && (selItem.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && !_export.GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects) || (selItem.layoutpos === _constants.WALL_CABINET_LAYOUTPOS || selItem.layoutpos === _constants.TALL_CABINET_LAYOUTPOS) && _export.GeometryUtils.isSnappedLine(getItemRect(selItem), allLineRects));
|
|
65
84
|
|
|
66
85
|
// check this item is enable for any molding
|
|
67
|
-
if (isEmpty(molding)) return result;
|
|
86
|
+
if ((0, _helper.isEmpty)(molding)) return result;
|
|
68
87
|
// check this item is enable for specified molding
|
|
69
88
|
else return result && hasMoldingLayout(molding, selItem.layoutpos);
|
|
70
89
|
}
|
|
@@ -88,66 +107,66 @@ function getDelta(selRectPos1, selRectPos2, curRectPos1, curRectPos2) {
|
|
|
88
107
|
// GeometryUtils.verticesDistance(curRectPos2, curRectPos1) -
|
|
89
108
|
// GeometryUtils.verticesDistance(selRectPos1, selRectPos2)
|
|
90
109
|
// )
|
|
91
|
-
Math.abs(GeometryUtils.verticesDistance(curRectPos1, selRectPos1) + GeometryUtils.verticesDistance(selRectPos2, curRectPos2) - GeometryUtils.verticesDistance(curRectPos2, curRectPos1) - GeometryUtils.verticesDistance(selRectPos1, selRectPos2))
|
|
110
|
+
Math.abs(_export.GeometryUtils.verticesDistance(curRectPos1, selRectPos1) + _export.GeometryUtils.verticesDistance(selRectPos2, curRectPos2) - _export.GeometryUtils.verticesDistance(curRectPos2, curRectPos1) - _export.GeometryUtils.verticesDistance(selRectPos1, selRectPos2))
|
|
92
111
|
);
|
|
93
112
|
}
|
|
94
|
-
|
|
113
|
+
function isItemSnappedItem(selItem, curItem) {
|
|
95
114
|
var selRect = getItemRect(selItem).rect;
|
|
96
115
|
var curRect = getItemRect(curItem).rect;
|
|
97
|
-
var flag30 = getDelta(selRect[3], selRect[0], curRect[1], curRect[2]) < EPSILON;
|
|
98
|
-
var flag21 = getDelta(selRect[2], selRect[1], curRect[0], curRect[3]) < EPSILON;
|
|
99
|
-
var flag23 = getDelta(selRect[2], selRect[3], curRect[2], curRect[3]) < EPSILON;
|
|
100
|
-
var flag01 = getDelta(selRect[1], selRect[0], curRect[0], curRect[3]) < EPSILON;
|
|
101
|
-
var flag03 = getDelta(selRect[0], selRect[3], curRect[1], curRect[0]) < EPSILON;
|
|
116
|
+
var flag30 = getDelta(selRect[3], selRect[0], curRect[1], curRect[2]) < _constants.EPSILON;
|
|
117
|
+
var flag21 = getDelta(selRect[2], selRect[1], curRect[0], curRect[3]) < _constants.EPSILON;
|
|
118
|
+
var flag23 = getDelta(selRect[2], selRect[3], curRect[2], curRect[3]) < _constants.EPSILON;
|
|
119
|
+
var flag01 = getDelta(selRect[1], selRect[0], curRect[0], curRect[3]) < _constants.EPSILON;
|
|
120
|
+
var flag03 = getDelta(selRect[0], selRect[3], curRect[1], curRect[0]) < _constants.EPSILON;
|
|
102
121
|
return flag30 || flag21 || flag23 || flag01 || flag03;
|
|
103
122
|
}
|
|
104
|
-
|
|
123
|
+
function isItemSnappedGroup(selItem, itemGroup) {
|
|
105
124
|
return itemGroup.some(function (curItem) {
|
|
106
125
|
return isItemSnappedItem(selItem, curItem);
|
|
107
126
|
});
|
|
108
127
|
}
|
|
109
|
-
|
|
128
|
+
function sortItemsByDistance(items, selItem) {
|
|
110
129
|
items.sort(function (a, b) {
|
|
111
|
-
return GeometryUtils.pointsDistance(a.x, a.y, selItem.x, selItem.y) - GeometryUtils.pointsDistance(b.x, b.y, selItem.x, selItem.y);
|
|
130
|
+
return _export.GeometryUtils.pointsDistance(a.x, a.y, selItem.x, selItem.y) - _export.GeometryUtils.pointsDistance(b.x, b.y, selItem.x, selItem.y);
|
|
112
131
|
});
|
|
113
132
|
return items;
|
|
114
133
|
}
|
|
115
|
-
|
|
116
|
-
return curItem.layoutpos === BASE_CABINET_LAYOUTPOS && curItem.layoutpos === item.layoutpos || [WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS].includes(curItem.layoutpos) && [WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS].includes(item.layoutpos);
|
|
134
|
+
function isSameMoldingLayoutpos(curItem, item) {
|
|
135
|
+
return curItem.layoutpos === _constants.BASE_CABINET_LAYOUTPOS && curItem.layoutpos === item.layoutpos || [_constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(curItem.layoutpos) && [_constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(item.layoutpos);
|
|
117
136
|
}
|
|
118
|
-
|
|
137
|
+
function isItemSameItemByLocation(item1, item2, location) {
|
|
119
138
|
var item1Altitude = item1.properties.get('altitude').get('_length');
|
|
120
139
|
var item1AltitudeUnit = item1.properties.get('altitude').get('_unit');
|
|
121
|
-
item1Altitude = convert(item1Altitude).from(item1AltitudeUnit).to('cm');
|
|
140
|
+
item1Altitude = (0, _convertUnitsLite.convert)(item1Altitude).from(item1AltitudeUnit).to('cm');
|
|
122
141
|
var item1Height = item1.properties.get('height').get('_length');
|
|
123
142
|
var item1HeightUnit = item1.properties.get('height').get('_unit');
|
|
124
|
-
item1Height = convert(item1Height).from(item1HeightUnit).to('cm');
|
|
143
|
+
item1Height = (0, _convertUnitsLite.convert)(item1Height).from(item1HeightUnit).to('cm');
|
|
125
144
|
var item2Altitude = item2.properties.get('altitude').get('_length');
|
|
126
145
|
var item2AltitudeUnit = item2.properties.get('altitude').get('_unit');
|
|
127
|
-
item2Altitude = convert(item2Altitude).from(item2AltitudeUnit).to('cm');
|
|
146
|
+
item2Altitude = (0, _convertUnitsLite.convert)(item2Altitude).from(item2AltitudeUnit).to('cm');
|
|
128
147
|
var item2Height = item2.properties.get('height').get('_length');
|
|
129
148
|
var item2HeightUnit = item2.properties.get('height').get('_unit');
|
|
130
|
-
item2Height = convert(item2Height).from(item2HeightUnit).to('cm');
|
|
149
|
+
item2Height = (0, _convertUnitsLite.convert)(item2Height).from(item2HeightUnit).to('cm');
|
|
131
150
|
var flag = false;
|
|
132
151
|
switch (location) {
|
|
133
|
-
case TOP_MOLDING_LOCATION:
|
|
134
|
-
if (GeometryUtils.sameDistances(item1Altitude + item1Height, item2Altitude + item2Height)) flag = true;
|
|
152
|
+
case _constants.TOP_MOLDING_LOCATION:
|
|
153
|
+
if (_export.GeometryUtils.sameDistances(item1Altitude + item1Height, item2Altitude + item2Height)) flag = true;
|
|
135
154
|
break;
|
|
136
|
-
case MIDDLE_MOLDING_LOCATION:
|
|
137
|
-
if (GeometryUtils.sameDistances(item1Altitude + item1Height / 2, item2Altitude + item2Height / 2)) flag = true;
|
|
155
|
+
case _constants.MIDDLE_MOLDING_LOCATION:
|
|
156
|
+
if (_export.GeometryUtils.sameDistances(item1Altitude + item1Height / 2, item2Altitude + item2Height / 2)) flag = true;
|
|
138
157
|
break;
|
|
139
|
-
case BOTTOM_MOLDING_LOCATION:
|
|
140
|
-
if (GeometryUtils.sameDistances(item1Altitude, item2Altitude)) flag = true;
|
|
158
|
+
case _constants.BOTTOM_MOLDING_LOCATION:
|
|
159
|
+
if (_export.GeometryUtils.sameDistances(item1Altitude, item2Altitude)) flag = true;
|
|
141
160
|
break;
|
|
142
161
|
}
|
|
143
162
|
return flag;
|
|
144
163
|
}
|
|
145
|
-
|
|
164
|
+
function tryMergeMDItem(layer, selItem, curItem, itemGroup, molding) {
|
|
146
165
|
return isSameMoldingLayoutpos(selItem, curItem) && isEnableItemForMolding(layer, curItem, molding) && isItemSnappedGroup(curItem, itemGroup) && !itemGroup.some(function (item) {
|
|
147
166
|
return item.id === curItem.id;
|
|
148
167
|
}) && isItemSameItemByLocation(selItem, curItem, molding.location_type);
|
|
149
168
|
}
|
|
150
|
-
|
|
169
|
+
function getItemGroupFromMolding(layer, curItem, molding) {
|
|
151
170
|
var selectedItem = layer.getIn(['items', layer.selected.toJS().items[0]]);
|
|
152
171
|
var itemGroup = [curItem];
|
|
153
172
|
var temp_layer_items = layer.items.toArray().filter(function (item) {
|
|
@@ -174,7 +193,7 @@ function tryMergeItemWithLocation(curItem, itemGroup, location) {
|
|
|
174
193
|
* @param {*} items - Mergable snapped item group, if [items] is null then get all MG array of layer
|
|
175
194
|
* @returns MG array
|
|
176
195
|
*/
|
|
177
|
-
|
|
196
|
+
function getAllMoldingGroups(layer) {
|
|
178
197
|
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
179
198
|
if (items === null) items = layer.items.toArray();
|
|
180
199
|
var MGArray = [];
|
|
@@ -196,7 +215,7 @@ export function getAllMoldingGroups(layer) {
|
|
|
196
215
|
return it.category === 'cabinet' && isSameMoldingLayoutpos(curItem, it) && it.id !== curItem.id;
|
|
197
216
|
});
|
|
198
217
|
temp_items = sortItemsByDistance(temp_items, curItem);
|
|
199
|
-
MOLDING_LOCATIONS.forEach(function (location) {
|
|
218
|
+
_constants.MOLDING_LOCATIONS.forEach(function (location) {
|
|
200
219
|
if (!MGArray.some(function (mg) {
|
|
201
220
|
return mg.items.some(function (it) {
|
|
202
221
|
return it.id === curItem.id;
|
|
@@ -219,7 +238,7 @@ export function getAllMoldingGroups(layer) {
|
|
|
219
238
|
}
|
|
220
239
|
} while (isChangedItemGroup);
|
|
221
240
|
MGArray.push({
|
|
222
|
-
id:
|
|
241
|
+
id: _idBroker["default"].acquireID(),
|
|
223
242
|
items: itemGroup,
|
|
224
243
|
location_type: location,
|
|
225
244
|
molding: null,
|
|
@@ -236,18 +255,18 @@ export function getAllMoldingGroups(layer) {
|
|
|
236
255
|
});
|
|
237
256
|
return MGArray;
|
|
238
257
|
}
|
|
239
|
-
|
|
258
|
+
function getLinesOfItem(item, allLineRects, catalog) {
|
|
240
259
|
var lines = [];
|
|
241
260
|
var outline = null;
|
|
242
261
|
var element = catalog.elements[item.get('type')];
|
|
243
|
-
if (!element) element = catalog.elements[returnReplaceableDeepSearchType(item.get('type'))];
|
|
262
|
+
if (!element) element = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.get('type'))];
|
|
244
263
|
// get edge lines
|
|
245
264
|
var newWidth = item.properties.get('width').get('_length');
|
|
246
265
|
var wUnit = item.properties.get('width').get('_unit') || 'cm';
|
|
247
|
-
newWidth = convert(newWidth).from(wUnit).to('cm');
|
|
266
|
+
newWidth = (0, _convertUnitsLite.convert)(newWidth).from(wUnit).to('cm');
|
|
248
267
|
var newDepth = item.properties.get('depth').get('_length');
|
|
249
268
|
var hUnit = item.properties.get('depth').get('_unit') || 'cm';
|
|
250
|
-
newDepth = convert(newDepth).from(hUnit).to('cm');
|
|
269
|
+
newDepth = (0, _convertUnitsLite.convert)(newDepth).from(hUnit).to('cm');
|
|
251
270
|
if (item) {
|
|
252
271
|
// Get Outline Data of Selected Item
|
|
253
272
|
outline = element.info.outline;
|
|
@@ -282,18 +301,18 @@ export function getLinesOfItem(item, allLineRects, catalog) {
|
|
|
282
301
|
}
|
|
283
302
|
outline.reverse && outlinePoints.reverse();
|
|
284
303
|
for (var i = 0; i < outlinePoints.length - 1; i++) {
|
|
285
|
-
lines.push([GeometryUtils.rotatePointAroundPoint((outlinePoints[i].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), GeometryUtils.rotatePointAroundPoint((outlinePoints[i + 1].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i + 1].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90),
|
|
304
|
+
lines.push([_export.GeometryUtils.rotatePointAroundPoint((outlinePoints[i].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), _export.GeometryUtils.rotatePointAroundPoint((outlinePoints[i + 1].x / outlineWidth - 0.5) * newWidth + item.x, (outlinePoints[i + 1].y / outlineHeight - 0.5) * newDepth + item.y, item.x, item.y, item.rotation + 90), _idBroker["default"].acquireID()]);
|
|
286
305
|
}
|
|
287
306
|
} else {
|
|
288
307
|
var pos = [[-1, -1], [1, -1], [1, 1], [-1, 1]];
|
|
289
308
|
for (var _i = 0; _i < 4; _i++) {
|
|
290
|
-
lines.push([GeometryUtils.rotatePointAroundPoint(pos[_i][0] * newWidth / 2 + item.x, pos[_i][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), GeometryUtils.rotatePointAroundPoint(pos[(_i + 1) % 4][0] * newWidth / 2 + item.x, pos[(_i + 1) % 4][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation),
|
|
309
|
+
lines.push([_export.GeometryUtils.rotatePointAroundPoint(pos[_i][0] * newWidth / 2 + item.x, pos[_i][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), _export.GeometryUtils.rotatePointAroundPoint(pos[(_i + 1) % 4][0] * newWidth / 2 + item.x, pos[(_i + 1) % 4][1] * newDepth / 2 + item.y, item.x, item.y, item.rotation), _idBroker["default"].acquireID()]);
|
|
291
310
|
}
|
|
292
311
|
}
|
|
293
312
|
}
|
|
294
|
-
if (item.layoutpos !== BASE_CABINET_LAYOUTPOS) {
|
|
313
|
+
if (item.layoutpos !== _constants.BASE_CABINET_LAYOUTPOS) {
|
|
295
314
|
lines = lines.filter(function (line) {
|
|
296
|
-
return !GeometryUtils.isSnappedLine({
|
|
315
|
+
return !_export.GeometryUtils.isSnappedLine({
|
|
297
316
|
rect: [{
|
|
298
317
|
x: 0,
|
|
299
318
|
y: 0
|
|
@@ -308,29 +327,29 @@ export function getLinesOfItem(item, allLineRects, catalog) {
|
|
|
308
327
|
}
|
|
309
328
|
function isParallelLines(line1, line2) {
|
|
310
329
|
var isParallel = false;
|
|
311
|
-
if (Math.abs(line1[0].y - line1[1].y) <= EPSILON && Math.abs(line2[0].y - line2[1].y) <= EPSILON) isParallel = true;
|
|
312
|
-
if (Math.abs(line1[0].x - line1[1].x) <= EPSILON && Math.abs(line2[0].x - line2[1].x) <= EPSILON) isParallel = true;
|
|
313
|
-
if (Math.abs((line1[0].x - line1[1].x) / (line1[0].y - line1[1].y) - (line2[0].x - line2[1].x) / (line2[0].y - line2[1].y)) <= EPSILON) isParallel = true;
|
|
330
|
+
if (Math.abs(line1[0].y - line1[1].y) <= _constants.EPSILON && Math.abs(line2[0].y - line2[1].y) <= _constants.EPSILON) isParallel = true;
|
|
331
|
+
if (Math.abs(line1[0].x - line1[1].x) <= _constants.EPSILON && Math.abs(line2[0].x - line2[1].x) <= _constants.EPSILON) isParallel = true;
|
|
332
|
+
if (Math.abs((line1[0].x - line1[1].x) / (line1[0].y - line1[1].y) - (line2[0].x - line2[1].x) / (line2[0].y - line2[1].y)) <= _constants.EPSILON) isParallel = true;
|
|
314
333
|
if (isParallel) {
|
|
315
334
|
return true;
|
|
316
335
|
}
|
|
317
336
|
return false;
|
|
318
337
|
}
|
|
319
|
-
|
|
338
|
+
function isLinesOverlapped(line1, line2) {
|
|
320
339
|
return isParallelLines(line1, line2) && line1.some(function (l1) {
|
|
321
340
|
return line2.some(function (l2) {
|
|
322
|
-
return GeometryUtils.samePoints(l1, l2);
|
|
341
|
+
return _export.GeometryUtils.samePoints(l1, l2);
|
|
323
342
|
});
|
|
324
343
|
});
|
|
325
344
|
}
|
|
326
|
-
|
|
345
|
+
function mergeOverlappedLines(line1, line2) {
|
|
327
346
|
var line1_idx = 0,
|
|
328
347
|
line2_idx = 0;
|
|
329
348
|
line1.forEach(function (l1, idx1) {
|
|
330
349
|
if (idx1 !== line1.length - 1) {
|
|
331
350
|
line2.forEach(function (l2, idx2) {
|
|
332
351
|
if (idx2 !== line2.length - 1) {
|
|
333
|
-
if (GeometryUtils.samePoints(l1, l2)) {
|
|
352
|
+
if (_export.GeometryUtils.samePoints(l1, l2)) {
|
|
334
353
|
line1_idx = idx1;
|
|
335
354
|
line2_idx = idx2;
|
|
336
355
|
}
|
|
@@ -341,9 +360,9 @@ export function mergeOverlappedLines(line1, line2) {
|
|
|
341
360
|
//If line1 's end point and line2 's start point is same, two lines merge into a line with
|
|
342
361
|
//the line1's start point as the start point and line2's end point as the end point.
|
|
343
362
|
if (line1_idx === 1) {
|
|
344
|
-
return [line1[1 - line1_idx], line2[1 - line2_idx],
|
|
363
|
+
return [line1[1 - line1_idx], line2[1 - line2_idx], _idBroker["default"].acquireID()];
|
|
345
364
|
} else {
|
|
346
|
-
return [line2[1 - line2_idx], line1[1 - line1_idx],
|
|
365
|
+
return [line2[1 - line2_idx], line1[1 - line1_idx], _idBroker["default"].acquireID()];
|
|
347
366
|
}
|
|
348
367
|
}
|
|
349
368
|
|
|
@@ -354,12 +373,12 @@ export function mergeOverlappedLines(line1, line2) {
|
|
|
354
373
|
* @param {*} catalog
|
|
355
374
|
* @returns contour line array of moldingGroup items
|
|
356
375
|
*/
|
|
357
|
-
|
|
376
|
+
function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
358
377
|
// wall lines
|
|
359
|
-
var allLineRects = GeometryUtils.buildRectFromLines(layer, GeometryUtils.getAllLines(layer));
|
|
378
|
+
var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
|
|
360
379
|
var MGlines = [];
|
|
361
380
|
var MGlinesOtherSnapped = [];
|
|
362
|
-
var items =
|
|
381
|
+
var items = (0, _toConsumableArray2["default"])(moldingGroup.items);
|
|
363
382
|
// The other item's lines (these items are snapped to the moldingGroup items)
|
|
364
383
|
var itemsOtherSnapped = layer.items.toArray().filter(function (item) {
|
|
365
384
|
if (items.some(function (it) {
|
|
@@ -369,17 +388,17 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
369
388
|
var itemLines = getLinesOfItem(item, allLineRects, catalog);
|
|
370
389
|
var itemAltitude = item.properties.get('altitude').get('_length');
|
|
371
390
|
var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
|
|
372
|
-
itemAltitude = convert(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
391
|
+
itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
373
392
|
var itemHeight = item.properties.get('height').get('_length');
|
|
374
393
|
var itemHeightUnit = item.properties.get('height').get('_unit');
|
|
375
|
-
itemHeight = convert(itemHeight).from(itemHeightUnit).to('cm');
|
|
394
|
+
itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
|
|
376
395
|
itemLines.forEach(function (line) {
|
|
377
396
|
line.push({
|
|
378
397
|
altitude: itemAltitude,
|
|
379
398
|
height: itemHeight
|
|
380
399
|
});
|
|
381
400
|
});
|
|
382
|
-
MGlinesOtherSnapped = [].concat(
|
|
401
|
+
MGlinesOtherSnapped = [].concat((0, _toConsumableArray2["default"])(MGlinesOtherSnapped), (0, _toConsumableArray2["default"])(itemLines));
|
|
383
402
|
return true;
|
|
384
403
|
} else return false;
|
|
385
404
|
});
|
|
@@ -388,10 +407,10 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
388
407
|
items.forEach(function (item) {
|
|
389
408
|
var itemAltitude = item.properties.get('altitude').get('_length');
|
|
390
409
|
var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
|
|
391
|
-
itemAltitude = convert(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
410
|
+
itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
392
411
|
var itemHeight = item.properties.get('height').get('_length');
|
|
393
412
|
var itemHeightUnit = item.properties.get('height').get('_unit');
|
|
394
|
-
itemHeight = convert(itemHeight).from(itemHeightUnit).to('cm');
|
|
413
|
+
itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
|
|
395
414
|
var itemLines = getLinesOfItem(item, allLineRects, catalog);
|
|
396
415
|
|
|
397
416
|
// remove the edge that overlapped with other snapped items
|
|
@@ -406,17 +425,17 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
406
425
|
for (var j = 0; j < MGlinesOtherSnapped.length; j++) {
|
|
407
426
|
var bCheck = false;
|
|
408
427
|
switch (moldingGroup.location_type) {
|
|
409
|
-
case TOP_MOLDING_LOCATION:
|
|
428
|
+
case _constants.TOP_MOLDING_LOCATION:
|
|
410
429
|
bCheck = MGlinesOtherSnapped[j][3].altitude + MGlinesOtherSnapped[j][3].height > itemAltitude + itemHeight;
|
|
411
430
|
break;
|
|
412
|
-
case MIDDLE_MOLDING_LOCATION:
|
|
431
|
+
case _constants.MIDDLE_MOLDING_LOCATION:
|
|
413
432
|
bCheck = true;
|
|
414
433
|
break;
|
|
415
|
-
case BOTTOM_MOLDING_LOCATION:
|
|
434
|
+
case _constants.BOTTOM_MOLDING_LOCATION:
|
|
416
435
|
bCheck = MGlinesOtherSnapped[j][3].altitude < itemAltitude;
|
|
417
436
|
break;
|
|
418
437
|
}
|
|
419
|
-
if (item.category !== 'cabinet' || ![BASE_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS].includes(item.layoutpos)) bCheck = true;
|
|
438
|
+
if (item.category !== 'cabinet' || ![_constants.BASE_CABINET_LAYOUTPOS, _constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(item.layoutpos)) bCheck = true;
|
|
420
439
|
if (bCheck) {
|
|
421
440
|
var destLine = {
|
|
422
441
|
x1: MGlinesOtherSnapped[j][0].x,
|
|
@@ -424,8 +443,8 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
424
443
|
x2: MGlinesOtherSnapped[j][1].x,
|
|
425
444
|
y2: MGlinesOtherSnapped[j][1].y
|
|
426
445
|
};
|
|
427
|
-
var rst = GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
428
|
-
if (rst.result === OVERLAP_SAME || rst.result === OVERLAP_INCLUDED) {
|
|
446
|
+
var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
447
|
+
if (rst.result === _constants.OVERLAP_SAME || rst.result === _constants.OVERLAP_INCLUDED) {
|
|
429
448
|
ret = false;
|
|
430
449
|
break;
|
|
431
450
|
}
|
|
@@ -433,7 +452,7 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
433
452
|
}
|
|
434
453
|
return ret;
|
|
435
454
|
});
|
|
436
|
-
MGlines = [].concat(
|
|
455
|
+
MGlines = [].concat((0, _toConsumableArray2["default"])(MGlines), (0, _toConsumableArray2["default"])(itemLines));
|
|
437
456
|
});
|
|
438
457
|
|
|
439
458
|
// Filtering overlapped edges and get contour edges
|
|
@@ -454,16 +473,16 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
454
473
|
x2: MGlines[j][1].x,
|
|
455
474
|
y2: MGlines[j][1].y
|
|
456
475
|
};
|
|
457
|
-
var rst = GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
458
|
-
if (rst.result === OVERLAP_SAME || rst.result === OVERLAP_INCLUDED) {
|
|
476
|
+
var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
477
|
+
if (rst.result === _constants.OVERLAP_SAME || rst.result === _constants.OVERLAP_INCLUDED) {
|
|
459
478
|
removeLineIds.push(i);
|
|
460
479
|
return 1; // break
|
|
461
|
-
} else if (rst.result === OVERLAP_SOME) {
|
|
480
|
+
} else if (rst.result === _constants.OVERLAP_SOME) {
|
|
462
481
|
removeLineIds.push(i);
|
|
463
482
|
var lineSegs = getTrimmedContourLineSegs(rst.trimmedSegs, MGlines.filter(function (v, idx) {
|
|
464
483
|
return idx !== i && idx !== j;
|
|
465
484
|
}), 0);
|
|
466
|
-
if (lineSegs.length > 0) newLines = [].concat(
|
|
485
|
+
if (lineSegs.length > 0) newLines = [].concat((0, _toConsumableArray2["default"])(newLines), (0, _toConsumableArray2["default"])(lineSegs));
|
|
467
486
|
return 1; // break
|
|
468
487
|
}
|
|
469
488
|
},
|
|
@@ -482,7 +501,7 @@ export function getLinesFromItems2(moldingGroup, layer, catalog) {
|
|
|
482
501
|
return idx === id;
|
|
483
502
|
});
|
|
484
503
|
});
|
|
485
|
-
if (newLines.length > 0) MGlines = [].concat(
|
|
504
|
+
if (newLines.length > 0) MGlines = [].concat((0, _toConsumableArray2["default"])(MGlines), (0, _toConsumableArray2["default"])(newLines));
|
|
486
505
|
|
|
487
506
|
// merge the collinear linked lines to one line
|
|
488
507
|
var newMGlines = [];
|
|
@@ -542,15 +561,15 @@ function getMergedLine(line, MGlines, cnt) {
|
|
|
542
561
|
x2: newMGlines[i][1].x,
|
|
543
562
|
y2: newMGlines[i][1].y
|
|
544
563
|
};
|
|
545
|
-
var rst = GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
546
|
-
if (rst.result === OVERLAP_LINK) {
|
|
564
|
+
var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
565
|
+
if (rst.result === _constants.OVERLAP_LINK) {
|
|
547
566
|
var mergedLine = [{
|
|
548
567
|
x: rst.linkedLine.x1,
|
|
549
568
|
y: rst.linkedLine.y1
|
|
550
569
|
}, {
|
|
551
570
|
x: rst.linkedLine.x2,
|
|
552
571
|
y: rst.linkedLine.y2
|
|
553
|
-
},
|
|
572
|
+
}, _idBroker["default"].acquireID()];
|
|
554
573
|
mergeResult = getMergedLine(mergedLine, newMGlines.filter(function (v, idx) {
|
|
555
574
|
return idx !== i;
|
|
556
575
|
}), cnt);
|
|
@@ -595,15 +614,15 @@ function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
|
|
|
595
614
|
x2: otherLines[j][1].x,
|
|
596
615
|
y2: otherLines[j][1].y
|
|
597
616
|
};
|
|
598
|
-
var rst = GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
599
|
-
if (rst.result == OVERLAP_SAME || rst.result == OVERLAP_INCLUDED) {
|
|
617
|
+
var rst = _export.GeometryUtils.relationshipOfTwoOverlappedLines(srcLine, destLine);
|
|
618
|
+
if (rst.result == _constants.OVERLAP_SAME || rst.result == _constants.OVERLAP_INCLUDED) {
|
|
600
619
|
bContourSeg = false;
|
|
601
620
|
return 0; // break
|
|
602
|
-
} else if (rst.result == OVERLAP_SOME) {
|
|
621
|
+
} else if (rst.result == _constants.OVERLAP_SOME) {
|
|
603
622
|
var tLineSegs = getTrimmedContourLineSegs(rst.trimmedSegs, otherLines.filter(function (v, idx) {
|
|
604
623
|
return idx !== j;
|
|
605
624
|
}), cnt);
|
|
606
|
-
if (tLineSegs.length > 0) returnSegs = [].concat(
|
|
625
|
+
if (tLineSegs.length > 0) returnSegs = [].concat((0, _toConsumableArray2["default"])(returnSegs), (0, _toConsumableArray2["default"])(tLineSegs));
|
|
607
626
|
bContourSeg = false;
|
|
608
627
|
return 0; // break
|
|
609
628
|
}
|
|
@@ -619,7 +638,7 @@ function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
|
|
|
619
638
|
}, {
|
|
620
639
|
x: lineSegs[i].x2,
|
|
621
640
|
y: lineSegs[i].y2
|
|
622
|
-
},
|
|
641
|
+
}, _idBroker["default"].acquireID()]);
|
|
623
642
|
}
|
|
624
643
|
return returnSegs;
|
|
625
644
|
} catch (e) {
|
|
@@ -627,9 +646,9 @@ function getTrimmedContourLineSegs(lineSegs, otherLines, cnt) {
|
|
|
627
646
|
return [];
|
|
628
647
|
}
|
|
629
648
|
}
|
|
630
|
-
|
|
631
|
-
var allLineRects = GeometryUtils.buildRectFromLines(layer, GeometryUtils.getAllLines(layer));
|
|
632
|
-
var items =
|
|
649
|
+
function getLinesFromItems(moldingGroup, layer, catalog) {
|
|
650
|
+
var allLineRects = _export.GeometryUtils.buildRectFromLines(layer, _export.GeometryUtils.getAllLines(layer));
|
|
651
|
+
var items = (0, _toConsumableArray2["default"])(moldingGroup.items);
|
|
633
652
|
var MGlines = getLinesOfItem(items[0], allLineRects, catalog);
|
|
634
653
|
items = sortItemsByDistance(items, items[0]);
|
|
635
654
|
var _loop7 = function _loop7() {
|
|
@@ -641,7 +660,7 @@ export function getLinesFromItems(moldingGroup, layer, catalog) {
|
|
|
641
660
|
});
|
|
642
661
|
var curItemLine = itemLines[idx];
|
|
643
662
|
if (idx > -1) {
|
|
644
|
-
if (!(GeometryUtils.samePoints(line[0], curItemLine[0]) && GeometryUtils.samePoints(line[1], curItemLine[1]) || GeometryUtils.samePoints(line[0], curItemLine[1]) && GeometryUtils.samePoints(line[1], curItemLine[0]))) {
|
|
663
|
+
if (!(_export.GeometryUtils.samePoints(line[0], curItemLine[0]) && _export.GeometryUtils.samePoints(line[1], curItemLine[1]) || _export.GeometryUtils.samePoints(line[0], curItemLine[1]) && _export.GeometryUtils.samePoints(line[1], curItemLine[0]))) {
|
|
645
664
|
var MGLine = mergeOverlappedLines(line, curItemLine);
|
|
646
665
|
temp_MGLines.push(MGLine);
|
|
647
666
|
}
|
|
@@ -668,29 +687,29 @@ export function getLinesFromItems(moldingGroup, layer, catalog) {
|
|
|
668
687
|
snapped_other_items.forEach(function (item) {
|
|
669
688
|
var itemAltitude = item.properties.get('altitude').get('_length');
|
|
670
689
|
var itemAltitudeUnit = item.properties.get('altitude').get('_unit');
|
|
671
|
-
itemAltitude = convert(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
690
|
+
itemAltitude = (0, _convertUnitsLite.convert)(itemAltitude).from(itemAltitudeUnit).to('cm');
|
|
672
691
|
var itemHeight = item.properties.get('height').get('_length');
|
|
673
692
|
var itemHeightUnit = item.properties.get('height').get('_unit');
|
|
674
|
-
itemHeight = convert(itemHeight).from(itemHeightUnit).to('cm');
|
|
693
|
+
itemHeight = (0, _convertUnitsLite.convert)(itemHeight).from(itemHeightUnit).to('cm');
|
|
675
694
|
var mgroupAltitude = items[0].properties.get('altitude').get('_length');
|
|
676
695
|
var mgroupAltitudeUnit = items[0].properties.get('altitude').get('_unit');
|
|
677
|
-
mgroupAltitude = convert(mgroupAltitude).from(mgroupAltitudeUnit).to('cm');
|
|
696
|
+
mgroupAltitude = (0, _convertUnitsLite.convert)(mgroupAltitude).from(mgroupAltitudeUnit).to('cm');
|
|
678
697
|
var mgroupHeight = items[0].properties.get('height').get('_length');
|
|
679
698
|
var mgroupHeightUnit = items[0].properties.get('height').get('_unit');
|
|
680
|
-
mgroupHeight = convert(mgroupHeight).from(mgroupHeightUnit).to('cm');
|
|
699
|
+
mgroupHeight = (0, _convertUnitsLite.convert)(mgroupHeight).from(mgroupHeightUnit).to('cm');
|
|
681
700
|
var flag = false;
|
|
682
701
|
switch (moldingGroup.location_type) {
|
|
683
|
-
case TOP_MOLDING_LOCATION:
|
|
702
|
+
case _constants.TOP_MOLDING_LOCATION:
|
|
684
703
|
flag = itemAltitude + itemHeight > mgroupAltitude + mgroupHeight;
|
|
685
704
|
break;
|
|
686
|
-
case MIDDLE_MOLDING_LOCATION:
|
|
705
|
+
case _constants.MIDDLE_MOLDING_LOCATION:
|
|
687
706
|
flag = true;
|
|
688
707
|
break;
|
|
689
|
-
case BOTTOM_MOLDING_LOCATION:
|
|
708
|
+
case _constants.BOTTOM_MOLDING_LOCATION:
|
|
690
709
|
flag = itemAltitude < mgroupAltitude;
|
|
691
710
|
break;
|
|
692
711
|
}
|
|
693
|
-
if (item.category !== 'cabinet' || ![BASE_CABINET_LAYOUTPOS, WALL_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS].includes(item.layoutpos)) flag = true;
|
|
712
|
+
if (item.category !== 'cabinet' || ![_constants.BASE_CABINET_LAYOUTPOS, _constants.WALL_CABINET_LAYOUTPOS, _constants.TALL_CABINET_LAYOUTPOS].includes(item.layoutpos)) flag = true;
|
|
694
713
|
if (flag) {
|
|
695
714
|
var itemLines = getLinesOfItem(item, allLineRects, catalog);
|
|
696
715
|
var temp_MGLines = [];
|
|
@@ -700,8 +719,8 @@ export function getLinesFromItems(moldingGroup, layer, catalog) {
|
|
|
700
719
|
});
|
|
701
720
|
var curITL = itemLines[idx];
|
|
702
721
|
if (idx > -1) {
|
|
703
|
-
if (getDelta(mgl[0], mgl[1], curITL[1], curITL[0]) < EPSILON || getDelta(mgl[0], mgl[1], curITL[0], curITL[1]) < EPSILON) {
|
|
704
|
-
if (GeometryUtils.verticesDistance(mgl[0], mgl[1]) > GeometryUtils.verticesDistance(curITL[0], curITL[1])) {
|
|
722
|
+
if (getDelta(mgl[0], mgl[1], curITL[1], curITL[0]) < _constants.EPSILON || getDelta(mgl[0], mgl[1], curITL[0], curITL[1]) < _constants.EPSILON) {
|
|
723
|
+
if (_export.GeometryUtils.verticesDistance(mgl[0], mgl[1]) > _export.GeometryUtils.verticesDistance(curITL[0], curITL[1])) {
|
|
705
724
|
var MGLine = mergeOverlappedLines(mgl, curITL);
|
|
706
725
|
temp_MGLines.push(MGLine);
|
|
707
726
|
}
|
|
@@ -763,7 +782,7 @@ function getMDPoints(newMD) {
|
|
|
763
782
|
});
|
|
764
783
|
|
|
765
784
|
// get vertex points
|
|
766
|
-
var MDlines =
|
|
785
|
+
var MDlines = (0, _toConsumableArray2["default"])(newMD.lines);
|
|
767
786
|
var pointGroups = [[]];
|
|
768
787
|
var flag = 1;
|
|
769
788
|
var i = 0;
|
|
@@ -775,10 +794,10 @@ function getMDPoints(newMD) {
|
|
|
775
794
|
if (flag) {
|
|
776
795
|
var lastPoint = pointGroups[i][pointGroups[i].length - 1];
|
|
777
796
|
var res = MDlines.findIndex(function (a) {
|
|
778
|
-
return GeometryUtils.samePoints({
|
|
797
|
+
return _export.GeometryUtils.samePoints({
|
|
779
798
|
x: a[0].x - cPos.x,
|
|
780
799
|
y: a[0].y - cPos.y
|
|
781
|
-
}, lastPoint) || GeometryUtils.samePoints({
|
|
800
|
+
}, lastPoint) || _export.GeometryUtils.samePoints({
|
|
782
801
|
x: a[1].x - cPos.x,
|
|
783
802
|
y: a[1].y - cPos.y
|
|
784
803
|
}, lastPoint);
|
|
@@ -788,7 +807,7 @@ function getMDPoints(newMD) {
|
|
|
788
807
|
x: MDlines[res][0].x - cPos.x,
|
|
789
808
|
y: MDlines[res][0].y - cPos.y
|
|
790
809
|
};
|
|
791
|
-
if (GeometryUtils.samePoints(newPos, lastPoint)) {
|
|
810
|
+
if (_export.GeometryUtils.samePoints(newPos, lastPoint)) {
|
|
792
811
|
newPos = {
|
|
793
812
|
x: MDlines[res][1].x - cPos.x,
|
|
794
813
|
y: MDlines[res][1].y - cPos.y
|
|
@@ -802,10 +821,10 @@ function getMDPoints(newMD) {
|
|
|
802
821
|
} else {
|
|
803
822
|
var firstPoint = pointGroups[i][0];
|
|
804
823
|
var _res = MDlines.findIndex(function (a) {
|
|
805
|
-
return GeometryUtils.samePoints({
|
|
824
|
+
return _export.GeometryUtils.samePoints({
|
|
806
825
|
x: a[0].x - cPos.x,
|
|
807
826
|
y: a[0].y - cPos.y
|
|
808
|
-
}, firstPoint) || GeometryUtils.samePoints({
|
|
827
|
+
}, firstPoint) || _export.GeometryUtils.samePoints({
|
|
809
828
|
x: a[1].x - cPos.x,
|
|
810
829
|
y: a[1].y - cPos.y
|
|
811
830
|
}, firstPoint);
|
|
@@ -815,13 +834,13 @@ function getMDPoints(newMD) {
|
|
|
815
834
|
x: MDlines[_res][0].x - cPos.x,
|
|
816
835
|
y: MDlines[_res][0].y - cPos.y
|
|
817
836
|
};
|
|
818
|
-
if (GeometryUtils.samePoints(_newPos, firstPoint)) {
|
|
837
|
+
if (_export.GeometryUtils.samePoints(_newPos, firstPoint)) {
|
|
819
838
|
_newPos = {
|
|
820
839
|
x: MDlines[_res][1].x - cPos.x,
|
|
821
840
|
y: MDlines[_res][1].y - cPos.y
|
|
822
841
|
};
|
|
823
842
|
}
|
|
824
|
-
pointGroups[i] = [new Three.Vector2(_newPos.x, _newPos.y)].concat(
|
|
843
|
+
pointGroups[i] = [new Three.Vector2(_newPos.x, _newPos.y)].concat((0, _toConsumableArray2["default"])(pointGroups[i]));
|
|
825
844
|
MDlines.splice(_res, 1);
|
|
826
845
|
} else {
|
|
827
846
|
flag = 1;
|
|
@@ -836,18 +855,18 @@ function getMDPoints(newMD) {
|
|
|
836
855
|
}
|
|
837
856
|
var z = newMD.items[0].properties.get('altitude').get('_length');
|
|
838
857
|
var zUnit = newMD.items[0].properties.get('altitude').get('_unit') || 'cm';
|
|
839
|
-
z = convert(z).from(zUnit).to('cm');
|
|
858
|
+
z = (0, _convertUnitsLite.convert)(z).from(zUnit).to('cm');
|
|
840
859
|
var height = newMD.items[0].properties.get('height').get('_length');
|
|
841
860
|
var heightUnit = newMD.items[0].properties.get('height').get('_unit') || 'cm';
|
|
842
|
-
height = convert(height).from(heightUnit).to('cm');
|
|
861
|
+
height = (0, _convertUnitsLite.convert)(height).from(heightUnit).to('cm');
|
|
843
862
|
switch (newMD.location_type) {
|
|
844
|
-
case TOP_MOLDING_LOCATION:
|
|
863
|
+
case _constants.TOP_MOLDING_LOCATION:
|
|
845
864
|
z += height;
|
|
846
865
|
break;
|
|
847
|
-
case MIDDLE_MOLDING_LOCATION:
|
|
866
|
+
case _constants.MIDDLE_MOLDING_LOCATION:
|
|
848
867
|
z += height / 2;
|
|
849
868
|
break;
|
|
850
|
-
case BOTTOM_MOLDING_LOCATION:
|
|
869
|
+
case _constants.BOTTOM_MOLDING_LOCATION:
|
|
851
870
|
z += 0;
|
|
852
871
|
break;
|
|
853
872
|
default:
|
|
@@ -861,7 +880,7 @@ function getMDPoints(newMD) {
|
|
|
861
880
|
size: newSize
|
|
862
881
|
});
|
|
863
882
|
}
|
|
864
|
-
|
|
883
|
+
function createMonldingGroup(oldMG, layer, molding, catalog) {
|
|
865
884
|
var newMG = _objectSpread({}, oldMG);
|
|
866
885
|
newMG.molding = molding;
|
|
867
886
|
newMG.lines = getLinesFromItems2(oldMG, layer, catalog);
|