kitchen-simulator 1.1.1-test.53 → 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 +3 -3
- package/es/KitchenConfiguratorApp.js +5 -3
- 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/index.js +1 -5
- package/es/models.js +3 -2
- 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 +11 -11
- package/lib/KitchenConfiguratorApp.js +7 -5
- 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/index.js +0 -26
- package/lib/models.js +7 -7
- 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
|
@@ -12,7 +12,7 @@ var _geometry = require("../../utils/geometry");
|
|
|
12
12
|
var _helper = require("../../utils/helper");
|
|
13
13
|
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
14
14
|
var _constants = require("../../constants");
|
|
15
|
-
var
|
|
15
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
16
16
|
var _threeCSG = _interopRequireDefault(require("../../utils/threeCSG.es6"));
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
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); }
|
|
@@ -69,7 +69,7 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
69
69
|
// Get height and thickness of the wall converting them into the current scene units
|
|
70
70
|
// let height = element.properties.getIn(['height', 'length']);
|
|
71
71
|
// let thickness = element.properties.getIn(['thickness', 'length']);
|
|
72
|
-
var height = (0,
|
|
72
|
+
var height = (0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER);
|
|
73
73
|
var thickness = 2.0;
|
|
74
74
|
var distance = (0, _geometry.verticesDistance)(vertex0, vertex1);
|
|
75
75
|
var soulMaterial = new Three.MeshPhongMaterial({
|
|
@@ -7,7 +7,7 @@ exports["default"] = PropertyLengthMeasure;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _constants = require("./../../constants");
|
|
10
|
-
var
|
|
10
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
11
11
|
var _export = require("../../components/style/export");
|
|
12
12
|
var _immutable = require("immutable");
|
|
13
13
|
var _math = require("../../utils/math");
|
|
@@ -47,12 +47,12 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
47
47
|
var merged = null;
|
|
48
48
|
if (type === 0) {
|
|
49
49
|
merged = value.merge({
|
|
50
|
-
length: unitInput !== _constants.UNIT_INCH ? (0,
|
|
50
|
+
length: unitInput !== _constants.UNIT_INCH ? (0, _convertUnitsLite.convert)(newLength).from(unitInput).to(_constants.UNIT_INCH) : newLength,
|
|
51
51
|
_length: newLength
|
|
52
52
|
});
|
|
53
53
|
} else {
|
|
54
54
|
merged = value.merge({
|
|
55
|
-
_length: (0,
|
|
55
|
+
_length: (0, _convertUnitsLite.convert)(newLength).from(_constants.UNIT_INCH).to(unitInput),
|
|
56
56
|
_unit: unitInput
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -7,7 +7,7 @@ exports["default"] = PropertyLengthMeasure;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _constants = require("../../constants");
|
|
10
|
-
var
|
|
10
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
11
11
|
var _export = require("../../components/style/export");
|
|
12
12
|
var _immutable = require("immutable");
|
|
13
13
|
var _math = require("../../utils/math");
|
|
@@ -68,7 +68,7 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
68
68
|
var _length = value.get('_length') || length; // in _unit
|
|
69
69
|
if (!_unit) {
|
|
70
70
|
_unit = _constants.UNIT_INCH;
|
|
71
|
-
_length = (0,
|
|
71
|
+
_length = (0, _convertUnitsLite.convert)(length).from(_constants.UNIT_CENTIMETER).to(_constants.UNIT_INCH);
|
|
72
72
|
}
|
|
73
73
|
var type = value.get('type') || _constants.BASE_CABINET_LAYOUTPOS;
|
|
74
74
|
var hook = configs.hook,
|
|
@@ -81,11 +81,11 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
81
81
|
merged = value.merge({
|
|
82
82
|
_length: newLength,
|
|
83
83
|
_unit: unitInput,
|
|
84
|
-
length: (0,
|
|
84
|
+
length: (0, _convertUnitsLite.convert)(newLength).from(unitInput).to(_constants.UNIT_CENTIMETER)
|
|
85
85
|
});
|
|
86
86
|
} else {
|
|
87
87
|
merged = value.merge({
|
|
88
|
-
_length: (0,
|
|
88
|
+
_length: (0, _convertUnitsLite.convert)(newLength).from(_constants.UNIT_CENTIMETER).to(unitInput),
|
|
89
89
|
_unit: unitInput,
|
|
90
90
|
length: newLength
|
|
91
91
|
});
|
|
@@ -116,7 +116,7 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
116
116
|
style: styles.distanceFloorTitle(fontSize)
|
|
117
117
|
}, label), /*#__PURE__*/_react["default"].createElement(_export.FormNumberInput, _extends({
|
|
118
118
|
disabled: type === _constants.TALL_CABINET_LAYOUTPOS,
|
|
119
|
-
value: (0,
|
|
119
|
+
value: (0, _convertUnitsLite.convert)(_length).from('in').to(unit),
|
|
120
120
|
onChange: function onChange(event) {
|
|
121
121
|
return update(event.target.value, _unit, 0);
|
|
122
122
|
},
|
|
@@ -7,7 +7,7 @@ exports["default"] = PropertyLengthMeasureHole;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _constants = require("../../constants");
|
|
10
|
-
var
|
|
10
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
11
11
|
var _export = require("../../components/style/export");
|
|
12
12
|
var _immutable = require("immutable");
|
|
13
13
|
var _math = require("../../utils/math");
|
|
@@ -48,11 +48,11 @@ function PropertyLengthMeasureHole(_ref, _ref2) {
|
|
|
48
48
|
if (type === 0) {
|
|
49
49
|
merged = value.merge({
|
|
50
50
|
_length: newLength,
|
|
51
|
-
length: (0,
|
|
51
|
+
length: (0, _convertUnitsLite.convert)(newLength).from(unitInput).to('cm')
|
|
52
52
|
});
|
|
53
53
|
} else {
|
|
54
54
|
merged = value.merge({
|
|
55
|
-
_length: (0,
|
|
55
|
+
_length: (0, _convertUnitsLite.convert)(newLength).from(_constants.UNIT_INCH).to(unitInput),
|
|
56
56
|
_unit: unitInput
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = _default;
|
|
7
|
-
var
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
7
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
9
8
|
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); }
|
|
10
9
|
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
10
|
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; }
|
|
@@ -42,7 +41,7 @@ function _default(_ref) {
|
|
|
42
41
|
defaultValue: {
|
|
43
42
|
_length: sizeinfo.width,
|
|
44
43
|
_unit: 'in',
|
|
45
|
-
length: (0,
|
|
44
|
+
length: (0, _convertUnitsLite.convert)(sizeinfo.width).from('in').to('cm')
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
};
|
|
@@ -55,7 +54,7 @@ function _default(_ref) {
|
|
|
55
54
|
defaultValue: {
|
|
56
55
|
_length: sizeinfo.width,
|
|
57
56
|
_unit: 'in',
|
|
58
|
-
length: (0,
|
|
57
|
+
length: (0, _convertUnitsLite.convert)(sizeinfo.width).from('in').to('cm')
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
depth: {
|
|
@@ -64,7 +63,7 @@ function _default(_ref) {
|
|
|
64
63
|
defaultValue: {
|
|
65
64
|
_length: sizeinfo.depth,
|
|
66
65
|
_unit: 'in',
|
|
67
|
-
length: (0,
|
|
66
|
+
length: (0, _convertUnitsLite.convert)(sizeinfo.depth).from('in').to('cm')
|
|
68
67
|
}
|
|
69
68
|
},
|
|
70
69
|
height: {
|
|
@@ -73,7 +72,7 @@ function _default(_ref) {
|
|
|
73
72
|
defaultValue: {
|
|
74
73
|
_length: sizeinfo.height,
|
|
75
74
|
_unit: 'in',
|
|
76
|
-
length: (0,
|
|
75
|
+
length: (0, _convertUnitsLite.convert)(sizeinfo.height).from('in').to('cm')
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
};
|
|
@@ -9,7 +9,7 @@ exports.render2DItem = render2DItem;
|
|
|
9
9
|
exports.render3DApplianceItem = render3DApplianceItem;
|
|
10
10
|
exports.render3DItem = render3DItem;
|
|
11
11
|
exports.render3DLightingItem = render3DLightingItem;
|
|
12
|
-
var
|
|
12
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
13
13
|
var _immutable = require("immutable");
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var Three = _interopRequireWildcard(require("three"));
|
|
@@ -20,7 +20,6 @@ var GeomUtils = _interopRequireWildcard(require("./geom-utils"));
|
|
|
20
20
|
var _loadObj = require("./load-obj");
|
|
21
21
|
var _helper = require("../../utils/helper");
|
|
22
22
|
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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
23
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
24
23
|
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); }
|
|
25
24
|
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; }
|
|
26
25
|
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; }
|
|
@@ -107,11 +106,11 @@ function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corner, sha
|
|
|
107
106
|
length: tempDepth.get('_length'),
|
|
108
107
|
unit: tempDepth.get('_unit')
|
|
109
108
|
};
|
|
110
|
-
var originalWidth = (0,
|
|
111
|
-
var originalDepth = (0,
|
|
112
|
-
var newWidth = (0,
|
|
113
|
-
var newDepth = (0,
|
|
114
|
-
var padding = (0,
|
|
109
|
+
var originalWidth = (0, _convertUnitsLite.convert)(sizeinfo.width).from('in').to('cm');
|
|
110
|
+
var originalDepth = (0, _convertUnitsLite.convert)(sizeinfo.depth).from('in').to('cm');
|
|
111
|
+
var newWidth = (0, _convertUnitsLite.convert)(width.length).from(width.unit).to('cm');
|
|
112
|
+
var newDepth = (0, _convertUnitsLite.convert)(depth.length).from(depth.unit).to('cm');
|
|
113
|
+
var padding = (0, _convertUnitsLite.convert)(_constants.SHAPE_SVG_PADDING).from(_constants.UNIT_INCH).to(_constants.UNIT_CENTIMETER);
|
|
115
114
|
var angle = element.rotation + 90;
|
|
116
115
|
var textRotation = 0;
|
|
117
116
|
if (Math.sin(angle * Math.PI / 180) < 0) {
|
|
@@ -201,8 +200,8 @@ function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corner, sha
|
|
|
201
200
|
// } else {
|
|
202
201
|
// }
|
|
203
202
|
svg_url = shape_svg.url;
|
|
204
|
-
svg_width = (0,
|
|
205
|
-
svg_depth = (0,
|
|
203
|
+
svg_width = (0, _convertUnitsLite.convert)(_constants.SHAPE_SVG_WIDTH).from(_constants.UNIT_INCH).to(_constants.UNIT_CENTIMETER);
|
|
204
|
+
svg_depth = (0, _convertUnitsLite.convert)(_constants.SHAPE_SVG_DEPTH).from(_constants.UNIT_INCH).to(_constants.UNIT_CENTIMETER);
|
|
206
205
|
}
|
|
207
206
|
var padding_width = padding * newWidth / svg_width;
|
|
208
207
|
var padding_depth = padding * newDepth / svg_depth;
|
|
@@ -355,9 +354,9 @@ function render3DItem(element, layer, scene, sizeinfo, structure_json, is_corner
|
|
|
355
354
|
length: sizeinfo.height,
|
|
356
355
|
unit: 'in'
|
|
357
356
|
};
|
|
358
|
-
var newWidth = (0,
|
|
359
|
-
var newDepth = (0,
|
|
360
|
-
var newHeight = (0,
|
|
357
|
+
var newWidth = (0, _convertUnitsLite.convert)(width.length).from(width.unit).to('in');
|
|
358
|
+
var newDepth = (0, _convertUnitsLite.convert)(depth.length).from(depth.unit).to('in');
|
|
359
|
+
var newHeight = (0, _convertUnitsLite.convert)(height.length).from(height.unit).to('in');
|
|
361
360
|
var mainName = ''; // to get name structure//
|
|
362
361
|
if (element.properties.get('width')) newWidth = element.getIn(['properties', 'width', '_length']);
|
|
363
362
|
if (element.properties.get('depth')) newDepth = element.getIn(['properties', 'depth', '_length']);
|
|
@@ -418,7 +417,7 @@ function render3DItem(element, layer, scene, sizeinfo, structure_json, is_corner
|
|
|
418
417
|
var object1 = object;
|
|
419
418
|
var newAltitude = element.properties.get('altitude').get('_length');
|
|
420
419
|
var newUnit = element.properties.get('altitude').get('_unit') || 'in';
|
|
421
|
-
newAltitude = (0,
|
|
420
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from(newUnit).to(scene.unit);
|
|
422
421
|
var _element = element.toJS();
|
|
423
422
|
if (!_element.doorStyle.doorStyles.is_euro_cds) {
|
|
424
423
|
object1.scale.set(100 * newWidth / sizeinfo.width, 100 * newHeight / sizeinfo.height, 100 * newDepth / sizeinfo.depth);
|
|
@@ -1023,16 +1022,16 @@ function render3DApplianceItem(element, layer, scene, sizeinfo, structure_json)
|
|
|
1023
1022
|
var onLoadItem = function onLoadItem(object) {
|
|
1024
1023
|
var newAltitude = element.properties.get('altitude').get('_length');
|
|
1025
1024
|
var newUnit = element.properties.get('altitude').get('_unit') || 'in';
|
|
1026
|
-
newAltitude = (0,
|
|
1025
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from(newUnit).to(scene.unit);
|
|
1027
1026
|
var newWidth = element.properties.get('width').get('_length');
|
|
1028
1027
|
var newWidthUnit = element.properties.get('width').get('_unit') || 'in';
|
|
1029
|
-
newWidth = (0,
|
|
1028
|
+
newWidth = (0, _convertUnitsLite.convert)(newWidth).from(newWidthUnit).to('in');
|
|
1030
1029
|
var newHeight = element.properties.get('height').get('_length');
|
|
1031
1030
|
var newHeightUnit = element.properties.get('height').get('_unit') || 'in';
|
|
1032
|
-
newHeight = (0,
|
|
1031
|
+
newHeight = (0, _convertUnitsLite.convert)(newHeight).from(newHeightUnit).to('in');
|
|
1033
1032
|
var newDepth = element.properties.get('depth').get('_length');
|
|
1034
1033
|
var newDepthUnit = element.properties.get('depth').get('_unit') || 'in';
|
|
1035
|
-
newDepth = (0,
|
|
1034
|
+
newDepth = (0, _convertUnitsLite.convert)(newDepth).from(newDepthUnit).to('in');
|
|
1036
1035
|
object.scale.set(100 * newWidth / sizeinfo.width, 100 * newHeight / sizeinfo.height, 100 * newDepth / sizeinfo.depth);
|
|
1037
1036
|
// Normalize the origin of the object
|
|
1038
1037
|
var boundingBox = new Three.Box3().setFromObject(object);
|
|
@@ -1302,12 +1301,12 @@ function render3DLightingItem(element, layer, scene, sizeinfo, structure_json) {
|
|
|
1302
1301
|
length: sizeinfo.height,
|
|
1303
1302
|
unit: 'in'
|
|
1304
1303
|
};
|
|
1305
|
-
var newWidth = (0,
|
|
1306
|
-
var newDepth = (0,
|
|
1307
|
-
var newHeight = (0,
|
|
1304
|
+
var newWidth = (0, _convertUnitsLite.convert)(width.length).from(width.unit).to('cm');
|
|
1305
|
+
var newDepth = (0, _convertUnitsLite.convert)(depth.length).from(depth.unit).to('cm');
|
|
1306
|
+
var newHeight = (0, _convertUnitsLite.convert)(height.length).from(height.unit).to('cm');
|
|
1308
1307
|
var newAltitude = element.properties.get('altitude').get('_length');
|
|
1309
1308
|
var newUnit = element.properties.get('altitude').get('_unit') || 'in';
|
|
1310
|
-
newAltitude = (0,
|
|
1309
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from(newUnit).to(scene.unit);
|
|
1311
1310
|
|
|
1312
1311
|
//object.scale.set(newWidth, newHeight, newDepth);
|
|
1313
1312
|
object.scale.set(100, 100, 100);
|
package/lib/class/item.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _convertUnitsLite = require("../utils/convert-units-lite");
|
|
8
8
|
var _export = require("./export");
|
|
9
9
|
var _export2 = require("../utils/export");
|
|
10
10
|
var _immutable = require("immutable");
|
|
@@ -12,7 +12,6 @@ var _constants = require("../constants");
|
|
|
12
12
|
var _helper = require("../utils/helper");
|
|
13
13
|
var _molding = require("../utils/molding");
|
|
14
14
|
var _utils = require("../components/viewer2d/utils");
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
15
|
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); }
|
|
17
16
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
18
17
|
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."); }
|
|
@@ -150,7 +149,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
150
149
|
});
|
|
151
150
|
}
|
|
152
151
|
newProperties['depth'] = new _immutable.Map({
|
|
153
|
-
length: (0,
|
|
152
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_length).from('in').to('cm'),
|
|
154
153
|
_length: euro_cds[0].euro_length,
|
|
155
154
|
_unit: 'in'
|
|
156
155
|
});
|
|
@@ -164,7 +163,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
164
163
|
});
|
|
165
164
|
}
|
|
166
165
|
newProperties['height'] = new _immutable.Map({
|
|
167
|
-
length: (0,
|
|
166
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_height).from('in').to('cm'),
|
|
168
167
|
_length: euro_cds[0].euro_height,
|
|
169
168
|
_unit: 'in'
|
|
170
169
|
});
|
|
@@ -178,7 +177,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
178
177
|
});
|
|
179
178
|
}
|
|
180
179
|
newProperties['width'] = new _immutable.Map({
|
|
181
|
-
length: (0,
|
|
180
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_width).from('in').to('cm') - 10,
|
|
182
181
|
_length: euro_cds[0].euro_width,
|
|
183
182
|
_unit: 'in'
|
|
184
183
|
});
|
|
@@ -220,9 +219,9 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
220
219
|
if (item.type.includes('Light')) {
|
|
221
220
|
var ceilHeight = state.getIn(['scene', 'layers', layerID, 'ceilHeight']);
|
|
222
221
|
var ceilUnit = state.getIn(['scene', 'layers', layerID, 'unit']);
|
|
223
|
-
ceilHeight = (0,
|
|
222
|
+
ceilHeight = (0, _convertUnitsLite.convert)(ceilHeight).from(ceilUnit).to('cm');
|
|
224
223
|
var newAltitude = ceilHeight - item.properties.getIn(['height', 'length']);
|
|
225
|
-
newAltitude = (0,
|
|
224
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from('cm').to(ceilUnit);
|
|
226
225
|
item = item.setIn(['properties', 'altitude', '_length'], newAltitude);
|
|
227
226
|
state = state.setIn(['scene', 'layers', layerID, 'items', item.id], item);
|
|
228
227
|
}
|
|
@@ -301,7 +300,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
301
300
|
var width = new _immutable.Map({
|
|
302
301
|
_length: newWidth,
|
|
303
302
|
_unit: 'in',
|
|
304
|
-
length: (0,
|
|
303
|
+
length: (0, _convertUnitsLite.convert)(newWidth).from('in').to('cm')
|
|
305
304
|
});
|
|
306
305
|
properties = properties.set('width', width);
|
|
307
306
|
state = state.mergeIn(['scene', 'layers', layerID, 'items', itemID, 'properties'], properties);
|
|
@@ -1238,7 +1237,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
1238
1237
|
});
|
|
1239
1238
|
}
|
|
1240
1239
|
newProperties['depth'] = new _immutable.Map({
|
|
1241
|
-
length: (0,
|
|
1240
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_length).from('in').to('cm'),
|
|
1242
1241
|
_length: euro_cds[0].euro_length,
|
|
1243
1242
|
_unit: 'in'
|
|
1244
1243
|
});
|
|
@@ -1252,7 +1251,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
1252
1251
|
});
|
|
1253
1252
|
}
|
|
1254
1253
|
newProperties['height'] = new _immutable.Map({
|
|
1255
|
-
length: (0,
|
|
1254
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_height).from('in').to('cm'),
|
|
1256
1255
|
_length: euro_cds[0].euro_height,
|
|
1257
1256
|
_unit: 'in'
|
|
1258
1257
|
});
|
|
@@ -1266,7 +1265,7 @@ var Item = exports["default"] = /*#__PURE__*/function () {
|
|
|
1266
1265
|
});
|
|
1267
1266
|
}
|
|
1268
1267
|
newProperties['width'] = new _immutable.Map({
|
|
1269
|
-
length: (0,
|
|
1268
|
+
length: (0, _convertUnitsLite.convert)(euro_cds[0].euro_width).from('in').to('cm') - 10,
|
|
1270
1269
|
_length: euro_cds[0].euro_width,
|
|
1271
1270
|
_unit: 'in'
|
|
1272
1271
|
});
|
|
@@ -7,7 +7,7 @@ exports["default"] = Area;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _polylabel = _interopRequireDefault(require("polylabel"));
|
|
10
|
-
var
|
|
10
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
11
11
|
var _math = require("../../utils/math");
|
|
12
12
|
var _constants = require("../../constants");
|
|
13
13
|
var _utils = require("./utils");
|
|
@@ -68,7 +68,7 @@ function Area(_ref) {
|
|
|
68
68
|
y: "0",
|
|
69
69
|
transform: "translate(".concat(center[0], " ").concat(center[1], ") scale(1, -1)"),
|
|
70
70
|
style: STYLE_TEXT
|
|
71
|
-
}, (0, _math.formatNumber)((0,
|
|
71
|
+
}, (0, _math.formatNumber)((0, _convertUnitsLite.convert)(areaSize).from('cm2').to('ft2'), _constants.DECIMAL_PLACES_2), ' ', "ft", String.fromCharCode(0xb2));
|
|
72
72
|
}
|
|
73
73
|
return /*#__PURE__*/_react["default"].createElement("g", {
|
|
74
74
|
"data-element-root": true,
|
|
@@ -7,7 +7,6 @@ exports["default"] = GridHorizontalStreak;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _immutable = require("immutable");
|
|
10
|
-
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
11
|
function GridHorizontalStreak(_ref) {
|
|
13
12
|
var width = _ref.width,
|
|
@@ -7,7 +7,6 @@ exports["default"] = GridStreak;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _immutable = require("immutable");
|
|
10
|
-
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
11
|
function GridStreak(_ref) {
|
|
13
12
|
var width = _ref.width,
|
|
@@ -7,7 +7,6 @@ exports["default"] = GridVerticalStreak;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _immutable = require("immutable");
|
|
10
|
-
var _convertUnits = _interopRequireDefault(require("convert-units"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
11
|
function GridVerticalStreak(_ref) {
|
|
13
12
|
var width = _ref.width,
|
|
@@ -7,9 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = Item;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _reactIf = _interopRequireDefault(require("../../utils/react-if"));
|
|
11
10
|
var _rulerDist = _interopRequireDefault(require("./rulerDist"));
|
|
12
|
-
var
|
|
11
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
13
12
|
var _export = require("../../utils/export");
|
|
14
13
|
var _constants = require("../../constants");
|
|
15
14
|
var _utils = require("./utils");
|
|
@@ -73,11 +72,11 @@ function Item(_ref, _ref2) {
|
|
|
73
72
|
var tempWidth = item.properties.get('width');
|
|
74
73
|
var tempHeight = item.properties.get('depth');
|
|
75
74
|
if (tempWidth || tempHeight) {
|
|
76
|
-
width = (0,
|
|
77
|
-
height = (0,
|
|
75
|
+
width = (0, _convertUnitsLite.convert)(tempWidth.get('_length')).from(tempWidth.get('_unit')).to('cm');
|
|
76
|
+
height = (0, _convertUnitsLite.convert)(tempHeight.get('_length')).from(tempHeight.get('_unit')).to('cm');
|
|
78
77
|
} else {
|
|
79
|
-
width = (0,
|
|
80
|
-
height = (0,
|
|
78
|
+
width = (0, _convertUnitsLite.convert)(element.info.sizeinfo.width).from('in').to('cm');
|
|
79
|
+
height = (0, _convertUnitsLite.convert)(element.info.sizeinfo.depth).from('in').to('cm');
|
|
81
80
|
}
|
|
82
81
|
var angle = rotation + 90;
|
|
83
82
|
val.size = {
|
|
@@ -153,8 +152,8 @@ function Item(_ref, _ref2) {
|
|
|
153
152
|
var catid = item.type;
|
|
154
153
|
var cat = catalog.elements[catid];
|
|
155
154
|
if (!cat) cat = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(catid)];
|
|
156
|
-
var width = (0,
|
|
157
|
-
var height = (0,
|
|
155
|
+
var width = (0, _convertUnitsLite.convert)(item.properties.getIn(['width', '_length'])).from('in').to('cm');
|
|
156
|
+
var height = (0, _convertUnitsLite.convert)(item.properties.getIn(['depth', '_length'])).from('in').to('cm');
|
|
158
157
|
// let width = cat.info.sizeinfo.width;
|
|
159
158
|
// let height = cat.info.sizeinfo.depth;
|
|
160
159
|
val.size = {
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = Ruler;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
10
10
|
var _idBroker = _interopRequireDefault(require("../../utils/id-broker"));
|
|
11
|
-
var _export = require("../style/export");
|
|
12
11
|
var _constants = require("../../constants");
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
13
|
var STYLE = {
|
|
@@ -43,11 +42,11 @@ function Ruler(_ref) {
|
|
|
43
42
|
if (type === 0) {
|
|
44
43
|
merged = value.merge({
|
|
45
44
|
_length: newLength,
|
|
46
|
-
length: (0,
|
|
45
|
+
length: (0, _convertUnitsLite.convert)(newLength).from(unitInput).to('cm')
|
|
47
46
|
});
|
|
48
47
|
} else {
|
|
49
48
|
merged = value.merge({
|
|
50
|
-
_length: (0,
|
|
49
|
+
_length: (0, _convertUnitsLite.convert)(newLength).from(UNIT_INCH).to(unitInput),
|
|
51
50
|
_unit: unitInput
|
|
52
51
|
});
|
|
53
52
|
}
|
|
@@ -60,8 +59,8 @@ function Ruler(_ref) {
|
|
|
60
59
|
};
|
|
61
60
|
// let _unit = "in";
|
|
62
61
|
// let distanceText = convert(length).from(unit).to(rulerUnit);
|
|
63
|
-
var distanceText = (0,
|
|
64
|
-
var thickness = (0,
|
|
62
|
+
var distanceText = (0, _convertUnitsLite.convert)(length).from(unit).to(rulerUnit).toFixed(0);
|
|
63
|
+
var thickness = (0, _convertUnitsLite.convert)(_constants.LINE_THICKNESS).from(unit).to(rulerUnit).toFixed(0);
|
|
65
64
|
// let _ft_len = convert(_length).from('in').to('ft');
|
|
66
65
|
// let _ft_val = Math.floor(_ft_len); _ft_len -= _ft_val;
|
|
67
66
|
// let _in_val = convert(_ft_len).from('ft').to('in').toFixed(0);
|
|
@@ -86,7 +85,7 @@ function Ruler(_ref) {
|
|
|
86
85
|
transform: "scale(1, -1)",
|
|
87
86
|
style: STYLE_TEXT,
|
|
88
87
|
fill: _constants.TEXT_COLOR_NEUTRAL_7
|
|
89
|
-
}, Math.round((0,
|
|
88
|
+
}, Math.round((0, _convertUnitsLite.convert)(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/_react["default"].createElement("line", {
|
|
90
89
|
x1: "0",
|
|
91
90
|
y1: "0",
|
|
92
91
|
x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = RulerDist;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
var ARROW_STYLE = {
|
|
12
12
|
stroke: '#1183B7',
|
|
@@ -38,7 +38,7 @@ function RulerDist(_ref) {
|
|
|
38
38
|
rotation = _ref.rotation;
|
|
39
39
|
var _unit = 'in';
|
|
40
40
|
// let _length = convert(length).from(unit).to(rulerUnit);
|
|
41
|
-
var distanceText = "".concat((0,
|
|
41
|
+
var distanceText = "".concat((0, _convertUnitsLite.convert)(length).from('cm').to(rulerUnit).toFixed(0));
|
|
42
42
|
var textLength = (distanceText.length + layer.unit.length) * 18;
|
|
43
43
|
var textangle = angle + 90;
|
|
44
44
|
var textRotation = 1;
|
|
@@ -82,7 +82,7 @@ function RulerDist(_ref) {
|
|
|
82
82
|
y: "0",
|
|
83
83
|
transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
|
|
84
84
|
style: STYLE_TEXT
|
|
85
|
-
}, Math.round((0,
|
|
85
|
+
}, Math.round((0, _convertUnitsLite.convert)(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit)), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
86
86
|
cx: "1",
|
|
87
87
|
cy: "0",
|
|
88
88
|
fill: "white",
|
|
@@ -117,7 +117,7 @@ function RulerDist(_ref) {
|
|
|
117
117
|
y: "0",
|
|
118
118
|
transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
|
|
119
119
|
style: STYLE_TEXT
|
|
120
|
-
}, Math.round((0,
|
|
120
|
+
}, Math.round((0, _convertUnitsLite.convert)(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit)), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
121
121
|
cx: "1",
|
|
122
122
|
cy: "0",
|
|
123
123
|
fill: "white",
|