kitchen-simulator 1.1.1-test.6 → 1.1.1-test.60
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 +8 -15
- package/es/KitchenConfiguratorApp.js +11 -27
- package/es/actions/holes-actions.js +1 -1
- package/es/actions/items-actions.js +1 -1
- package/es/actions/lines-actions.js +1 -1
- package/es/actions/project-actions.js +1 -1
- package/es/actions/scene-actions.js +1 -1
- package/es/actions/vertices-actions.js +1 -1
- package/es/actions/viewer2d-actions.js +1 -1
- package/es/actions/viewer3d-actions.js +1 -1
- package/es/catalog/areas/area/planner-element.js +10 -7
- package/es/catalog/factories/wall-factory-3d.js +1 -1
- package/es/catalog/holes/export.js +13 -13
- package/es/catalog/lines/wall/planner-element.js +13 -10
- package/es/catalog/properties/property-checkbox.js +63 -18
- package/es/catalog/properties/property-enum.js +51 -9
- package/es/catalog/properties/property-lenght-measure.js +2 -2
- package/es/catalog/properties/property-length-measure.js +58 -9
- 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/catalog/utils/mtl-loader.js +3 -2
- package/es/catalog/utils/obj-loader.js +3 -2
- package/es/class/area.js +1 -1
- package/es/class/group.js +3 -3
- package/es/class/hole.js +5 -6
- package/es/class/item.js +8 -10
- package/es/class/layer.js +2 -2
- package/es/class/project.js +4 -4
- package/es/components/content.js +1 -0
- package/es/components/disclaimer/disclaimer.js +66 -86
- package/es/components/style/form-number-input.js +31 -7
- package/es/components/style/form-select.js +56 -8
- package/es/components/style/form-slider.js +22 -6
- package/es/components/style/form-text-input.js +31 -12
- package/es/components/viewer2d/area.js +4 -4
- 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/line.js +2 -5
- package/es/components/viewer2d/ruler.js +2 -3
- package/es/components/viewer2d/rulerDist.js +1 -1
- package/es/components/viewer2d/scene.js +2 -2
- package/es/components/viewer2d/utils.js +37 -1
- package/es/components/viewer2d/viewer2d.js +10 -4
- package/es/components/viewer3d/libs/mtl-loader.js +2 -2
- package/es/components/viewer3d/libs/obj-loader.js +2 -2
- package/es/components/viewer3d/libs/orbit-controls.js +6 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +5 -4
- 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 +2 -3
- package/es/components/viewer3d/scene-creator.js +1 -1
- package/es/components/viewer3d/viewer3d.js +12 -13
- package/es/index.js +20 -14
- package/es/models.js +4 -3
- package/es/plugins/keyboard.js +2 -2
- package/es/reducers/holes-reducer.js +1 -1
- package/es/reducers/items-reducer.js +2 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -2
- package/es/reducers/scene-reducer.js +1 -1
- package/es/reducers/user-reducer.js +1 -2
- package/es/reducers/vertices-reducer.js +1 -1
- package/es/reducers/viewer2d-reducer.js +2 -2
- package/es/reducers/viewer3d-reducer.js +2 -2
- package/es/utils/convert-units-lite.js +29 -0
- package/es/utils/geometry.js +4 -4
- package/es/utils/get-edges-of-subgraphs.js +2 -1
- package/es/utils/graph-cycles.js +2 -3
- package/es/utils/graph.js +2 -1
- package/es/utils/helper.js +1 -69
- package/es/utils/id-broker.js +2 -2
- package/es/utils/molding.js +34 -34
- package/lib/KitchenConfigurator.js +33 -40
- package/lib/KitchenConfiguratorApp.js +34 -49
- package/lib/catalog/areas/area/planner-element.js +12 -8
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/holes/export.js +13 -13
- package/lib/catalog/lines/wall/planner-element.js +15 -11
- package/lib/catalog/properties/property-checkbox.js +64 -19
- package/lib/catalog/properties/property-enum.js +49 -7
- package/lib/catalog/properties/property-lenght-measure.js +3 -3
- package/lib/catalog/properties/property-length-measure.js +60 -11
- 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/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/item.js +13 -16
- package/lib/components/content.js +1 -0
- package/lib/components/disclaimer/disclaimer.js +66 -86
- package/lib/components/style/form-number-input.js +30 -6
- package/lib/components/style/form-select.js +54 -8
- package/lib/components/style/form-slider.js +22 -6
- package/lib/components/style/form-text-input.js +30 -12
- package/lib/components/viewer2d/area.js +5 -5
- 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/line.js +2 -5
- package/lib/components/viewer2d/ruler.js +6 -7
- package/lib/components/viewer2d/rulerDist.js +4 -4
- package/lib/components/viewer2d/scene.js +1 -1
- package/lib/components/viewer2d/utils.js +37 -0
- package/lib/components/viewer2d/viewer2d.js +25 -17
- package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
- package/lib/components/viewer3d/libs/obj-loader.js +6 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- 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 +3 -4
- package/lib/components/viewer3d/scene-creator.js +24 -24
- package/lib/components/viewer3d/viewer3d.js +17 -17
- package/lib/index.js +22 -88
- package/lib/models.js +7 -7
- package/lib/reducers/user-reducer.js +0 -1
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/geometry.js +9 -10
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph.js +9 -3
- package/lib/utils/helper.js +7 -76
- package/lib/utils/id-broker.js +2 -2
- package/lib/utils/molding.js +52 -52
- package/package.json +34 -70
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = Layer3D;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _ruler3D = _interopRequireDefault(require("./ruler3D"));
|
|
9
|
-
var
|
|
9
|
+
var _convertUnitsLite = require("../../../utils/convert-units-lite");
|
|
10
10
|
var _export = require("../../../utils/export");
|
|
11
11
|
var _utils = require("../../../components/viewer2d/utils");
|
|
12
12
|
var _constants = require("../../../constants");
|
|
@@ -91,10 +91,10 @@ function Layer3D(_ref) {
|
|
|
91
91
|
var catid = item.type;
|
|
92
92
|
var cat = catalog.elements[catid];
|
|
93
93
|
if (!cat) cat = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(catid)];
|
|
94
|
-
var width = (0,
|
|
95
|
-
var height = (0,
|
|
96
|
-
var depth = (0,
|
|
97
|
-
var altitude = (0,
|
|
94
|
+
var width = (0, _convertUnitsLite.convert)(item.properties.getIn(['width', '_length'])).from(item.properties.getIn(['width', '_unit'])).to(scene.unit);
|
|
95
|
+
var height = (0, _convertUnitsLite.convert)(item.properties.getIn(['height', '_length'])).from(item.properties.getIn(['height', '_unit'])).to(scene.unit);
|
|
96
|
+
var depth = (0, _convertUnitsLite.convert)(item.properties.getIn(['depth', '_length'])).from(item.properties.getIn(['depth', '_unit'])).to(scene.unit);
|
|
97
|
+
var altitude = (0, _convertUnitsLite.convert)(item.properties.getIn(['altitude', '_length'])).from(item.properties.getIn(['altitude', '_unit'])).to(scene.unit);
|
|
98
98
|
val.size = {
|
|
99
99
|
width: width,
|
|
100
100
|
height: height,
|
|
@@ -128,29 +128,29 @@ function Layer3D(_ref) {
|
|
|
128
128
|
var vertex0, vertex1;
|
|
129
129
|
if (isSnapped(item.rect[3], item.rect[2])) {
|
|
130
130
|
vertex0 = {
|
|
131
|
-
x: -frontRect.width / 2 + (0,
|
|
131
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[3], v0)).from('cm').to(layer.unit) * scale,
|
|
132
132
|
y: height / 2
|
|
133
133
|
};
|
|
134
134
|
vertex1 = {
|
|
135
|
-
x: -frontRect.width / 2 + (0,
|
|
135
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[2], v0)).from('cm').to(layer.unit) * scale,
|
|
136
136
|
y: height / 2
|
|
137
137
|
};
|
|
138
138
|
} else if (isSnapped(item.rect[2], item.rect[1])) {
|
|
139
139
|
vertex0 = {
|
|
140
|
-
x: -frontRect.width / 2 + (0,
|
|
140
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[2], v0)).from('cm').to(layer.unit) * scale,
|
|
141
141
|
y: height / 2
|
|
142
142
|
};
|
|
143
143
|
vertex1 = {
|
|
144
|
-
x: -frontRect.width / 2 + (0,
|
|
144
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[1], v0)).from('cm').to(layer.unit) * scale,
|
|
145
145
|
y: height / 2
|
|
146
146
|
};
|
|
147
147
|
} else if (isSnapped(item.rect[0], item.rect[3])) {
|
|
148
148
|
vertex0 = {
|
|
149
|
-
x: -frontRect.width / 2 + (0,
|
|
149
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[0], v0)).from('cm').to(layer.unit) * scale,
|
|
150
150
|
y: height / 2
|
|
151
151
|
};
|
|
152
152
|
vertex1 = {
|
|
153
|
-
x: -frontRect.width / 2 + (0,
|
|
153
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[3], v0)).from('cm').to(layer.unit) * scale,
|
|
154
154
|
y: height / 2
|
|
155
155
|
};
|
|
156
156
|
}
|
|
@@ -177,29 +177,29 @@ function Layer3D(_ref) {
|
|
|
177
177
|
var vertex0, vertex1;
|
|
178
178
|
if (isSnapped(item.rect[3], item.rect[2])) {
|
|
179
179
|
vertex0 = {
|
|
180
|
-
x: -frontRect.width / 2 + (0,
|
|
180
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[3], v0)).from('cm').to(layer.unit) * scale,
|
|
181
181
|
y: -height / 2
|
|
182
182
|
};
|
|
183
183
|
vertex1 = {
|
|
184
|
-
x: -frontRect.width / 2 + (0,
|
|
184
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[2], v0)).from('cm').to(layer.unit) * scale,
|
|
185
185
|
y: -height / 2
|
|
186
186
|
};
|
|
187
187
|
} else if (isSnapped(item.rect[2], item.rect[1])) {
|
|
188
188
|
vertex0 = {
|
|
189
|
-
x: -frontRect.width / 2 + (0,
|
|
189
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[2], v0)).from('cm').to(layer.unit) * scale,
|
|
190
190
|
y: -height / 2
|
|
191
191
|
};
|
|
192
192
|
vertex1 = {
|
|
193
|
-
x: -frontRect.width / 2 + (0,
|
|
193
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[1], v0)).from('cm').to(layer.unit) * scale,
|
|
194
194
|
y: -height / 2
|
|
195
195
|
};
|
|
196
196
|
} else if (isSnapped(item.rect[0], item.rect[3])) {
|
|
197
197
|
vertex0 = {
|
|
198
|
-
x: -frontRect.width / 2 + (0,
|
|
198
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[0], v0)).from('cm').to(layer.unit) * scale,
|
|
199
199
|
y: -height / 2
|
|
200
200
|
};
|
|
201
201
|
vertex1 = {
|
|
202
|
-
x: -frontRect.width / 2 + (0,
|
|
202
|
+
x: -frontRect.width / 2 + (0, _convertUnitsLite.convert)(getLength(item.rect[3], v0)).from('cm').to(layer.unit) * scale,
|
|
203
203
|
y: -height / 2
|
|
204
204
|
};
|
|
205
205
|
}
|
|
@@ -232,7 +232,7 @@ function Layer3D(_ref) {
|
|
|
232
232
|
leftItems.forEach(function (item, idx) {
|
|
233
233
|
var forwardItems = [];
|
|
234
234
|
var distLine = 0;
|
|
235
|
-
var itemHeight = (0,
|
|
235
|
+
var itemHeight = (0, _convertUnitsLite.convert)(item.size.height).from(scene.unit).to(layer.unit);
|
|
236
236
|
for (var i = 0; i < idx; i++) {
|
|
237
237
|
forwardItems.push(leftItems[i]);
|
|
238
238
|
}
|
|
@@ -241,12 +241,12 @@ function Layer3D(_ref) {
|
|
|
241
241
|
}).length) {
|
|
242
242
|
if (item.itemInfo.properties.altitude._length) {
|
|
243
243
|
if (isSnapped(item.rect[3], item.rect[2])) {
|
|
244
|
-
distLine = (0,
|
|
244
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[2], v1)).from(scene.unit).to(layer.unit);
|
|
245
245
|
} else if (isSnapped(item.rect[2], item.rect[1])) {
|
|
246
|
-
distLine = (0,
|
|
246
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[1], v1)).from(scene.unit).to(layer.unit);
|
|
247
247
|
}
|
|
248
|
-
var itemAltitude = (0,
|
|
249
|
-
if (ceilHeight - (itemAltitude + itemHeight) > (0,
|
|
248
|
+
var itemAltitude = (0, _convertUnitsLite.convert)(item.size.altitude).from(scene.unit).to(layer.unit);
|
|
249
|
+
if (ceilHeight - (itemAltitude + itemHeight) > (0, _convertUnitsLite.convert)(_constants.DELTA).from(toler_unit).to(layer.unit)) {
|
|
250
250
|
rulerLines.push({
|
|
251
251
|
v0: {
|
|
252
252
|
x: width / 2,
|
|
@@ -287,9 +287,9 @@ function Layer3D(_ref) {
|
|
|
287
287
|
right_count++;
|
|
288
288
|
} else {
|
|
289
289
|
if (isSnapped(item.rect[3], item.rect[2])) {
|
|
290
|
-
distLine = (0,
|
|
290
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[3], v0)).from(scene.unit).to(layer.unit);
|
|
291
291
|
} else if (isSnapped(item.rect[2], item.rect[1])) {
|
|
292
|
-
distLine = (0,
|
|
292
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[2], v0)).from(scene.unit).to(layer.unit);
|
|
293
293
|
}
|
|
294
294
|
rulerLines.push({
|
|
295
295
|
v0: {
|
|
@@ -324,7 +324,7 @@ function Layer3D(_ref) {
|
|
|
324
324
|
rightItems.forEach(function (item, idx) {
|
|
325
325
|
var forwardItems = [];
|
|
326
326
|
var distLine = 0;
|
|
327
|
-
var itemHeight = (0,
|
|
327
|
+
var itemHeight = (0, _convertUnitsLite.convert)(item.size.height).from(scene.unit).to(layer.unit);
|
|
328
328
|
for (var i = 0; i < idx; i++) {
|
|
329
329
|
forwardItems.push(rightItems[i]);
|
|
330
330
|
}
|
|
@@ -333,12 +333,12 @@ function Layer3D(_ref) {
|
|
|
333
333
|
}).length) {
|
|
334
334
|
if (item.itemInfo.properties.altitude._length) {
|
|
335
335
|
if (isSnapped(item.rect[3], item.rect[2])) {
|
|
336
|
-
distLine = (0,
|
|
336
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[3], v0)).from(scene.unit).to(layer.unit);
|
|
337
337
|
} else if (isSnapped(item.rect[2], item.rect[1])) {
|
|
338
|
-
distLine = (0,
|
|
338
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[2], v0)).from(scene.unit).to(layer.unit);
|
|
339
339
|
}
|
|
340
|
-
var _itemHeight = (0,
|
|
341
|
-
var itemAltitude = (0,
|
|
340
|
+
var _itemHeight = (0, _convertUnitsLite.convert)(item.size.height).from(scene.unit).to(layer.unit);
|
|
341
|
+
var itemAltitude = (0, _convertUnitsLite.convert)(item.size.altitude).from(scene.unit).to(layer.unit);
|
|
342
342
|
rulerLines.push({
|
|
343
343
|
v0: {
|
|
344
344
|
x: -width / 2,
|
|
@@ -363,7 +363,7 @@ function Layer3D(_ref) {
|
|
|
363
363
|
text: (0, _math.formatNumber)(_itemHeight, _constants.DECIMAL_PLACES_2),
|
|
364
364
|
space: rulerSpace + +distLine * scale + left_count * lineSpace
|
|
365
365
|
});
|
|
366
|
-
if (ceilHeight - (itemAltitude + _itemHeight) > (0,
|
|
366
|
+
if (ceilHeight - (itemAltitude + _itemHeight) > (0, _convertUnitsLite.convert)(_constants.DELTA).from(toler_unit).to(layer.unit)) {
|
|
367
367
|
rulerLines.push({
|
|
368
368
|
v0: {
|
|
369
369
|
x: -width / 2,
|
|
@@ -380,9 +380,9 @@ function Layer3D(_ref) {
|
|
|
380
380
|
left_count++;
|
|
381
381
|
} else {
|
|
382
382
|
if (isSnapped(item.rect[3], item.rect[2])) {
|
|
383
|
-
distLine = (0,
|
|
383
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[2], v1)).from(scene.unit).to(layer.unit);
|
|
384
384
|
} else if (isSnapped(item.rect[2], item.rect[1])) {
|
|
385
|
-
distLine = (0,
|
|
385
|
+
distLine = (0, _convertUnitsLite.convert)(getLength(item.rect[1], v1)).from(scene.unit).to(layer.unit);
|
|
386
386
|
}
|
|
387
387
|
rulerLines.push({
|
|
388
388
|
v0: {
|
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.compareVertices = compareVertices;
|
|
7
7
|
exports["default"] = Scene3D;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _export = require("../../../utils/export");
|
|
10
|
-
var _helper = require("../../..//utils/helper");
|
|
11
9
|
var _geometry = require("../../../utils/geometry");
|
|
12
|
-
var
|
|
10
|
+
var _convertUnitsLite = require("../../../utils/convert-units-lite");
|
|
13
11
|
var _layer3D = _interopRequireDefault(require("./layer3D"));
|
|
14
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
13
|
function compareVertices(v0, v1) {
|
|
@@ -23,12 +21,13 @@ function Scene3D(_ref) {
|
|
|
23
21
|
mode = _ref.mode,
|
|
24
22
|
downloadFlag = _ref.downloadFlag;
|
|
25
23
|
var layers = scene.layers;
|
|
24
|
+
console.log(layers.toJS());
|
|
26
25
|
var selectedLayer = layers.get(scene.selectedLayer);
|
|
27
26
|
var ceilHeight = selectedLayer.ceilHeight;
|
|
28
27
|
var selectedLine = selectedLayer.lines.get(selectedLayer.selected.lines.toJS()[0]);
|
|
29
28
|
var vertex0 = selectedLayer.vertices.get(selectedLine.vertices.get(0));
|
|
30
29
|
var vertex1 = selectedLayer.vertices.get(selectedLine.vertices.get(1));
|
|
31
|
-
var lineLength = (0,
|
|
30
|
+
var lineLength = (0, _convertUnitsLite.convert)((0, _geometry.verticesDistance)(vertex0, vertex1)).from(scene.unit).to(selectedLayer.unit);
|
|
32
31
|
var multi = downloadFlag ? 0.85 : 0.6;
|
|
33
32
|
var scale = Math.min(width * multi / lineLength, height * multi / ceilHeight);
|
|
34
33
|
var frontRect = {
|
|
@@ -37,7 +37,7 @@ var _gridCreator = _interopRequireDefault(require("./grid-creator"));
|
|
|
37
37
|
var _threeMemoryCleaner = require("./three-memory-cleaner");
|
|
38
38
|
var _constants = require("../../constants");
|
|
39
39
|
var _export = require("../../utils/export");
|
|
40
|
-
var
|
|
40
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
41
41
|
var _geometry2 = require("../../utils/geometry");
|
|
42
42
|
var GeomUtils = _interopRequireWildcard(require("../../catalog/utils/geom-utils"));
|
|
43
43
|
var _itemLoader = require("../../catalog/utils/item-loader");
|
|
@@ -546,16 +546,16 @@ function replaceObject(modifiedPath, layer, planData, actions, sceneData, oldSce
|
|
|
546
546
|
var posVec = new Three.Vector3(object.position.x, object.position.y, object.position.z);
|
|
547
547
|
var newAltitude = item.properties.get('altitude').get('_length');
|
|
548
548
|
var newUnit = item.properties.get('altitude').get('_unit') || 'in';
|
|
549
|
-
newAltitude = (0,
|
|
549
|
+
newAltitude = (0, _convertUnitsLite.convert)(newAltitude).from(newUnit).to(sceneData.unit);
|
|
550
550
|
var newWidth = item.properties.get('width').get('_length');
|
|
551
551
|
var newWidthUnit = item.properties.get('width').get('_unit') || 'in';
|
|
552
|
-
newWidth = (0,
|
|
552
|
+
newWidth = (0, _convertUnitsLite.convert)(newWidth).from(newWidthUnit).to('in');
|
|
553
553
|
var newHeight = item.properties.get('height').get('_length');
|
|
554
554
|
var newHeightUnit = item.properties.get('height').get('_unit') || 'in';
|
|
555
|
-
newHeight = (0,
|
|
555
|
+
newHeight = (0, _convertUnitsLite.convert)(newHeight).from(newHeightUnit).to('in');
|
|
556
556
|
var newDepth = item.properties.get('depth').get('_length');
|
|
557
557
|
var newDepthUnit = item.properties.get('depth').get('_unit') || 'in';
|
|
558
|
-
newDepth = (0,
|
|
558
|
+
newDepth = (0, _convertUnitsLite.convert)(newDepth).from(newDepthUnit).to('in');
|
|
559
559
|
var sizeinfo = !!catalog.elements[item.type] ? catalog.elements[item.type].info.sizeinfo : catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(item.type)].info.sizeinfo;
|
|
560
560
|
object.scale.set(1 * newWidth / sizeinfo.width, 1 * newHeight / sizeinfo.height, 1 * newDepth / sizeinfo.depth);
|
|
561
561
|
object.position.set(0, 0, 0);
|
|
@@ -960,7 +960,7 @@ function getLineDistance(obj, layer, isCalcWall, index) {
|
|
|
960
960
|
obj.geometry.attributes.position.needsUpdate = true;
|
|
961
961
|
obj.geometry.computeBoundingSphere();
|
|
962
962
|
obj.geometry.computeBoundingBox();
|
|
963
|
-
var dist = (0, _math.formatNumber)((0,
|
|
963
|
+
var dist = (0, _math.formatNumber)((0, _convertUnitsLite.convert)(intersects[i].distance).from('cm').to('in'), _constants.DECIMAL_PLACES_2);
|
|
964
964
|
if (dist > 3) {
|
|
965
965
|
var _canvas = getTextCanvas(dist);
|
|
966
966
|
var wid = _canvas.width / window.innerWidth * 30;
|
|
@@ -1814,7 +1814,7 @@ function addArea(sceneData, planData, layer, areaID, catalog, areaActions, mode)
|
|
|
1814
1814
|
realVec.push(vec);
|
|
1815
1815
|
});
|
|
1816
1816
|
if (vertices.includes(realVec[0]) && vertices.includes(realVec[1])) {
|
|
1817
|
-
height = (0,
|
|
1817
|
+
height = (0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER);
|
|
1818
1818
|
// height = data.properties.getIn(["height", "length"]);
|
|
1819
1819
|
return 1; // break
|
|
1820
1820
|
}
|
|
@@ -1822,7 +1822,7 @@ function addArea(sceneData, planData, layer, areaID, catalog, areaActions, mode)
|
|
|
1822
1822
|
for (var i = 0; i < lines.length; i++) {
|
|
1823
1823
|
if (_loop2()) break;
|
|
1824
1824
|
}
|
|
1825
|
-
ceil.translateZ((0,
|
|
1825
|
+
ceil.translateZ((0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER));
|
|
1826
1826
|
pivot.name = 'pivot';
|
|
1827
1827
|
pivot.add(area3D);
|
|
1828
1828
|
pivot.add(area3D.userData.floorSupport);
|
|
@@ -1986,9 +1986,9 @@ function addItem(sceneData, planData, layer, itemID, catalog, itemsActions) {
|
|
|
1986
1986
|
var catid = item.type;
|
|
1987
1987
|
var cat = catalog.elements[catid];
|
|
1988
1988
|
if (!cat) cat = catalog.elements[(0, _utils.returnReplaceableDeepSearchType)(catid)];
|
|
1989
|
-
var width = (0,
|
|
1990
|
-
var height = (0,
|
|
1991
|
-
var depth = (0,
|
|
1989
|
+
var width = (0, _convertUnitsLite.convert)(item.properties.getIn(['width', '_length'])).from('in').to(sceneData.unit);
|
|
1990
|
+
var height = (0, _convertUnitsLite.convert)(item.properties.getIn(['height', '_length'])).from('in').to(sceneData.unit);
|
|
1991
|
+
var depth = (0, _convertUnitsLite.convert)(item.properties.getIn(['depth', '_length'])).from('in').to(sceneData.unit);
|
|
1992
1992
|
val.size = {
|
|
1993
1993
|
width: width,
|
|
1994
1994
|
height: height,
|
|
@@ -2233,13 +2233,13 @@ function createCTFromItems(items, unit, catalog) {
|
|
|
2233
2233
|
// let height = convert(item0.properties.getIn(['height', '_length'])).from('in').to('cm');
|
|
2234
2234
|
var width = item0.properties.get('width').get('_length');
|
|
2235
2235
|
var widthUnit = item0.properties.get('width').get('_unit') || 'cm';
|
|
2236
|
-
width = (0,
|
|
2236
|
+
width = (0, _convertUnitsLite.convert)(width).from(widthUnit).to('cm');
|
|
2237
2237
|
var depth = item0.properties.get('depth').get('_length');
|
|
2238
2238
|
var depthUnit = item0.properties.get('depth').get('_unit') || 'cm';
|
|
2239
|
-
depth = (0,
|
|
2239
|
+
depth = (0, _convertUnitsLite.convert)(depth).from(depthUnit).to('cm');
|
|
2240
2240
|
var height = item0.properties.get('height').get('_length');
|
|
2241
2241
|
var heightUnit = item0.properties.get('height').get('_unit') || 'cm';
|
|
2242
|
-
height = (0,
|
|
2242
|
+
height = (0, _convertUnitsLite.convert)(height).from(heightUnit).to('cm');
|
|
2243
2243
|
var size = {
|
|
2244
2244
|
width: width * items.length,
|
|
2245
2245
|
depth: depth,
|
|
@@ -2259,10 +2259,10 @@ function createMDFromItem(item, lines, molding) {
|
|
|
2259
2259
|
var MDId = _export.IDBroker.acquireID();
|
|
2260
2260
|
var z = item.properties.get('altitude').get('_length');
|
|
2261
2261
|
var zUnit = item.properties.get('altitude').get('_unit') || 'cm';
|
|
2262
|
-
z = (0,
|
|
2262
|
+
z = (0, _convertUnitsLite.convert)(z).from(zUnit).to('cm');
|
|
2263
2263
|
var height = item.properties.get('height').get('_length');
|
|
2264
2264
|
var heightUnit = item.properties.get('height').get('_unit') || 'cm';
|
|
2265
|
-
height = (0,
|
|
2265
|
+
height = (0, _convertUnitsLite.convert)(height).from(heightUnit).to('cm');
|
|
2266
2266
|
switch (molding.location_type) {
|
|
2267
2267
|
case _constants.TOP_MOLDING_LOCATION:
|
|
2268
2268
|
z += height;
|
|
@@ -2521,7 +2521,7 @@ function addCTMesh(countertop, planData, layer) {
|
|
|
2521
2521
|
var unit_width = countertop.items.find(function (ct) {
|
|
2522
2522
|
return !ct.type.includes('Dishwasher') && !ct.type.includes('BF');
|
|
2523
2523
|
}).properties.get('width').get('_unit') || 'cm';
|
|
2524
|
-
width = (0,
|
|
2524
|
+
width = (0, _convertUnitsLite.convert)(width).from(unit_width).to('cm');
|
|
2525
2525
|
pivotMat.scale(new Three.Vector3(countertop.size.width / width, 1, 1));
|
|
2526
2526
|
var finalMat = objMat.premultiply(pivotMat);
|
|
2527
2527
|
_ct3d.applyMatrix4(finalMat);
|
|
@@ -2852,7 +2852,7 @@ function createBacksplash(item, layer, planData, scene) {
|
|
|
2852
2852
|
|
|
2853
2853
|
var altitude = item.itemInfo.properties.get('altitude').get('_length');
|
|
2854
2854
|
var altitudeUnit = item.itemInfo.properties.get('altitude').get('_unit') || 'cm';
|
|
2855
|
-
altitude = (0,
|
|
2855
|
+
altitude = (0, _convertUnitsLite.convert)(altitude).from(altitudeUnit).to('cm');
|
|
2856
2856
|
var thickness = 1,
|
|
2857
2857
|
/** Height --- altitude */depth;
|
|
2858
2858
|
|
|
@@ -2867,7 +2867,7 @@ function createBacksplash(item, layer, planData, scene) {
|
|
|
2867
2867
|
wallItems.map(function (wallItem) {
|
|
2868
2868
|
var altitude = wallItem.itemInfo.properties.get('altitude').get('_length');
|
|
2869
2869
|
var altitudeUnit = wallItem.itemInfo.properties.get('altitude').get('_unit') || 'cm';
|
|
2870
|
-
altitude = (0,
|
|
2870
|
+
altitude = (0, _convertUnitsLite.convert)(altitude).from(altitudeUnit).to('cm');
|
|
2871
2871
|
altItems.push({
|
|
2872
2872
|
x: wallItem.pos.x,
|
|
2873
2873
|
width: wallItem.size.width,
|
|
@@ -3059,17 +3059,17 @@ function _addMGMesh(molding, planData, layer, data, svg_width, svg_height, flag)
|
|
|
3059
3059
|
var length = data.length; //point array
|
|
3060
3060
|
var temp_unit = child.height_unit;
|
|
3061
3061
|
if (temp_unit === 'inch') {
|
|
3062
|
-
child.height = (0,
|
|
3062
|
+
child.height = (0, _convertUnitsLite.convert)(child.height).from('in').to('cm');
|
|
3063
3063
|
child.height_unit = 'cm';
|
|
3064
3064
|
}
|
|
3065
3065
|
temp_unit = child.width_unit;
|
|
3066
3066
|
if (temp_unit === 'inch') {
|
|
3067
|
-
child.width = (0,
|
|
3067
|
+
child.width = (0, _convertUnitsLite.convert)(child.width).from('in').to('cm');
|
|
3068
3068
|
child.width_unit = 'cm';
|
|
3069
3069
|
}
|
|
3070
3070
|
temp_unit = child.length_unit;
|
|
3071
3071
|
if (temp_unit === 'inch') {
|
|
3072
|
-
child.length = (0,
|
|
3072
|
+
child.length = (0, _convertUnitsLite.convert)(child.length).from('in').to('cm');
|
|
3073
3073
|
child.length_unit = 'cm';
|
|
3074
3074
|
}
|
|
3075
3075
|
geometry.needsUpdate = true;
|
|
@@ -3596,7 +3596,7 @@ function addWarningBox(itemId, altitude, planData) {
|
|
|
3596
3596
|
deleteSpecifiedMeshObjects('WarningBox' + itemId);
|
|
3597
3597
|
var item3D = planData.sceneGraph.layers[planData.sceneData.selectedLayer].items[itemId];
|
|
3598
3598
|
if (item3D == undefined) return;
|
|
3599
|
-
var altitudeLength = (0,
|
|
3599
|
+
var altitudeLength = (0, _convertUnitsLite.convert)(altitude).from('in').to('cm');
|
|
3600
3600
|
var sBounding = item3D.children[0].userData;
|
|
3601
3601
|
var width = sBounding.max.x - sBounding.min.x;
|
|
3602
3602
|
var height = sBounding.max.y - sBounding.min.y;
|
|
@@ -3635,7 +3635,7 @@ function checkCabinetOverlap(itemPos, itemRect, holeItems, planData) {
|
|
|
3635
3635
|
if (i != holeItems.length) {
|
|
3636
3636
|
var altitude = itemRect.itemInfo.properties.get('altitude').get('_length');
|
|
3637
3637
|
var altitudeUnit = itemRect.itemInfo.properties.get('altitude').get('_unit') || 'cm';
|
|
3638
|
-
altitude = (0,
|
|
3638
|
+
altitude = (0, _convertUnitsLite.convert)(altitude).from(altitudeUnit).to('cm');
|
|
3639
3639
|
addWarningBox(itemRect.itemInfo.id, altitude, planData);
|
|
3640
3640
|
}
|
|
3641
3641
|
}
|
|
@@ -14,9 +14,8 @@ var _threeMemoryCleaner = require("./three-memory-cleaner");
|
|
|
14
14
|
var _immutablediff = _interopRequireDefault(require("immutablediff"));
|
|
15
15
|
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
16
16
|
var _constants = require("../../constants");
|
|
17
|
-
var _util = require("util");
|
|
18
17
|
var _geometry = require("../../utils/geometry");
|
|
19
|
-
var
|
|
18
|
+
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
20
19
|
var _export = require("../../utils/export");
|
|
21
20
|
var _helper = require("../../utils/helper");
|
|
22
21
|
var _RGBELoader = require("three/examples/jsm/loaders/RGBELoader");
|
|
@@ -289,7 +288,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
289
288
|
realVec.push(vec);
|
|
290
289
|
});
|
|
291
290
|
if (aVertices.includes(realVec[0]) && aVertices.includes(realVec[1])) {
|
|
292
|
-
height = (0,
|
|
291
|
+
height = (0, _convertUnitsLite.convert)(layer.ceilHeight).from(layer.unit).to(_constants.UNIT_CENTIMETER);
|
|
293
292
|
// height = data.properties.getIn(['height', 'length']);
|
|
294
293
|
return 1; // break
|
|
295
294
|
}
|
|
@@ -662,6 +661,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
662
661
|
item: _item2,
|
|
663
662
|
cat: ocat
|
|
664
663
|
};
|
|
664
|
+
console.log('currentItem =>', currentItem);
|
|
665
665
|
if (_export.GeometryUtils.needSnap(currentItem, otherItem) && otherItem.cat.type != 'cabinet') {
|
|
666
666
|
var tRot = _item2.rotation;
|
|
667
667
|
var tPos = new Three.Vector2(_item2.x, _item2.y);
|
|
@@ -834,7 +834,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
834
834
|
var tRot = layer.getIn(['items', target.userData.itemId]) ? layer.getIn(['items', target.userData.itemId]).rotation : 0;
|
|
835
835
|
var item = layer.getIn(['items', source.userData.itemId]);
|
|
836
836
|
var layoutType = item.layoutpos;
|
|
837
|
-
var altitudeLength = (0,
|
|
837
|
+
var altitudeLength = (0, _convertUnitsLite.convert)(item.properties.getIn(['altitude', '_length'])).from('in').to('cm');
|
|
838
838
|
var sBounding = source.children[0].userData;
|
|
839
839
|
var tBounding = target.children[0].userData;
|
|
840
840
|
var tPos = target.position.clone();
|
|
@@ -935,7 +935,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
935
935
|
return;
|
|
936
936
|
} else {
|
|
937
937
|
var _layoutType = _item3.layoutpos;
|
|
938
|
-
var _altitudeLength = (0,
|
|
938
|
+
var _altitudeLength = (0, _convertUnitsLite.convert)(_item3.properties.getIn(['altitude', '_length'])).from('in').to('cm');
|
|
939
939
|
var _sBounding = source.children[0].userData;
|
|
940
940
|
var _width = _sBounding.max.x - _sBounding.min.x;
|
|
941
941
|
var _height = _sBounding.max.y - _sBounding.min.y;
|
|
@@ -1200,7 +1200,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1200
1200
|
var properties = allItemRect.cur.itemInfo.properties;
|
|
1201
1201
|
altitude = properties.getIn(['altitude', '_length']);
|
|
1202
1202
|
var unit = properties.getIn(['altitude', '_unit']) || 'in';
|
|
1203
|
-
altitude = (0,
|
|
1203
|
+
altitude = (0, _convertUnitsLite.convert)(altitude).from(unit).to(_this2.props.state.scene.unit);
|
|
1204
1204
|
}
|
|
1205
1205
|
getPoint(event, altitude);
|
|
1206
1206
|
var state = _this2.props.state;
|
|
@@ -1292,13 +1292,13 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1292
1292
|
var _properties = allItemRect.cur.itemInfo.properties;
|
|
1293
1293
|
alti = _properties.getIn(['altitude', '_length']);
|
|
1294
1294
|
var _unit = _properties.getIn(['altitude', '_unit']) || 'in';
|
|
1295
|
-
alti = (0,
|
|
1295
|
+
alti = (0, _convertUnitsLite.convert)(alti).from(_unit).to(_this2.props.state.scene.unit);
|
|
1296
1296
|
}
|
|
1297
1297
|
getPoint({
|
|
1298
1298
|
offsetX: event.offsetX - 50,
|
|
1299
1299
|
offsetY: event.offsetY
|
|
1300
1300
|
}, alti);
|
|
1301
|
-
if (
|
|
1301
|
+
if (!selectedItem) return;
|
|
1302
1302
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1303
1303
|
lastAngle = 0;
|
|
1304
1304
|
angleObj.position.set(planData.plan.position.x + Point.x, selItem.category === 'lighting' ? -planData.plan.position.y - selItem.properties.get('height').get('length') : selItem.properties.get('altitude').get('length') + planData.plan.position.y, planData.plan.position.z - Point.y);
|
|
@@ -1356,7 +1356,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1356
1356
|
var properties = allItemRect.cur.itemInfo.properties;
|
|
1357
1357
|
altitude = properties.getIn(['altitude', '_length']);
|
|
1358
1358
|
var unit = properties.getIn(['altitude', '_unit']) || 'in';
|
|
1359
|
-
altitude = (0,
|
|
1359
|
+
altitude = (0, _convertUnitsLite.convert)(altitude).from(unit).to(_this2.props.state.scene.unit);
|
|
1360
1360
|
}
|
|
1361
1361
|
scene3D.remove(angleObj);
|
|
1362
1362
|
scene3D.remove(toolObj);
|
|
@@ -1469,7 +1469,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1469
1469
|
setTimeout(function () {
|
|
1470
1470
|
(0, _sceneCreator.getDistances)(layer);
|
|
1471
1471
|
var selectedItem = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
1472
|
-
if (
|
|
1472
|
+
if (!selectedItem) return;
|
|
1473
1473
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1474
1474
|
var itemPos = selectedItem.position.clone();
|
|
1475
1475
|
if (intersects[_i10].object.parent && intersects[_i10].object.parent.parent.userData.itemId === selectedItem.userData.itemId) {
|
|
@@ -1545,13 +1545,13 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1545
1545
|
var _properties2 = allItemRect.cur.itemInfo.properties;
|
|
1546
1546
|
alti = _properties2.getIn(['altitude', '_length']);
|
|
1547
1547
|
var _unit2 = _properties2.getIn(['altitude', '_unit']) || 'in';
|
|
1548
|
-
alti = (0,
|
|
1548
|
+
alti = (0, _convertUnitsLite.convert)(alti).from(_unit2).to(_this2.props.state.scene.unit);
|
|
1549
1549
|
}
|
|
1550
1550
|
getPoint(event, alti);
|
|
1551
1551
|
if (bRotate) {
|
|
1552
1552
|
var _intersects$_i;
|
|
1553
1553
|
var selectedItem = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
1554
|
-
if (
|
|
1554
|
+
if (!selectedItem) return;
|
|
1555
1555
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1556
1556
|
var itemPos = selectedItem.position.clone();
|
|
1557
1557
|
if (((_intersects$_i = intersects[_i10]) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.object) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.parent) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.parent) === null || _intersects$_i === void 0 || (_intersects$_i = _intersects$_i.userData) === null || _intersects$_i === void 0 ? void 0 : _intersects$_i.itemId) === selectedItem.userData.itemId) {
|
|
@@ -1569,7 +1569,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1569
1569
|
if (bMove) {
|
|
1570
1570
|
bMove = false;
|
|
1571
1571
|
var _selectedItem = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
1572
|
-
if (
|
|
1572
|
+
if (!_selectedItem) return;
|
|
1573
1573
|
var _selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
1574
1574
|
var _itemPos = _selectedItem.position.clone();
|
|
1575
1575
|
if (intersects[_i10].object.parent.parent.userData.itemId === _selectedItem.userData.itemId) {
|
|
@@ -1618,7 +1618,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
1618
1618
|
var properties = allItemRect.cur.itemInfo.properties;
|
|
1619
1619
|
altitude = properties.getIn(['altitude', '_length']);
|
|
1620
1620
|
var unit = properties.getIn(['altitude', '_unit']) || 'in';
|
|
1621
|
-
altitude = (0,
|
|
1621
|
+
altitude = (0, _convertUnitsLite.convert)(altitude).from(unit).to(_this2.props.state.scene.unit);
|
|
1622
1622
|
}
|
|
1623
1623
|
if (_this2.props.state.mode === _constants.MODE_DRAWING_HOLE_3D) {
|
|
1624
1624
|
gridPlanOrigin = gridPlane.position;
|
|
@@ -2049,7 +2049,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
2049
2049
|
setTimeout(function () {
|
|
2050
2050
|
try {
|
|
2051
2051
|
currentObject = planData.sceneGraph.layers[selectedObject.layerID].items[selectedObject.itemID];
|
|
2052
|
-
if (
|
|
2052
|
+
if (!currentObject) return;
|
|
2053
2053
|
var selItem = _this2.props.state.scene.layers.get(selectedObject.layerID).items.get(selectedObject.itemID);
|
|
2054
2054
|
var itemPos = currentObject.position.clone();
|
|
2055
2055
|
toolObj.position.set(planData.plan.position.x + itemPos.x, selItem.category === 'lighting' ? -planData.plan.position.y - selItem.properties.get('height').get('length') : planData.plan.position.y + currentObject.children[0].position.y, planData.plan.position.z + itemPos.z);
|
|
@@ -2078,7 +2078,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
2078
2078
|
// In elevation view, set Orthographic camera's position, angle and rotation about selected line
|
|
2079
2079
|
var layers = scene.layers;
|
|
2080
2080
|
var selectedLayer = layers.get(scene.selectedLayer);
|
|
2081
|
-
var ceilHeight = (0,
|
|
2081
|
+
var ceilHeight = (0, _convertUnitsLite.convert)(selectedLayer.ceilHeight).from(selectedLayer.unit).to(scene.unit);
|
|
2082
2082
|
var lines = [];
|
|
2083
2083
|
var selectedLine = selectedLayer.lines.get(selectedLayer.selected.lines.toJS()[0]);
|
|
2084
2084
|
var vertex0 = selectedLayer.vertices.get(selectedLine.vertices.get(0));
|
|
@@ -2312,7 +2312,7 @@ var Scene3DViewer = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
2312
2312
|
var width = nextProps.width,
|
|
2313
2313
|
height = nextProps.height;
|
|
2314
2314
|
var selectedLayer = nextProps.state.getIn(['scene', 'layers', nextProps.state.scene.selectedLayer]);
|
|
2315
|
-
var ceilHeight = (0,
|
|
2315
|
+
var ceilHeight = (0, _convertUnitsLite.convert)(selectedLayer.ceilHeight).from(selectedLayer.unit).to(nextProps.state.scene.unit);
|
|
2316
2316
|
var actions = {
|
|
2317
2317
|
areaActions: this.context.areaActions,
|
|
2318
2318
|
holesActions: this.context.holesActions,
|