kitchen-simulator 1.1.1-test.62 → 1.1.1-test.63
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 +2 -10
- package/es/AppContext.js +3 -10
- package/es/KitchenConfigurator.js +70 -79
- package/es/KitchenConfiguratorApp.js +98 -107
- package/es/actions/area-actions.js +5 -12
- package/es/actions/export.js +12 -29
- package/es/actions/groups-actions.js +27 -45
- package/es/actions/holes-actions.js +34 -55
- package/es/actions/items-actions.js +94 -145
- package/es/actions/lines-actions.js +21 -36
- package/es/actions/project-actions.js +94 -145
- package/es/actions/scene-actions.js +11 -21
- package/es/actions/vertices-actions.js +7 -15
- package/es/actions/viewer2d-actions.js +21 -36
- package/es/actions/viewer3d-actions.js +9 -18
- package/es/catalog/areas/area/planner-element.js +2 -9
- package/es/catalog/catalog.js +15 -21
- package/es/catalog/factories/area-factory-3d.js +22 -31
- package/es/catalog/factories/area-factory.js +11 -20
- package/es/catalog/factories/export.js +6 -24
- package/es/catalog/factories/wall-factory-3d.js +31 -41
- package/es/catalog/factories/wall-factory.js +21 -31
- package/es/catalog/holes/door-closet/planner-element.js +15 -24
- package/es/catalog/holes/door-double/planner-element.js +15 -24
- package/es/catalog/holes/door-exterior/planner-element.js +16 -25
- package/es/catalog/holes/door-interior/planner-element.js +16 -25
- package/es/catalog/holes/door-panic/planner-element.js +7 -16
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -24
- package/es/catalog/holes/door-sliding/planner-element.js +16 -25
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -20
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -16
- package/es/catalog/holes/export.js +13 -97
- package/es/catalog/holes/window-clear/planner-element.js +10 -19
- package/es/catalog/holes/window-cross/planner-element.js +10 -19
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -19
- package/es/catalog/holes/window-vertical/planner-element.js +10 -19
- package/es/catalog/lines/wall/planner-element.js +2 -9
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -14
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -14
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -14
- package/es/catalog/properties/export.js +20 -80
- package/es/catalog/properties/property-checkbox.js +24 -31
- package/es/catalog/properties/property-color.js +16 -23
- package/es/catalog/properties/property-enum.js +24 -31
- package/es/catalog/properties/property-hidden.js +9 -16
- package/es/catalog/properties/property-lenght-measure.js +38 -45
- package/es/catalog/properties/property-length-measure.js +36 -43
- package/es/catalog/properties/property-length-measure_hole.js +38 -45
- package/es/catalog/properties/property-number.js +17 -24
- package/es/catalog/properties/property-read-only.js +16 -23
- package/es/catalog/properties/property-string.js +16 -23
- package/es/catalog/properties/property-toggle.js +16 -23
- package/es/catalog/properties/shared-property-style.js +1 -7
- package/es/catalog/utils/FuseUtils.js +8 -15
- package/es/catalog/utils/exporter.js +8 -15
- package/es/catalog/utils/geom-utils.js +13 -29
- package/es/catalog/utils/item-loader.js +84 -97
- package/es/catalog/utils/load-obj.js +20 -28
- package/es/catalog/utils/mtl-loader.js +3 -8
- package/es/catalog/utils/obj-loader.js +3 -8
- package/es/class/FuseUtils.js +8 -15
- package/es/class/area.js +22 -28
- package/es/class/export.js +23 -95
- package/es/class/group.js +53 -59
- package/es/class/guide.js +15 -21
- package/es/class/hole.js +83 -89
- package/es/class/item.js +141 -147
- package/es/class/layer.js +59 -65
- package/es/class/line.js +135 -143
- package/es/class/project.js +90 -98
- package/es/class/vertex.js +29 -35
- package/es/components/content.js +19 -28
- package/es/components/disclaimer/disclaimer.js +10 -18
- package/es/components/export.js +8 -32
- package/es/components/style/button.js +23 -31
- package/es/components/style/cancel-button.js +7 -14
- package/es/components/style/content-container.js +9 -16
- package/es/components/style/content-title.js +11 -20
- package/es/components/style/delete-button.js +8 -17
- package/es/components/style/export.js +30 -120
- package/es/components/style/form-block.js +8 -15
- package/es/components/style/form-color-input.js +7 -14
- package/es/components/style/form-label.js +8 -15
- package/es/components/style/form-number-input.js +41 -49
- package/es/components/style/form-number-input_2.js +36 -44
- package/es/components/style/form-select.js +17 -24
- package/es/components/style/form-slider.js +10 -17
- package/es/components/style/form-submit-button.js +8 -17
- package/es/components/style/form-text-input.js +26 -34
- package/es/components/viewer2d/area.js +17 -24
- package/es/components/viewer2d/export.js +30 -120
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -17
- package/es/components/viewer2d/grids/grid-streak.js +10 -17
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -17
- package/es/components/viewer2d/grids/grids.js +10 -19
- package/es/components/viewer2d/group.js +15 -24
- package/es/components/viewer2d/item.js +61 -70
- package/es/components/viewer2d/layer.js +23 -30
- package/es/components/viewer2d/line.js +101 -111
- package/es/components/viewer2d/ruler.js +22 -29
- package/es/components/viewer2d/rulerDist.js +21 -28
- package/es/components/viewer2d/rulerX.js +39 -47
- package/es/components/viewer2d/rulerY.js +37 -45
- package/es/components/viewer2d/scene.js +30 -38
- package/es/components/viewer2d/snap.js +13 -22
- package/es/components/viewer2d/state.js +18 -27
- package/es/components/viewer2d/utils.js +24 -37
- package/es/components/viewer2d/vertex.js +8 -17
- package/es/components/viewer2d/viewer2d.js +153 -163
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +17 -23
- package/es/components/viewer3d/dcm.js +1 -7
- package/es/components/viewer3d/fbm.js +1 -7
- package/es/components/viewer3d/front3D.js +12 -21
- package/es/components/viewer3d/grid-creator.js +8 -17
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -14
- package/es/components/viewer3d/grids/grid-streak.js +5 -13
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -14
- package/es/components/viewer3d/libs/first-person-controls.js +2 -9
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -7
- package/es/components/viewer3d/libs/mtl-loader.js +1 -7
- package/es/components/viewer3d/libs/obj-loader.js +1 -7
- package/es/components/viewer3d/libs/orbit-controls.js +2 -8
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -8
- package/es/components/viewer3d/lrm.js +1 -7
- package/es/components/viewer3d/model.js +1 -7
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -10
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -25
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -66
- package/es/components/viewer3d/ruler-utils/ruler3D.js +39 -46
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -17
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -11
- package/es/components/viewer3d/scene-creator.js +191 -226
- package/es/components/viewer3d/three-memory-cleaner.js +3 -12
- package/es/components/viewer3d/viewer3d-first-person.js +40 -46
- package/es/components/viewer3d/viewer3d.js +196 -202
- package/es/constants.js +349 -358
- package/es/index.js +7 -15
- package/es/models.js +177 -184
- package/es/plugins/SVGLoader.js +48 -53
- package/es/plugins/autosave.js +3 -9
- package/es/plugins/console-debugger.js +5 -12
- package/es/plugins/export.js +8 -32
- package/es/plugins/keyboard.js +29 -35
- package/es/reducers/areas-reducer.js +7 -13
- package/es/reducers/export.js +24 -96
- package/es/reducers/groups-reducer.js +31 -37
- package/es/reducers/holes-reducer.js +43 -49
- package/es/reducers/items-reducer.js +106 -112
- package/es/reducers/lines-reducer.js +28 -34
- package/es/reducers/project-reducer.js +105 -111
- package/es/reducers/reducer.js +16 -23
- package/es/reducers/scene-reducer.js +15 -21
- package/es/reducers/user-reducer.js +5 -11
- package/es/reducers/vertices-reducer.js +11 -17
- package/es/reducers/viewer2d-reducer.js +18 -24
- package/es/reducers/viewer3d-reducer.js +16 -22
- package/es/shared-style.js +10 -16
- package/es/styles/export.js +3 -11
- package/es/translator/en.js +1 -7
- package/es/translator/it.js +1 -7
- package/es/translator/ru.js +1 -7
- package/es/translator/translator.js +13 -19
- package/es/utils/browser.js +2 -9
- package/es/utils/convert-units-lite.js +1 -7
- package/es/utils/email-validator.js +1 -7
- package/es/utils/export.js +15 -46
- package/es/utils/geometry.js +181 -278
- package/es/utils/get-edges-of-subgraphs.js +2 -9
- package/es/utils/graph-cycles.js +8 -11
- package/es/utils/graph-inner-cycles.js +10 -18
- package/es/utils/graph.js +9 -17
- package/es/utils/helper.js +39 -63
- package/es/utils/history.js +8 -15
- package/es/utils/id-broker.js +8 -15
- package/es/utils/logger.js +1 -7
- package/es/utils/math.js +5 -12
- package/es/utils/molding.js +119 -144
- package/es/utils/name-generator.js +7 -13
- package/es/utils/objects-utils.js +7 -19
- package/es/utils/phone-validator.js +1 -7
- package/es/utils/process-black-list.js +3 -10
- package/es/utils/react-if.js +6 -12
- package/es/utils/snap-scene.js +27 -34
- package/es/utils/snap.js +45 -59
- package/es/utils/summarizeCart.js +1 -7
- package/es/utils/threeCSG.es6.js +13 -22
- package/es/version.js +1 -7
- package/package.json +1 -1
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = PropertyToggle;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _export = require("../../components/style/export");
|
|
11
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
12
|
-
function PropertyToggle(_ref) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel, Button } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
export default function PropertyToggle(_ref) {
|
|
13
6
|
var value = _ref.value,
|
|
14
7
|
onUpdate = _ref.onUpdate,
|
|
15
8
|
configs = _ref.configs,
|
|
@@ -24,12 +17,12 @@ function PropertyToggle(_ref) {
|
|
|
24
17
|
}
|
|
25
18
|
return onUpdate(val);
|
|
26
19
|
};
|
|
27
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
28
21
|
className: "PropertyToggle",
|
|
29
|
-
style:
|
|
30
|
-
}, /*#__PURE__*/
|
|
31
|
-
style:
|
|
32
|
-
}, /*#__PURE__*/
|
|
22
|
+
style: PropertyStyle.tableStyle
|
|
23
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
24
|
+
style: PropertyStyle.firstTdStyle
|
|
25
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, configs.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Button, {
|
|
33
26
|
onClick: function onClick(e) {
|
|
34
27
|
return update(!value);
|
|
35
28
|
},
|
|
@@ -37,10 +30,10 @@ function PropertyToggle(_ref) {
|
|
|
37
30
|
}, configs.actionName)))));
|
|
38
31
|
}
|
|
39
32
|
PropertyToggle.propTypes = {
|
|
40
|
-
value:
|
|
41
|
-
onUpdate:
|
|
42
|
-
configs:
|
|
43
|
-
sourceElement:
|
|
44
|
-
internalState:
|
|
45
|
-
state:
|
|
33
|
+
value: PropTypes.any.isRequired,
|
|
34
|
+
onUpdate: PropTypes.func.isRequired,
|
|
35
|
+
configs: PropTypes.object.isRequired,
|
|
36
|
+
sourceElement: PropTypes.object,
|
|
37
|
+
internalState: PropTypes.object,
|
|
38
|
+
state: PropTypes.object.isRequired
|
|
46
39
|
};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
1
|
var tableStyle = {
|
|
8
2
|
width: '100%',
|
|
9
3
|
borderSpacing: '2px 0',
|
|
@@ -17,4 +11,4 @@ var PropertyStyle = {
|
|
|
17
11
|
tableStyle: tableStyle,
|
|
18
12
|
firstTdStyle: firstTdStyle
|
|
19
13
|
};
|
|
20
|
-
|
|
14
|
+
export default PropertyStyle;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
11
4
|
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
5
|
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
6
|
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
7
|
var FuseUtils = /*#__PURE__*/function () {
|
|
15
8
|
function FuseUtils() {
|
|
16
|
-
(
|
|
9
|
+
_classCallCheck(this, FuseUtils);
|
|
17
10
|
}
|
|
18
|
-
return (
|
|
11
|
+
return _createClass(FuseUtils, null, [{
|
|
19
12
|
key: "filterArrayByString",
|
|
20
13
|
value: function filterArrayByString(mainArr, searchText) {
|
|
21
14
|
var _this = this;
|
|
@@ -44,7 +37,7 @@ var FuseUtils = /*#__PURE__*/function () {
|
|
|
44
37
|
return true;
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
if ((
|
|
40
|
+
if (_typeof(value) === 'object') {
|
|
48
41
|
if (this.searchInObj(value, searchText)) {
|
|
49
42
|
return true;
|
|
50
43
|
}
|
|
@@ -64,7 +57,7 @@ var FuseUtils = /*#__PURE__*/function () {
|
|
|
64
57
|
return true;
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
|
-
if ((
|
|
60
|
+
if (_typeof(value) === 'object') {
|
|
68
61
|
if (this.searchInObj(value, searchText)) {
|
|
69
62
|
return true;
|
|
70
63
|
}
|
|
@@ -83,4 +76,4 @@ var FuseUtils = /*#__PURE__*/function () {
|
|
|
83
76
|
}
|
|
84
77
|
}]);
|
|
85
78
|
}();
|
|
86
|
-
|
|
79
|
+
export default FuseUtils;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = _default;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
2
|
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; }
|
|
11
|
-
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) { (
|
|
12
|
-
|
|
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) { _defineProperty(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; }
|
|
4
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
5
|
+
export default function (_ref) {
|
|
13
6
|
var itemID = _ref.itemID,
|
|
14
7
|
type = _ref.type,
|
|
15
8
|
long_name = _ref.long_name,
|
|
@@ -39,7 +32,7 @@ function _default(_ref) {
|
|
|
39
32
|
defaultValue: {
|
|
40
33
|
_length: sizeinfo.width,
|
|
41
34
|
_unit: 'in',
|
|
42
|
-
length:
|
|
35
|
+
length: convert(sizeinfo.width).from('in').to('cm')
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
38
|
};
|
|
@@ -52,7 +45,7 @@ function _default(_ref) {
|
|
|
52
45
|
defaultValue: {
|
|
53
46
|
_length: sizeinfo.width,
|
|
54
47
|
_unit: 'in',
|
|
55
|
-
length:
|
|
48
|
+
length: convert(sizeinfo.width).from('in').to('cm')
|
|
56
49
|
}
|
|
57
50
|
},
|
|
58
51
|
depth: {
|
|
@@ -61,7 +54,7 @@ function _default(_ref) {
|
|
|
61
54
|
defaultValue: {
|
|
62
55
|
_length: sizeinfo.depth,
|
|
63
56
|
_unit: 'in',
|
|
64
|
-
length:
|
|
57
|
+
length: convert(sizeinfo.depth).from('in').to('cm')
|
|
65
58
|
}
|
|
66
59
|
},
|
|
67
60
|
height: {
|
|
@@ -70,7 +63,7 @@ function _default(_ref) {
|
|
|
70
63
|
defaultValue: {
|
|
71
64
|
_length: sizeinfo.height,
|
|
72
65
|
_unit: 'in',
|
|
73
|
-
length:
|
|
66
|
+
length: convert(sizeinfo.height).from('in').to('cm')
|
|
74
67
|
}
|
|
75
68
|
}
|
|
76
69
|
};
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.addShape = addShape;
|
|
8
|
-
exports.baseBox3FromObject = baseBox3FromObject;
|
|
9
|
-
exports.baseBoxHelper = baseBoxHelper;
|
|
10
|
-
exports.controlGeom = controlGeom;
|
|
11
|
-
exports.createRotShape = createRotShape;
|
|
12
|
-
exports.emptyBoxHolder = emptyBoxHolder;
|
|
13
|
-
exports.makeMBoxfromObject = makeMBoxfromObject;
|
|
14
|
-
exports.rotGeoms = rotGeoms;
|
|
15
|
-
exports.upwardsGeom = upwardsGeom;
|
|
16
|
-
var Three = _interopRequireWildcard(require("three"));
|
|
17
|
-
var _constants = require("../../constants");
|
|
18
|
-
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); }
|
|
19
|
-
function controlGeom() {
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { OBJTYPE_MESH } from "../../constants";
|
|
3
|
+
export function controlGeom() {
|
|
20
4
|
var vertices = new Float32Array([0, 0.02, 0.55, -0.08, 0, 0.5, -0.05, 0, 0.5, -0.05, 0, -0.5, -0.08, 0, -0.5, 0, 0.02, -0.55, 0.08, 0, -0.5, 0.05, 0, -0.5, 0.05, 0, 0.5, 0.08, 0, 0.5, 0, 0.02, 0.55, -0.08, 0.04, 0.5, -0.05, 0.04, 0.5, -0.05, 0.04, -0.5, -0.08, 0.04, -0.5, 0, 0.02, -0.55, 0.08, 0.04, -0.5, 0.05, 0.04, -0.5, 0.05, 0.04, 0.5, 0.08, 0.04, 0.5, 0, 0.02, 0.55]);
|
|
21
5
|
var indices = new Uint16Array([0, 1, 9, 4, 5, 6, 2, 3, 8, 3, 7, 8, 10, 11, 19, 14, 15, 16, 12, 13, 18, 13, 17, 18, 10, 1, 11, 10, 9, 19, 1, 2, 11, 2, 12, 11, 8, 9, 18, 9, 18, 19, 12, 2, 3, 12, 3, 13, 17, 7, 8, 17, 8, 18, 5, 4, 14, 15, 6, 16]);
|
|
22
6
|
var geometry = new Three.BufferGeometry();
|
|
@@ -24,7 +8,7 @@ function controlGeom() {
|
|
|
24
8
|
geometry.setIndex(new Three.BufferAttribute(indices, 1));
|
|
25
9
|
return geometry;
|
|
26
10
|
}
|
|
27
|
-
function upwardsGeom() {
|
|
11
|
+
export function upwardsGeom() {
|
|
28
12
|
var vertices = new Float32Array([0.05, 0, 0.05, 0.05, 0.3, 0.05, 0.07, 0.3, 0.05, 0, 0.4, 0.05, -0.07, 0.3, 0.05, -0.05, 0.3, 0.05, -0.05, 0, 0.05, 0.05, 0, 0.05, 0.05, 0, -0.05, 0.05, 0.3, -0.05, 0.07, 0.3, -0.05, 0, 0.4, -0.05, -0.07, 0.3, -0.05, -0.05, 0.3, -0.05, -0.05, 0, -0.05, 0.05, 0, -0.05]);
|
|
29
13
|
var indices = new Uint16Array([0, 1, 5, 0, 5, 6, 2, 3, 4, 0, 1, 8, 1, 8, 9, 1, 2, 9, 2, 9, 10, 2, 3, 10, 3, 10, 11, 3, 4, 11, 4, 11, 12, 4, 5, 12, 4, 12, 13, 5, 6, 13, 6, 13, 14, 6, 7, 14, 7, 14, 15, 8, 9, 13, 8, 13, 14, 10, 11, 12]);
|
|
30
14
|
var geometry = new Three.BufferGeometry();
|
|
@@ -32,7 +16,7 @@ function upwardsGeom() {
|
|
|
32
16
|
geometry.setIndex(new Three.BufferAttribute(indices, 1));
|
|
33
17
|
return geometry;
|
|
34
18
|
}
|
|
35
|
-
function createRotShape(radius) {
|
|
19
|
+
export function createRotShape(radius) {
|
|
36
20
|
var rotShape = new Three.Shape();
|
|
37
21
|
rotShape.moveTo(Math.cos(-60 / 180 * Math.PI) * (radius - 0.05), Math.sin(-60 / 180 * Math.PI) * (radius - 0.05));
|
|
38
22
|
for (var i = -55; i <= 60; i += 5) {
|
|
@@ -61,7 +45,7 @@ function createRotShape(radius) {
|
|
|
61
45
|
rotShape.lineTo(Math.cos(-60 / 180 * Math.PI) * (radius - 0.05), Math.sin(-60 / 180 * Math.PI) * (radius - 0.05));
|
|
62
46
|
return rotShape;
|
|
63
47
|
}
|
|
64
|
-
function rotGeoms(radius) {
|
|
48
|
+
export function rotGeoms(radius) {
|
|
65
49
|
if (!Number.isFinite(radius)) radius = 1;
|
|
66
50
|
var rotShape = createRotShape(radius);
|
|
67
51
|
var rotFill = new Three.ShapeGeometry(rotShape);
|
|
@@ -73,7 +57,7 @@ function rotGeoms(radius) {
|
|
|
73
57
|
rotStroke: rotStroke
|
|
74
58
|
};
|
|
75
59
|
}
|
|
76
|
-
function addShape(shape, extrudeSettings, color, x, y, z, rx, ry, rz, s) {
|
|
60
|
+
export function addShape(shape, extrudeSettings, color, x, y, z, rx, ry, rz, s) {
|
|
77
61
|
// flat shape
|
|
78
62
|
var geometry = geometry = new Three.ExtrudeGeometry(shape, extrudeSettings);
|
|
79
63
|
var mesh = new Three.Mesh(geometry, new Three.MeshPhongMaterial({
|
|
@@ -85,7 +69,7 @@ function addShape(shape, extrudeSettings, color, x, y, z, rx, ry, rz, s) {
|
|
|
85
69
|
mesh.scale.set(s, s, s);
|
|
86
70
|
return mesh;
|
|
87
71
|
}
|
|
88
|
-
function makeMBoxfromObject(props_Object) {
|
|
72
|
+
export function makeMBoxfromObject(props_Object) {
|
|
89
73
|
var _props_Object$childre;
|
|
90
74
|
var mBoxColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0x99c3fb;
|
|
91
75
|
if (!props_Object) {
|
|
@@ -164,10 +148,10 @@ function makeMBoxfromObject(props_Object) {
|
|
|
164
148
|
|
|
165
149
|
// }
|
|
166
150
|
|
|
167
|
-
function baseBoxHelper(object, color) {
|
|
151
|
+
export function baseBoxHelper(object, color) {
|
|
168
152
|
var tempobj = [];
|
|
169
153
|
for (var j = object.children.length - 1; j >= 0; j--) {
|
|
170
|
-
if (object.children[j].type !==
|
|
154
|
+
if (object.children[j].type !== OBJTYPE_MESH) {
|
|
171
155
|
tempobj.push(object.children[j]);
|
|
172
156
|
object.remove(object.children[j]);
|
|
173
157
|
}
|
|
@@ -178,10 +162,10 @@ function baseBoxHelper(object, color) {
|
|
|
178
162
|
});
|
|
179
163
|
return boxHelper;
|
|
180
164
|
}
|
|
181
|
-
function baseBox3FromObject(object) {
|
|
165
|
+
export function baseBox3FromObject(object) {
|
|
182
166
|
var tempobj = [];
|
|
183
167
|
for (var j = object.children.length - 1; j >= 0; j--) {
|
|
184
|
-
if (object.children[j].type !==
|
|
168
|
+
if (object.children[j].type !== OBJTYPE_MESH || object.children[j].name.includes('_countertop')) {
|
|
185
169
|
tempobj.push(object.children[j]);
|
|
186
170
|
object.remove(object.children[j]);
|
|
187
171
|
}
|
|
@@ -192,7 +176,7 @@ function baseBox3FromObject(object) {
|
|
|
192
176
|
});
|
|
193
177
|
return box3;
|
|
194
178
|
}
|
|
195
|
-
function emptyBoxHolder(newWidth, newHeight, newDepth) {
|
|
179
|
+
export function emptyBoxHolder(newWidth, newHeight, newDepth) {
|
|
196
180
|
var scale = 2.54 / 100;
|
|
197
181
|
var geometry = new Three.BoxGeometry(newWidth * scale, newHeight * scale, newDepth * scale);
|
|
198
182
|
var material = new Three.MeshBasicMaterial({
|