kitchen-simulator 3.13.0 → 3.15.0
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/catalog/factories/area-factory-3d.js +17 -17
- package/es/catalog/utils/item-loader.js +1 -1
- package/es/class/hole.js +0 -2
- package/es/class/project.js +12 -4
- package/es/devLiteRenderer.js +99 -99
- package/es/index.js +1 -1
- package/es/utils/geometry.js +1 -1
- package/es/utils/isolate-event-handler.js +6 -3
- package/es/utils/molding.js +242 -28
- package/lib/catalog/factories/area-factory-3d.js +14 -14
- package/lib/catalog/utils/item-loader.js +1 -1
- package/lib/class/hole.js +0 -2
- package/lib/class/project.js +12 -4
- package/lib/devLiteRenderer.js +94 -94
- package/lib/index.js +1 -1
- package/lib/utils/geometry.js +1 -1
- package/lib/utils/isolate-event-handler.js +5 -2
- package/lib/utils/molding.js +243 -27
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as Three from
|
|
2
|
-
import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from 'three';
|
|
3
3
|
import * as SharedStyle from "../../shared-style";
|
|
4
|
-
import { RGBELoader } from
|
|
4
|
+
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
|
|
5
5
|
var params = {
|
|
6
|
-
envMap:
|
|
6
|
+
envMap: 'HDR',
|
|
7
7
|
roughness: 0.9,
|
|
8
8
|
metalness: 0.8,
|
|
9
9
|
exposure: 1.0
|
|
@@ -58,7 +58,7 @@ var assignUVs = function assignUVs(geometry) {
|
|
|
58
58
|
var y3 = position.getY(i + 2);
|
|
59
59
|
uvArray.push((x1 + offset.x) / range.x, (y1 + offset.y) / range.y, (x2 + offset.x) / range.x, (y2 + offset.y) / range.y, (x3 + offset.x) / range.x, (y3 + offset.y) / range.y);
|
|
60
60
|
}
|
|
61
|
-
geometry.setAttribute(
|
|
61
|
+
geometry.setAttribute('uv', new Three.BufferAttribute(new Float32Array(uvArray), 2));
|
|
62
62
|
geometry.needsUpdate = true;
|
|
63
63
|
};
|
|
64
64
|
export function createArea(element, layer, scene, textures) {
|
|
@@ -69,15 +69,15 @@ export function createArea(element, layer, scene, textures) {
|
|
|
69
69
|
var texture = element.texture;
|
|
70
70
|
texture.lengthRepeatScale = 0.01;
|
|
71
71
|
texture.heightRepeatScale = 0.01;
|
|
72
|
-
var color = element.properties.get(
|
|
72
|
+
var color = element.properties.get('patternColor');
|
|
73
73
|
if (element.selected) {
|
|
74
74
|
color = SharedStyle.AREA_MESH_COLOR.selected;
|
|
75
75
|
} else {
|
|
76
76
|
color = SharedStyle.AREA_MESH_COLOR.unselected;
|
|
77
77
|
}
|
|
78
|
-
if (texture.uri === undefined || texture.uri ==
|
|
78
|
+
if (texture.uri === undefined || texture.uri == '') {
|
|
79
79
|
// @todo THIS IS A TEMPORARY FIX TO HAVE A DEFAULT FLOOR TEXTURE
|
|
80
|
-
texture.uri = layer.floorStyle.uri ||
|
|
80
|
+
texture.uri = layer.floorStyle.uri || 'https://media.test.diydesignspace.com/uploads/CountTop/202203162950_2/texture/oak-barcelona-s.jpg';
|
|
81
81
|
}
|
|
82
82
|
var shape = new Shape();
|
|
83
83
|
shape.moveTo(vertices[0].x, vertices[0].y);
|
|
@@ -85,7 +85,7 @@ export function createArea(element, layer, scene, textures) {
|
|
|
85
85
|
shape.lineTo(vertices[i].x, vertices[i].y);
|
|
86
86
|
}
|
|
87
87
|
function loadFloorENV() {
|
|
88
|
-
return new RGBELoader().load(
|
|
88
|
+
return new RGBELoader().load('/assets/Window.hdr', function (texture) {
|
|
89
89
|
texture.mapping = Three.EquirectangularReflectionMapping;
|
|
90
90
|
return texture;
|
|
91
91
|
});
|
|
@@ -105,8 +105,8 @@ export function createArea(element, layer, scene, textures) {
|
|
|
105
105
|
/* Create holes for the area */
|
|
106
106
|
element.holes.forEach(function (holeID) {
|
|
107
107
|
var holeCoords = [];
|
|
108
|
-
layer.getIn([
|
|
109
|
-
var _layer$getIn = layer.getIn([
|
|
108
|
+
layer.getIn(['areas', holeID, 'vertices']).forEach(function (vertexID) {
|
|
109
|
+
var _layer$getIn = layer.getIn(['vertices', vertexID]),
|
|
110
110
|
x = _layer$getIn.x,
|
|
111
111
|
y = _layer$getIn.y;
|
|
112
112
|
holeCoords.push([x, y]);
|
|
@@ -133,7 +133,7 @@ export function createArea(element, layer, scene, textures) {
|
|
|
133
133
|
var area = new Mesh(shapeGeometry, areaMaterial);
|
|
134
134
|
area.rotation.x -= Math.PI / 2;
|
|
135
135
|
area.receiveShadow = true;
|
|
136
|
-
area.name =
|
|
136
|
+
area.name = 'floor';
|
|
137
137
|
// This mesh is use for creating ceiling mesh
|
|
138
138
|
|
|
139
139
|
var shapeGeometry2 = new Three.ShapeGeometry(shape);
|
|
@@ -144,7 +144,7 @@ export function createArea(element, layer, scene, textures) {
|
|
|
144
144
|
area2.castShadow = true;
|
|
145
145
|
area2.rotation.x -= Math.PI / 2;
|
|
146
146
|
area2.receiveShadow = true;
|
|
147
|
-
area2.name =
|
|
147
|
+
area2.name = 'floorSupport';
|
|
148
148
|
var floorSupport = area2.clone();
|
|
149
149
|
area.userData.floorSupport = floorSupport;
|
|
150
150
|
return Promise.resolve(area);
|
|
@@ -154,13 +154,13 @@ export function updatedArea(element, layer, scene, textures, mesh, oldElement, d
|
|
|
154
154
|
selfDestroy();
|
|
155
155
|
return selfBuild();
|
|
156
156
|
};
|
|
157
|
-
var floor = mesh.getObjectByName(
|
|
157
|
+
var floor = mesh.getObjectByName('floor');
|
|
158
158
|
floor.receiveShadow = true;
|
|
159
|
-
if (differences[0] ==
|
|
159
|
+
if (differences[0] == 'selected') {
|
|
160
160
|
var color = element.selected ? SharedStyle.AREA_MESH_COLOR.selected : SharedStyle.AREA_MESH_COLOR.unselected;
|
|
161
161
|
floor.material.color.set(color);
|
|
162
|
-
} else if (differences[0] ==
|
|
163
|
-
if (differences[1] ===
|
|
162
|
+
} else if (differences[0] == 'properties') {
|
|
163
|
+
if (differences[1] === 'texture') {
|
|
164
164
|
return noPerf();
|
|
165
165
|
}
|
|
166
166
|
} else return noPerf();
|
|
@@ -997,7 +997,7 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
|
|
|
997
997
|
counterTop = counterTop.toJS();
|
|
998
998
|
} catch (error) {
|
|
999
999
|
//@todo THIS IS A TEMPORARY FIX FOR COUNTERTOP TEXTURE UNDEFINED ISSUE
|
|
1000
|
-
counterTop.uri = '
|
|
1000
|
+
counterTop.uri = 'https://media.test.diydesignspace.com/uploads/CountTop/202105074107_5/texture/Unique_Calcatta_texture.jpg';
|
|
1001
1001
|
console.log(error);
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
package/es/class/hole.js
CHANGED
|
@@ -777,11 +777,9 @@ var Hole = /*#__PURE__*/function () {
|
|
|
777
777
|
scene: scene.mergeIn(['layers', layerID, 'holes', holeID], hole)
|
|
778
778
|
});
|
|
779
779
|
state = state.updateIn(['scene', 'layers', layerID, 'lines', hole.line, 'holes'], function (holes) {
|
|
780
|
-
console.log(holes, 'holes');
|
|
781
780
|
var index = holes.findIndex(function (ID) {
|
|
782
781
|
return holeID === ID;
|
|
783
782
|
});
|
|
784
|
-
console.log(index, 'index');
|
|
785
783
|
return index === -1 ? holes.push(holeID) : holes;
|
|
786
784
|
});
|
|
787
785
|
return {
|
package/es/class/project.js
CHANGED
|
@@ -34,7 +34,8 @@ var Project = /*#__PURE__*/function () {
|
|
|
34
34
|
}, {
|
|
35
35
|
key: "newProject",
|
|
36
36
|
value: function newProject(state) {
|
|
37
|
-
var
|
|
37
|
+
var _state$toJS$doorStyle, _state;
|
|
38
|
+
var doorStyle = (_state$toJS$doorStyle = (_state = state) === null || _state === void 0 || (_state = _state.toJS()) === null || _state === void 0 ? void 0 : _state.doorStyle) !== null && _state$toJS$doorStyle !== void 0 ? _state$toJS$doorStyle : null;
|
|
38
39
|
// let counterTop = state.getIn(['scene', 'layers', layerID, 'counterTop']);
|
|
39
40
|
// let floorStyle = state.getIn(['scene', 'layers', layerID, 'floorStyle']);
|
|
40
41
|
var _viewer2D = state.viewer2D;
|
|
@@ -74,9 +75,9 @@ var Project = /*#__PURE__*/function () {
|
|
|
74
75
|
a: 0.99,
|
|
75
76
|
d: 0.99
|
|
76
77
|
});
|
|
77
|
-
var
|
|
78
|
-
oldScene =
|
|
79
|
-
oldSceneHistory =
|
|
78
|
+
var _state2 = state,
|
|
79
|
+
oldScene = _state2.scene,
|
|
80
|
+
oldSceneHistory = _state2.sceneHistory;
|
|
80
81
|
var json_items = sceneJSON.layers[sceneJSON.selectedLayer].items;
|
|
81
82
|
var elements = state.catalog.get('elements').toArray();
|
|
82
83
|
var _loop = function _loop(x) {
|
|
@@ -829,6 +830,10 @@ var Project = /*#__PURE__*/function () {
|
|
|
829
830
|
key: "createRoomWithShape",
|
|
830
831
|
value: function createRoomWithShape(state, roomShapeType, width, height, doorStyle) {
|
|
831
832
|
var catalog = state.catalog;
|
|
833
|
+
// keep measurement unit
|
|
834
|
+
var curLayerID = state.scene.selectedLayer;
|
|
835
|
+
var layerUnit = state.getIn(['scene', 'layers', curLayerID, 'unit']);
|
|
836
|
+
var ceilHeight = state.getIn(['scene', 'layers', curLayerID, 'ceilHeight']);
|
|
832
837
|
state = this.newProject(state).updatedState;
|
|
833
838
|
state = state.merge({
|
|
834
839
|
catalog: catalog
|
|
@@ -912,6 +917,9 @@ var Project = /*#__PURE__*/function () {
|
|
|
912
917
|
}
|
|
913
918
|
state = Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
|
|
914
919
|
}
|
|
920
|
+
// copy keeped measurement unit
|
|
921
|
+
state = state.setIn(['scene', 'layers', layerID, 'unit'], layerUnit);
|
|
922
|
+
state = state.setIn(['scene', 'layers', layerID, 'ceilHeight'], ceilHeight);
|
|
915
923
|
state = centering2D(state);
|
|
916
924
|
return {
|
|
917
925
|
updatedState: state
|
package/es/devLiteRenderer.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import React, { useState, useEffect } from
|
|
5
|
-
import { Map } from
|
|
6
|
-
import ContainerDimensions from
|
|
4
|
+
import React, { useState, useEffect } from 'react';
|
|
5
|
+
import { Map } from 'immutable';
|
|
6
|
+
import ContainerDimensions from 'react-container-dimensions';
|
|
7
7
|
import projectItemsCatalog from "./mocks/projectItemsCatalog.json";
|
|
8
8
|
import mockProps from "./mocks/mockProps.json";
|
|
9
9
|
import cabinetPaylod from "./mocks/cabinetPayload2.json";
|
|
@@ -17,15 +17,15 @@ import furnishingPayload from "./mocks/furnishingPayload.json";
|
|
|
17
17
|
import rectangleData from "./mocks/rectangleShape.json";
|
|
18
18
|
import moldingPayload from "./mocks/moldingPayload.json";
|
|
19
19
|
import replaceCabinetPayload from "./mocks/replaceCabinetPayload.json";
|
|
20
|
-
import ReactDOM from
|
|
20
|
+
import ReactDOM from 'react-dom';
|
|
21
21
|
import LiteRenderer from "./LiteRenderer";
|
|
22
|
-
import { Button } from
|
|
22
|
+
import { Button } from 'antd';
|
|
23
23
|
import { LEFT, RIGHT, TOP, BOTTOM, EXTERNAL_EVENT_ADD_ITEM, EXTERNAL_EVENT_ADD_WALL, EXTERNAL_EVENT_TOGGLE_TO_3D, EXTERNAL_EVENT_TOGGLE_TO_2D, EXTERNAL_EVENT_TOGGLE_TO_ELEVATION, EXTERNAL_EVENT_MOVE_PAN, EXTERNAL_EVENT_NEW_PROJECT, EXTERNAL_EVENT_CHANGE_DOORSTYLE, EXTERNAL_EVENT_ADD_ROOM_SHAPE, EXTERNAL_EVENT_ZOOM_IN, EXTERNAL_EVENT_ZOOM_OUT, EXTERNAL_EVENT_UNDO, EXTERNAL_EVENT_REDO, EXTERNAL_EVENT_SET_MOLDING, EXTERNAL_EVENT_PROJECT_SETTING, PROJECT_SETTING_OPTION, EXTERNAL_EVENT_SYNC_SCENE, EXTERNAL_EVENT_UPDATE_ATTRIBUTE, BACK_DIST_ANG, ATT_ITEM_POS, ATT_ITEM_ROTATION, ATT_LINE_LENGTH, EXTERNAL_EVENT_UPDATE_PROPERTY, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, EXTERNAL_EVENT_LOAD_PROJECT, INTERNAL_EVENT_ITEMS_CATALOG, EXTERNAL_EVENT_ADD_HOLE, HOLE_NAMES, EXTERNAL_EVENT_CENTERING_2D, PROP_ALTITUDE, EXTERNAL_EVENT_DUPLICATE_ELEMENT, ELEMENT_ITEM, EXTERNAL_EVENT_DELETE_ELEMENT, PROP_RESIZE_WIDTH, EXTERNAL_EVENT_REPLACE_CABINET, EXTERNAL_EVENT_SET_FINISHING, FINISHING_TYPE, EXTERNAL_EVENT_ROTATE_PAN } from "./constants";
|
|
24
24
|
import { convert } from "./utils/convert-units-lite";
|
|
25
25
|
|
|
26
26
|
// --- renderer props ---
|
|
27
27
|
var options = {
|
|
28
|
-
unit:
|
|
28
|
+
unit: 'in',
|
|
29
29
|
enable3D: true
|
|
30
30
|
};
|
|
31
31
|
var onInternalEvent = /*#__PURE__*/function () {
|
|
@@ -34,7 +34,7 @@ var onInternalEvent = /*#__PURE__*/function () {
|
|
|
34
34
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
35
35
|
while (1) switch (_context.prev = _context.next) {
|
|
36
36
|
case 0:
|
|
37
|
-
console.log(
|
|
37
|
+
console.log('EVENT:', evt.type, evt.value);
|
|
38
38
|
_t = evt.type;
|
|
39
39
|
_context.next = _t === INTERNAL_EVENT_ITEMS_CATALOG ? 1 : 3;
|
|
40
40
|
break;
|
|
@@ -53,7 +53,7 @@ var onInternalEvent = /*#__PURE__*/function () {
|
|
|
53
53
|
return _ref.apply(this, arguments);
|
|
54
54
|
};
|
|
55
55
|
}();
|
|
56
|
-
document.getElementById(
|
|
56
|
+
document.getElementById('app').style.display = 'block';
|
|
57
57
|
function WorkSpace(props) {
|
|
58
58
|
var _useState = useState(null),
|
|
59
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -242,91 +242,91 @@ function WorkSpace(props) {
|
|
|
242
242
|
var evt = {
|
|
243
243
|
type: EXTERNAL_EVENT_ADD_ROOM_SHAPE,
|
|
244
244
|
payload: {
|
|
245
|
-
roomShapeType:
|
|
245
|
+
roomShapeType: 'rectangle',
|
|
246
246
|
width: 250,
|
|
247
247
|
height: 100,
|
|
248
248
|
doorStyle: {
|
|
249
249
|
id: 36,
|
|
250
|
-
type:
|
|
251
|
-
name:
|
|
252
|
-
thumbnail:
|
|
253
|
-
texture:
|
|
254
|
-
color:
|
|
250
|
+
type: 'door',
|
|
251
|
+
name: 'Brilliant White Shaker',
|
|
252
|
+
thumbnail: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/thumbnail/Brilliant%20White%20Shaker%20-%20RTA.jpg',
|
|
253
|
+
texture: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
254
|
+
color: '#ffffff',
|
|
255
255
|
glossness: 1,
|
|
256
256
|
door_style_id: 42,
|
|
257
257
|
brightness: 1,
|
|
258
|
-
sku:
|
|
259
|
-
color_family:
|
|
260
|
-
color_sku_alias:
|
|
261
|
-
door_style_name:
|
|
262
|
-
install:
|
|
258
|
+
sku: 'SW',
|
|
259
|
+
color_family: ',10,',
|
|
260
|
+
color_sku_alias: 'SW',
|
|
261
|
+
door_style_name: 'Shaker',
|
|
262
|
+
install: '',
|
|
263
263
|
doorStyles: {
|
|
264
|
-
base:
|
|
265
|
-
counttop:
|
|
266
|
-
interior:
|
|
267
|
-
base_door_1:
|
|
268
|
-
base_fixed_drawer_door_1:
|
|
269
|
-
base_drawer_1:
|
|
270
|
-
base_drawer_door_1:
|
|
271
|
-
door_handle_1:
|
|
272
|
-
fixed_drawer_door_handle_1:
|
|
273
|
-
drawer_door_handle_1:
|
|
274
|
-
base_door_2:
|
|
275
|
-
base_fixed_drawer_door_2:
|
|
276
|
-
base_drawer_2:
|
|
277
|
-
base_drawer_door_2:
|
|
278
|
-
door_handle_2:
|
|
279
|
-
fixed_drawer_door_handle_2:
|
|
280
|
-
drawer_door_handle_2:
|
|
281
|
-
base_door_3:
|
|
282
|
-
base_fixed_drawer_door_3:
|
|
283
|
-
base_drawer_3:
|
|
284
|
-
base_drawer_door_3:
|
|
285
|
-
door_handle_3:
|
|
286
|
-
fixed_drawer_door_handle_3:
|
|
287
|
-
drawer_door_handle_3:
|
|
288
|
-
base_door_4:
|
|
289
|
-
base_fixed_drawer_door_4:
|
|
290
|
-
base_drawer_4:
|
|
291
|
-
base_drawer_door_4:
|
|
292
|
-
door_handle_4:
|
|
293
|
-
fixed_drawer_door_handle_4:
|
|
294
|
-
drawer_door_handle_4:
|
|
295
|
-
base_door_5:
|
|
296
|
-
base_fixed_drawer_door_5:
|
|
297
|
-
base_drawer_5:
|
|
298
|
-
base_drawer_door_5:
|
|
299
|
-
door_handle_5:
|
|
300
|
-
fixed_drawer_door_handle_5:
|
|
301
|
-
drawer_door_handle_5:
|
|
302
|
-
base_door_6:
|
|
303
|
-
base_fixed_drawer_door_6:
|
|
304
|
-
base_drawer_6:
|
|
305
|
-
base_drawer_door_6:
|
|
306
|
-
door_handle_6:
|
|
307
|
-
fixed_drawer_door_handle_6:
|
|
308
|
-
drawer_door_handle_6:
|
|
309
|
-
base_door_7:
|
|
310
|
-
base_fixed_drawer_door_7:
|
|
311
|
-
base_drawer_7:
|
|
312
|
-
base_drawer_door_7:
|
|
313
|
-
door_handle_7:
|
|
314
|
-
fixed_drawer_door_handle_7:
|
|
315
|
-
drawer_door_handle_7:
|
|
316
|
-
base_door_8:
|
|
317
|
-
base_fixed_drawer_door_8:
|
|
318
|
-
base_drawer_8:
|
|
319
|
-
base_drawer_door_8:
|
|
320
|
-
door_handle_8:
|
|
321
|
-
fixed_drawer_door_handle_8:
|
|
322
|
-
drawer_door_handle_8:
|
|
323
|
-
base_door_9:
|
|
324
|
-
base_fixed_drawer_door_9:
|
|
325
|
-
base_drawer_9:
|
|
326
|
-
base_drawer_door_9:
|
|
327
|
-
door_handle_9:
|
|
328
|
-
fixed_drawer_door_handle_9:
|
|
329
|
-
drawer_door_handle_9:
|
|
264
|
+
base: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
265
|
+
counttop: 'https://media.test.diydesignspace.com/uploads/CountTop/202105074107_5/texture/Unique_Calcatta_texture.jpg',
|
|
266
|
+
interior: 'http://127.0.0.1:4002/uploads/assets/default/maple.jpg',
|
|
267
|
+
base_door_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
268
|
+
base_fixed_drawer_door_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
269
|
+
base_drawer_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
270
|
+
base_drawer_door_1: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
271
|
+
door_handle_1: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
272
|
+
fixed_drawer_door_handle_1: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
273
|
+
drawer_door_handle_1: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
274
|
+
base_door_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
275
|
+
base_fixed_drawer_door_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
276
|
+
base_drawer_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
277
|
+
base_drawer_door_2: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
278
|
+
door_handle_2: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
279
|
+
fixed_drawer_door_handle_2: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
280
|
+
drawer_door_handle_2: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
281
|
+
base_door_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
282
|
+
base_fixed_drawer_door_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
283
|
+
base_drawer_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
284
|
+
base_drawer_door_3: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
285
|
+
door_handle_3: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
286
|
+
fixed_drawer_door_handle_3: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
287
|
+
drawer_door_handle_3: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
288
|
+
base_door_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
289
|
+
base_fixed_drawer_door_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
290
|
+
base_drawer_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
291
|
+
base_drawer_door_4: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
292
|
+
door_handle_4: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
293
|
+
fixed_drawer_door_handle_4: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
294
|
+
drawer_door_handle_4: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
295
|
+
base_door_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
296
|
+
base_fixed_drawer_door_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
297
|
+
base_drawer_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
298
|
+
base_drawer_door_5: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
299
|
+
door_handle_5: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
300
|
+
fixed_drawer_door_handle_5: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
301
|
+
drawer_door_handle_5: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
302
|
+
base_door_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
303
|
+
base_fixed_drawer_door_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
304
|
+
base_drawer_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
305
|
+
base_drawer_door_6: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
306
|
+
door_handle_6: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
307
|
+
fixed_drawer_door_handle_6: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
308
|
+
drawer_door_handle_6: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
309
|
+
base_door_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
310
|
+
base_fixed_drawer_door_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
311
|
+
base_drawer_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
312
|
+
base_drawer_door_7: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
313
|
+
door_handle_7: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
314
|
+
fixed_drawer_door_handle_7: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
315
|
+
drawer_door_handle_7: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
316
|
+
base_door_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
317
|
+
base_fixed_drawer_door_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
318
|
+
base_drawer_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
319
|
+
base_drawer_door_8: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
320
|
+
door_handle_8: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
321
|
+
fixed_drawer_door_handle_8: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
322
|
+
drawer_door_handle_8: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
323
|
+
base_door_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
324
|
+
base_fixed_drawer_door_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
325
|
+
base_drawer_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
326
|
+
base_drawer_door_9: 'https://media.test.diydesignspace.com/uploads/DoorColor/202105065453_36/texture/White1px.jpeg',
|
|
327
|
+
door_handle_9: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
328
|
+
fixed_drawer_door_handle_9: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg',
|
|
329
|
+
drawer_door_handle_9: 'http://127.0.0.1:4002/uploads/assets/default/steel.jpg'
|
|
330
330
|
},
|
|
331
331
|
installation_types: [125, 124]
|
|
332
332
|
}
|
|
@@ -485,7 +485,7 @@ function WorkSpace(props) {
|
|
|
485
485
|
// cm
|
|
486
486
|
_length: 10,
|
|
487
487
|
// inch
|
|
488
|
-
_unit:
|
|
488
|
+
_unit: 'in'
|
|
489
489
|
})
|
|
490
490
|
}
|
|
491
491
|
};
|
|
@@ -498,7 +498,7 @@ function WorkSpace(props) {
|
|
|
498
498
|
type: EXTERNAL_EVENT_DUPLICATE_ELEMENT,
|
|
499
499
|
payload: {
|
|
500
500
|
elementPrototype: ELEMENT_ITEM,
|
|
501
|
-
elementId:
|
|
501
|
+
elementId: '' // id of current operating element
|
|
502
502
|
}
|
|
503
503
|
};
|
|
504
504
|
setExternalEvent(evt);
|
|
@@ -510,7 +510,7 @@ function WorkSpace(props) {
|
|
|
510
510
|
type: EXTERNAL_EVENT_DELETE_ELEMENT,
|
|
511
511
|
payload: {
|
|
512
512
|
elementPrototype: ELEMENT_ITEM,
|
|
513
|
-
elementId:
|
|
513
|
+
elementId: '' // id of current operating element
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
setExternalEvent(evt);
|
|
@@ -571,7 +571,7 @@ function WorkSpace(props) {
|
|
|
571
571
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
572
572
|
payload: {
|
|
573
573
|
category: FINISHING_TYPE.COUNTER_TOP,
|
|
574
|
-
texture:
|
|
574
|
+
texture: 'https://media.test.diydesignspace.com/uploads/CountTop/202111302746_7/texture/Arabescato_texture.jpg'
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
577
|
setExternalEvent(evt);
|
|
@@ -583,7 +583,7 @@ function WorkSpace(props) {
|
|
|
583
583
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
584
584
|
payload: {
|
|
585
585
|
category: FINISHING_TYPE.BACKSPLASH,
|
|
586
|
-
texture:
|
|
586
|
+
texture: 'https://media.test.diydesignspace.com/uploads/CountTop/202305225249_14/texture/Unique_Marquina_texture.jpg'
|
|
587
587
|
}
|
|
588
588
|
};
|
|
589
589
|
setExternalEvent(evt);
|
|
@@ -595,7 +595,7 @@ function WorkSpace(props) {
|
|
|
595
595
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
596
596
|
payload: {
|
|
597
597
|
category: FINISHING_TYPE.FLOOR_STYLE,
|
|
598
|
-
texture:
|
|
598
|
+
texture: 'https://media.test.diydesignspace.com/uploads/CountTop/202203163338_3/texture/oak-chestnut.webp'
|
|
599
599
|
}
|
|
600
600
|
};
|
|
601
601
|
setExternalEvent(evt);
|
|
@@ -607,7 +607,7 @@ function WorkSpace(props) {
|
|
|
607
607
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
608
608
|
payload: {
|
|
609
609
|
category: FINISHING_TYPE.WALL_COLOR,
|
|
610
|
-
color:
|
|
610
|
+
color: '#bab863'
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
613
|
setExternalEvent(evt);
|
|
@@ -619,7 +619,7 @@ function WorkSpace(props) {
|
|
|
619
619
|
type: EXTERNAL_EVENT_SET_FINISHING,
|
|
620
620
|
payload: {
|
|
621
621
|
category: FINISHING_TYPE.DOOR_HANDLE,
|
|
622
|
-
gltf:
|
|
622
|
+
gltf: 'https://media.test.diydesignspace.com/uploads/DoorHandle/202107294150_29/gltf/Handle1.gltf'
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
625
|
setExternalEvent(evt);
|
|
@@ -646,7 +646,7 @@ function WorkSpace(props) {
|
|
|
646
646
|
// cm
|
|
647
647
|
_length: 27,
|
|
648
648
|
// inch
|
|
649
|
-
_unit:
|
|
649
|
+
_unit: 'in'
|
|
650
650
|
})
|
|
651
651
|
}
|
|
652
652
|
};
|
|
@@ -674,7 +674,7 @@ function WorkSpace(props) {
|
|
|
674
674
|
actionType: "danger",
|
|
675
675
|
onClick: function onClick() {
|
|
676
676
|
var _tl = Math.floor(Math.random() * 50);
|
|
677
|
-
var tl = convert(_tl).from(
|
|
677
|
+
var tl = convert(_tl).from('in').to('cm');
|
|
678
678
|
var evt = {
|
|
679
679
|
type: EXTERNAL_EVENT_UPDATE_PROPERTY,
|
|
680
680
|
payload: {
|
|
@@ -682,7 +682,7 @@ function WorkSpace(props) {
|
|
|
682
682
|
value: new Map({
|
|
683
683
|
_length: _tl,
|
|
684
684
|
// inch
|
|
685
|
-
_unit:
|
|
685
|
+
_unit: 'in',
|
|
686
686
|
length: tl // cm
|
|
687
687
|
})
|
|
688
688
|
}
|
|
@@ -748,7 +748,7 @@ function WorkSpace(props) {
|
|
|
748
748
|
type: EXTERNAL_EVENT_PROJECT_SETTING,
|
|
749
749
|
payload: {
|
|
750
750
|
option: PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT,
|
|
751
|
-
value:
|
|
751
|
+
value: 'cm'
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
setExternalEvent(evt);
|
|
@@ -771,7 +771,7 @@ function WorkSpace(props) {
|
|
|
771
771
|
// externalEvent: { id?, type, payload } | null,
|
|
772
772
|
// meta?: { filename?, lineno?, colno? }
|
|
773
773
|
// }
|
|
774
|
-
console.error(
|
|
774
|
+
console.error('TOOL ERROR:', payload);
|
|
775
775
|
}
|
|
776
776
|
}));
|
|
777
777
|
}
|
|
@@ -782,4 +782,4 @@ ReactDOM.render(/*#__PURE__*/React.createElement(ContainerDimensions, null, func
|
|
|
782
782
|
width: width,
|
|
783
783
|
height: height
|
|
784
784
|
});
|
|
785
|
-
}), document.getElementById(
|
|
785
|
+
}), document.getElementById('app') && document.getElementById('app'));
|
package/es/index.js
CHANGED
|
@@ -272,7 +272,7 @@ export function renderKitchenSimulator(container) {
|
|
|
272
272
|
var waitForGltf = (_props$waitForGltfIdl = props.waitForGltfIdleAfterEachEvent) !== null && _props$waitForGltfIdl !== void 0 ? _props$waitForGltfIdl : true;
|
|
273
273
|
var defaultTimeout = (_props$gltfTimeoutMs = props.gltfTimeoutMs) !== null && _props$gltfTimeoutMs !== void 0 ? _props$gltfTimeoutMs : 30000;
|
|
274
274
|
var defaultGrace = (_props$gltfGraceMs = props.gltfGraceMs) !== null && _props$gltfGraceMs !== void 0 ? _props$gltfGraceMs : 50;
|
|
275
|
-
var syncGrace = (_props$syncGltfGraceM = props.syncGltfGraceMs) !== null && _props$syncGltfGraceM !== void 0 ? _props$syncGltfGraceM :
|
|
275
|
+
var syncGrace = (_props$syncGltfGraceM = props.syncGltfGraceMs) !== null && _props$syncGltfGraceM !== void 0 ? _props$syncGltfGraceM : 350; // SyncScene uses larger grace
|
|
276
276
|
var syncExtraFrames = (_props$syncExtraFrame = props.syncExtraFrames) !== null && _props$syncExtraFrame !== void 0 ? _props$syncExtraFrame : 2;
|
|
277
277
|
var draining = false;
|
|
278
278
|
function isSyncScene(ev) {
|
package/es/utils/geometry.js
CHANGED
|
@@ -2105,7 +2105,7 @@ export function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
|
|
|
2105
2105
|
lineSX = _sort4[0],
|
|
2106
2106
|
lineDX = _sort4[1];
|
|
2107
2107
|
var isReversedSrcLineIdx = false;
|
|
2108
|
-
if (lineSX[0].x === line1[0].x && lineSX[0].y === line1[0].y) isReversedSrcLineIdx = true;
|
|
2108
|
+
if (lineSX[0].x === line0[0].x && lineSX[0].y === line0[0].y) isReversedSrcLineIdx = false;else if (lineSX[0].x === line1[0].x && lineSX[0].y === line1[0].y) isReversedSrcLineIdx = true;
|
|
2109
2109
|
var compare0 = comparator(lineSX[0], lineDX[0]);
|
|
2110
2110
|
var compare1 = comparator(lineSX[1], lineDX[0]);
|
|
2111
2111
|
var compare2 = comparator(lineSX[1], lineDX[1]);
|
|
@@ -14,7 +14,7 @@ import { convert } from "./convert-units-lite";
|
|
|
14
14
|
import { GeometryUtils, MathUtils } from "./export";
|
|
15
15
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
16
16
|
import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
17
|
-
import {
|
|
17
|
+
import { getMoldingDataOfScene2 } from "./molding";
|
|
18
18
|
import { Scene, State } from "../models";
|
|
19
19
|
var PRECISION = 2;
|
|
20
20
|
function loadJSON(_x) {
|
|
@@ -1401,7 +1401,7 @@ function _handleExternalEvent() {
|
|
|
1401
1401
|
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1402
1402
|
return _context1.abrupt("continue", 44);
|
|
1403
1403
|
case 20:
|
|
1404
|
-
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle;
|
|
1404
|
+
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle; // console.log('****', layer);
|
|
1405
1405
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, _doorStyle);
|
|
1406
1406
|
return _context1.abrupt("continue", 44);
|
|
1407
1407
|
case 21:
|
|
@@ -1450,7 +1450,10 @@ function _handleExternalEvent() {
|
|
|
1450
1450
|
_context1.next = _t6 === PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 31 : _t6 === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 32 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 33 : _t6 === PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 34 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 35 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 36 : 37;
|
|
1451
1451
|
break;
|
|
1452
1452
|
case 31:
|
|
1453
|
+
props.viewer2DActions.updateCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1453
1454
|
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1455
|
+
props.viewer3DActions.update3DCeilHeightUnit(_value2);
|
|
1456
|
+
props.viewer3DActions.update3DCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1454
1457
|
case 32:
|
|
1455
1458
|
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1456
1459
|
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
@@ -1508,7 +1511,7 @@ function _handleExternalEvent() {
|
|
|
1508
1511
|
case 43:
|
|
1509
1512
|
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1510
1513
|
currentTexture = layer.doorStyle !== null || layer.doorStyle !== undefined ? layer.doorStyle : props.state.doorStyle.toJS();
|
|
1511
|
-
sceneData.layers[layerId].moldingData =
|
|
1514
|
+
sceneData.layers[layerId].moldingData = getMoldingDataOfScene2(layer, props.catalog, currentTexture);
|
|
1512
1515
|
// send scene object from 3DTool to HostApp using internalEvent
|
|
1513
1516
|
(_props$onInternalEven3 = props.onInternalEvent) === null || _props$onInternalEven3 === void 0 || _props$onInternalEven3.call(props, {
|
|
1514
1517
|
type: INTERNAL_EVENT_SYNC_SCENE,
|