kitchen-simulator 4.0.0-queuedEvents → 4.0.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/LiteKitchenConfigurator.js +141 -288
- package/es/LiteRenderer.js +159 -398
- package/es/actions/items-actions.js +10 -6
- package/es/actions/lines-actions.js +3 -1
- package/es/actions/project-actions.js +15 -5
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/areas/area/planner-element.js +10 -5
- package/es/catalog/catalog.js +1 -4
- package/es/catalog/factories/area-factory-3d.js +2 -1
- package/es/catalog/factories/wall-factory-3d.js +2 -2
- package/es/catalog/factories/wall-factory.js +8 -8
- package/es/catalog/lines/wall/planner-element.js +18 -9
- package/es/catalog/utils/exporter.js +7 -3
- package/es/catalog/utils/item-loader.js +24 -14
- package/es/catalog/utils/mtl-loader.js +2 -2
- package/es/catalog/utils/obj-loader.js +2 -2
- package/es/class/hole.js +0 -2
- package/es/class/item.js +183 -184
- package/es/class/line.js +11 -3
- package/es/class/project.js +165 -48
- package/es/components/content.js +19 -6
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/item.js +84 -51
- package/es/components/viewer2d/line.js +315 -243
- package/es/components/viewer2d/ruler.js +20 -38
- package/es/components/viewer2d/rulerDist.js +48 -78
- package/es/components/viewer2d/utils.js +6 -0
- package/es/components/viewer2d/viewer2d.js +298 -220
- package/es/components/viewer3d/front3D.js +3 -2
- 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 +3 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +6 -7
- package/es/components/viewer3d/scene-creator.js +51 -15
- package/es/components/viewer3d/viewer3d.js +121 -82
- package/es/constants.js +111 -3
- package/es/devLiteRenderer.js +688 -31
- package/es/index.js +567 -87
- package/es/models.js +9 -5
- package/es/plugins/SVGLoader.js +7 -5
- package/es/plugins/console-debugger.js +0 -2
- package/es/plugins/keyboard.js +15 -6
- package/es/reducers/items-reducer.js +5 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +5 -3
- package/es/shared-style.js +4 -4
- package/es/utils/geometry.js +163 -2
- package/es/utils/get-edges-of-subgraphs.js +1 -1
- package/es/utils/graph-cycles.js +1 -1
- package/es/utils/graph.js +1 -1
- package/es/utils/helper.js +105 -3
- package/es/utils/isolate-event-handler.js +1542 -164
- package/es/utils/molding.js +461 -11
- package/lib/LiteKitchenConfigurator.js +141 -289
- package/lib/LiteRenderer.js +159 -399
- package/lib/actions/items-actions.js +10 -6
- package/lib/actions/lines-actions.js +3 -1
- package/lib/actions/project-actions.js +15 -4
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/areas/area/planner-element.js +11 -5
- package/lib/catalog/catalog.js +1 -4
- package/lib/catalog/factories/area-factory-3d.js +2 -1
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/factories/wall-factory.js +8 -8
- package/lib/catalog/lines/wall/planner-element.js +19 -9
- package/lib/catalog/utils/exporter.js +7 -3
- package/lib/catalog/utils/item-loader.js +24 -14
- package/lib/catalog/utils/mtl-loader.js +9 -2
- package/lib/catalog/utils/obj-loader.js +10 -2
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +180 -181
- package/lib/class/line.js +9 -1
- package/lib/class/project.js +164 -47
- package/lib/components/content.js +19 -6
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/item.js +83 -50
- package/lib/components/viewer2d/line.js +315 -242
- package/lib/components/viewer2d/ruler.js +19 -37
- package/lib/components/viewer2d/rulerDist.js +48 -78
- package/lib/components/viewer2d/utils.js +7 -0
- package/lib/components/viewer2d/viewer2d.js +296 -219
- package/lib/components/viewer3d/front3D.js +3 -2
- package/lib/components/viewer3d/libs/mtl-loader.js +9 -2
- package/lib/components/viewer3d/libs/obj-loader.js +9 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +11 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +13 -7
- package/lib/components/viewer3d/scene-creator.js +49 -13
- package/lib/components/viewer3d/viewer3d.js +119 -80
- package/lib/constants.js +116 -7
- package/lib/devLiteRenderer.js +687 -30
- package/lib/index.js +567 -87
- package/lib/models.js +9 -5
- package/lib/plugins/SVGLoader.js +7 -5
- package/lib/plugins/console-debugger.js +0 -2
- package/lib/plugins/keyboard.js +15 -6
- package/lib/reducers/items-reducer.js +5 -5
- package/lib/reducers/lines-reducer.js +1 -1
- package/lib/reducers/project-reducer.js +4 -2
- package/lib/shared-style.js +4 -4
- package/lib/utils/geometry.js +164 -2
- package/lib/utils/get-edges-of-subgraphs.js +6 -1
- package/lib/utils/graph-cycles.js +7 -8
- package/lib/utils/graph.js +6 -1
- package/lib/utils/helper.js +108 -2
- package/lib/utils/isolate-event-handler.js +1538 -159
- package/lib/utils/molding.js +463 -9
- package/package.json +1 -1
- package/es/assets/Window.hdr +0 -2100
- package/es/assets/img/1.jpg +0 -0
- package/lib/assets/Window.hdr +0 -2100
- package/lib/assets/img/1.jpg +0 -0
|
@@ -32,9 +32,11 @@ export function editWidth(newWidth, layerID, itemID) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export function duplicateSelected(currentObject) {
|
|
35
|
+
var onInternalEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
35
36
|
return {
|
|
36
37
|
type: DUPLICATE_SELECTED,
|
|
37
|
-
currentObject: currentObject
|
|
38
|
+
currentObject: currentObject,
|
|
39
|
+
onInternalEvent: onInternalEvent
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
export function replaceItem(selectedPos, currentObject, selectedObject) {
|
|
@@ -76,11 +78,13 @@ export function selectToolDrawingItem3D(sceneComponentType) {
|
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
export function updateDrawingItem(layerID, x, y) {
|
|
81
|
+
var isInitialPos = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
79
82
|
return {
|
|
80
83
|
type: UPDATE_DRAWING_ITEM,
|
|
81
84
|
layerID: layerID,
|
|
82
85
|
x: x,
|
|
83
|
-
y: y
|
|
86
|
+
y: y,
|
|
87
|
+
isInitialPos: isInitialPos
|
|
84
88
|
};
|
|
85
89
|
}
|
|
86
90
|
export function endDrawingItem(layerID, x, y) {
|
|
@@ -223,10 +227,11 @@ export function updateItemsAltitude(layerID, itemID, value) {
|
|
|
223
227
|
value: value
|
|
224
228
|
};
|
|
225
229
|
}
|
|
226
|
-
export function setDoorStyle(doorStyle, isAll) {
|
|
230
|
+
export function setDoorStyle(doorStyle, itemCDS, isAll) {
|
|
227
231
|
return {
|
|
228
232
|
type: SET_DOOR_STYLE,
|
|
229
233
|
doorStyle: doorStyle,
|
|
234
|
+
itemCDS: itemCDS,
|
|
230
235
|
isAll: isAll
|
|
231
236
|
};
|
|
232
237
|
}
|
|
@@ -291,11 +296,10 @@ export function setModelling(model) {
|
|
|
291
296
|
model: model
|
|
292
297
|
};
|
|
293
298
|
}
|
|
294
|
-
export function setInitialDoorStyle(doorStyle
|
|
299
|
+
export function setInitialDoorStyle(doorStyle) {
|
|
295
300
|
return {
|
|
296
301
|
type: SET_INITIAL_DOOR_STYLE,
|
|
297
|
-
doorStyle: doorStyle
|
|
298
|
-
oStyle: oStyle
|
|
302
|
+
doorStyle: doorStyle
|
|
299
303
|
};
|
|
300
304
|
}
|
|
301
305
|
export function setMoveStatus(status) {
|
|
@@ -13,12 +13,14 @@ export function selectToolDrawingLine(sceneComponentType) {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export function beginDrawingLine(layerID, x, y, snapMask) {
|
|
16
|
+
var onInternalEvent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
16
17
|
return {
|
|
17
18
|
type: BEGIN_DRAWING_LINE,
|
|
18
19
|
layerID: layerID,
|
|
19
20
|
x: x,
|
|
20
21
|
y: y,
|
|
21
|
-
snapMask: snapMask
|
|
22
|
+
snapMask: snapMask,
|
|
23
|
+
onInternalEvent: onInternalEvent
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
export function updateDrawingLine(x, y, relatedLines, snapMask) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NEW_PROJECT, LOAD_PROJECT, SAVE_PROJECT, OPEN_CATALOG, SELECT_TOOL_EDIT, UNSELECT_ALL, SET_PROPERTIES, SET_ITEMS_ATTRIBUTES, SET_LINES_ATTRIBUTES, SET_HOLES_ATTRIBUTES, REMOVE, INVERT, UNDO, REDO, UNCREATE, PROJECT_RE_NAME, RECREATE, ROLLBACK, OPEN_PROJECT_CONFIGURATOR, SET_PROJECT_PROPERTIES, SET_PROJECT_ID, INIT_CATALOG, UPDATE_MOUSE_COORDS, UPDATE_ZOOM_SCALE, TOGGLE_SNAP, CHANGE_CATALOG_PAGE, GO_BACK_TO_CATALOG_PAGE, THROW_ERROR, THROW_WARNING, COPY_PROPERTIES, PASTE_PROPERTIES, PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY, ALTERATE_STATE, SET_MODE, ADD_HORIZONTAL_GUIDE, ADD_VERTICAL_GUIDE, ADD_CIRCULAR_GUIDE, REMOVE_HORIZONTAL_GUIDE, REMOVE_VERTICAL_GUIDE, REMOVE_CIRCULAR_GUIDE, REMOVE_DRAWING_SUPPORT, SELECT_ALL, SET_STATE_PROPERTIES, SHIFT2DOFF, SHIFT2DON, SET_IS_HELP, SET_IS_CABINET_DRAWING, ADD_ELEMENT_TO_CATALOG } from "../constants";
|
|
1
|
+
import { NEW_PROJECT, LOAD_PROJECT, SAVE_PROJECT, OPEN_CATALOG, SELECT_TOOL_EDIT, UNSELECT_ALL, SET_PROPERTIES, SET_ITEMS_ATTRIBUTES, SET_LINES_ATTRIBUTES, SET_HOLES_ATTRIBUTES, REMOVE, INVERT, UNDO, REDO, UNCREATE, PROJECT_RE_NAME, RECREATE, ROLLBACK, OPEN_PROJECT_CONFIGURATOR, SET_PROJECT_PROPERTIES, SET_PROJECT_ID, INIT_CATALOG, UPDATE_MOUSE_COORDS, UPDATE_ZOOM_SCALE, TOGGLE_SNAP, CHANGE_CATALOG_PAGE, GO_BACK_TO_CATALOG_PAGE, THROW_ERROR, THROW_WARNING, COPY_PROPERTIES, PASTE_PROPERTIES, PUSH_LAST_SELECTED_CATALOG_ELEMENT_TO_HISTORY, ALTERATE_STATE, SET_MODE, ADD_HORIZONTAL_GUIDE, ADD_VERTICAL_GUIDE, ADD_CIRCULAR_GUIDE, REMOVE_HORIZONTAL_GUIDE, REMOVE_VERTICAL_GUIDE, REMOVE_CIRCULAR_GUIDE, REMOVE_DRAWING_SUPPORT, SELECT_ALL, SET_STATE_PROPERTIES, SHIFT2DOFF, SHIFT2DON, SET_IS_HELP, SET_IS_CABINET_DRAWING, ADD_ELEMENT_TO_CATALOG, CREATE_ROOM_WITH_SHAPE } from "../constants";
|
|
2
2
|
export function setIsHelp(isHelp) {
|
|
3
3
|
return {
|
|
4
4
|
type: SET_IS_HELP,
|
|
@@ -17,11 +17,10 @@ export function setStateProperties(properties) {
|
|
|
17
17
|
properties: properties
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export function loadProject(sceneJSON
|
|
20
|
+
export function loadProject(sceneJSON) {
|
|
21
21
|
return {
|
|
22
22
|
type: LOAD_PROJECT,
|
|
23
|
-
sceneJSON: sceneJSON
|
|
24
|
-
categoryData: categoryData
|
|
23
|
+
sceneJSON: sceneJSON
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
26
|
export function newProject() {
|
|
@@ -99,8 +98,10 @@ export function setHolesAttributes(holesAttributes) {
|
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
100
|
export function remove() {
|
|
101
|
+
var delObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
102
102
|
return {
|
|
103
|
-
type: REMOVE
|
|
103
|
+
type: REMOVE,
|
|
104
|
+
delObject: delObject
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
export function undo() {
|
|
@@ -284,4 +285,13 @@ export function selectAll() {
|
|
|
284
285
|
type: SELECT_ALL,
|
|
285
286
|
value: value
|
|
286
287
|
};
|
|
288
|
+
}
|
|
289
|
+
export function createRoomWithShape(roomShapeType, width, height, doorStyle) {
|
|
290
|
+
return {
|
|
291
|
+
type: CREATE_ROOM_WITH_SHAPE,
|
|
292
|
+
width: width,
|
|
293
|
+
height: height,
|
|
294
|
+
roomShapeType: roomShapeType,
|
|
295
|
+
doorStyle: doorStyle
|
|
296
|
+
};
|
|
287
297
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="M8
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_1516_100789)">
|
|
3
|
+
<path d="M4.25 6L2 7.125L8 10.125L14 7.125L11.75 6" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M2 10.125L8 13.125L14 10.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M8 7.125V1.875" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M5.75 4.125L8 1.875L10.25 4.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1516_100789">
|
|
10
|
+
<rect width="16" height="16" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
6
13
|
</svg>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { AreaFactory } from "../../factories/export";
|
|
2
|
+
import parquetTexture from "./textures/parquet.jpg";
|
|
3
|
+
import tile1Texture from "./textures/tile1.jpg";
|
|
4
|
+
import ceramicTexture from "./textures/ceramic-tile.jpg";
|
|
5
|
+
import strandPorcelainTexture from "./textures/strand-porcelain.jpg";
|
|
6
|
+
import grassTexture from "./textures/grass.jpg";
|
|
2
7
|
var info = {
|
|
3
8
|
title: 'area',
|
|
4
9
|
tag: ['area'],
|
|
@@ -8,31 +13,31 @@ var info = {
|
|
|
8
13
|
var textures = {
|
|
9
14
|
parquet: {
|
|
10
15
|
name: 'Parquet',
|
|
11
|
-
uri:
|
|
16
|
+
uri: parquetTexture,
|
|
12
17
|
lengthRepeatScale: 0.004,
|
|
13
18
|
heightRepeatScale: 0.004
|
|
14
19
|
},
|
|
15
20
|
tile1: {
|
|
16
21
|
name: 'Tile1',
|
|
17
|
-
uri:
|
|
22
|
+
uri: tile1Texture,
|
|
18
23
|
lengthRepeatScale: 0.01,
|
|
19
24
|
heightRepeatScale: 0.01
|
|
20
25
|
},
|
|
21
26
|
ceramic: {
|
|
22
27
|
name: 'Ceramic Tile',
|
|
23
|
-
uri:
|
|
28
|
+
uri: ceramicTexture,
|
|
24
29
|
lengthRepeatScale: 0.02,
|
|
25
30
|
heightRepeatScale: 0.02
|
|
26
31
|
},
|
|
27
32
|
strand_porcelain: {
|
|
28
33
|
name: 'Strand Porcelain Tile',
|
|
29
|
-
uri:
|
|
34
|
+
uri: strandPorcelainTexture,
|
|
30
35
|
lengthRepeatScale: 0.02,
|
|
31
36
|
heightRepeatScale: 0.02
|
|
32
37
|
},
|
|
33
38
|
grass: {
|
|
34
39
|
name: 'Grass',
|
|
35
|
-
uri:
|
|
40
|
+
uri: grassTexture,
|
|
36
41
|
lengthRepeatScale: 0.01,
|
|
37
42
|
heightRepeatScale: 0.01
|
|
38
43
|
}
|
package/es/catalog/catalog.js
CHANGED
|
@@ -247,10 +247,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
247
247
|
if (name === '') {
|
|
248
248
|
throw new Error('Category has empty name');
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
throw new Error('Category has already been registered');
|
|
252
|
-
}
|
|
253
|
-
return true;
|
|
250
|
+
return !this.hasCategory(name);
|
|
254
251
|
}
|
|
255
252
|
|
|
256
253
|
/**
|
|
@@ -76,7 +76,8 @@ export function createArea(element, layer, scene, textures) {
|
|
|
76
76
|
color = SharedStyle.AREA_MESH_COLOR.unselected;
|
|
77
77
|
}
|
|
78
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 || 'https://media.test.diydesignspace.com/uploads/CountTop/202203162950_2/texture/oak-barcelona-s.jpg';
|
|
80
81
|
}
|
|
81
82
|
var shape = new Shape();
|
|
82
83
|
shape.moveTo(vertices[0].x, vertices[0].y);
|
|
@@ -25,13 +25,13 @@ var halfPI = Math.PI / 2;
|
|
|
25
25
|
var applyTexture = function applyTexture(material, texture, length, height) {
|
|
26
26
|
var loader = new TextureLoader();
|
|
27
27
|
if (texture) {
|
|
28
|
-
material.map = loader.load(texture.uri
|
|
28
|
+
material.map = loader.load(texture.uri);
|
|
29
29
|
material.map.colorSpace = Three.SRGBColorSpace, material.needsUpdate = true;
|
|
30
30
|
material.map.wrapS = RepeatWrapping;
|
|
31
31
|
material.map.wrapT = RepeatWrapping;
|
|
32
32
|
material.map.repeat.set(length * texture.lengthRepeatScale, height * texture.heightRepeatScale);
|
|
33
33
|
if (texture.normal) {
|
|
34
|
-
material.normalMap = loader.load(texture.normal.uri
|
|
34
|
+
material.normalMap = loader.load(texture.normal.uri);
|
|
35
35
|
material.normalScale = new Vector2(texture.normal.normalScaleX, texture.normal.normalScaleY);
|
|
36
36
|
material.normalMap.wrapS = RepeatWrapping;
|
|
37
37
|
material.normalMap.wrapT = RepeatWrapping;
|
|
@@ -16,11 +16,11 @@ var STYLE_LINE = {
|
|
|
16
16
|
// strokeWidth:1
|
|
17
17
|
};
|
|
18
18
|
var STYLE_INTERIOR_LINE = {
|
|
19
|
-
strokeWidth:
|
|
19
|
+
strokeWidth: 2,
|
|
20
20
|
stroke: SharedStyle.INTERIOR_LINE.unselected
|
|
21
21
|
};
|
|
22
22
|
var STYLE_INTERIOR_LINE_SELECTED = {
|
|
23
|
-
strokeWidth:
|
|
23
|
+
strokeWidth: 4,
|
|
24
24
|
stroke: SharedStyle.INTERIOR_LINE.selected,
|
|
25
25
|
fill: SharedStyle.INTERIOR_LINE.selected,
|
|
26
26
|
rx: '2px'
|
|
@@ -213,9 +213,9 @@ export default function WallFactory(name, info, textures) {
|
|
|
213
213
|
})));
|
|
214
214
|
return !element.selected ? /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("polygon", {
|
|
215
215
|
points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
|
|
216
|
-
fill: "
|
|
217
|
-
fillRule
|
|
218
|
-
}),
|
|
216
|
+
fill: "#CFD8DC"
|
|
217
|
+
// fillRule="evenodd"
|
|
218
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
219
219
|
x1: x1,
|
|
220
220
|
y1: y1,
|
|
221
221
|
x2: x2,
|
|
@@ -223,9 +223,9 @@ export default function WallFactory(name, info, textures) {
|
|
|
223
223
|
style: STYLE_INTERIOR_LINE
|
|
224
224
|
})) : /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("polygon", {
|
|
225
225
|
points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
|
|
226
|
-
fill: "
|
|
227
|
-
fillRule
|
|
228
|
-
}),
|
|
226
|
+
fill: "#CFD8DC"
|
|
227
|
+
// fillRule="evenodd"
|
|
228
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
229
229
|
x1: x1,
|
|
230
230
|
y1: y1,
|
|
231
231
|
x2: x2,
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { WallFactory } from "../../factories/export";
|
|
2
|
+
import wallImage from "./wall.png";
|
|
3
|
+
import plasterTexture from "./textures/plaster.jpg";
|
|
4
|
+
import plasterNormal from "./textures/plaster-normal.jpg";
|
|
5
|
+
import bricksTexture from "./textures/bricks.jpg";
|
|
6
|
+
import bricksNormal from "./textures/bricks-normal.jpg";
|
|
7
|
+
import paintedTexture from "./textures/painted.jpg";
|
|
8
|
+
import paintedNormal from "./textures/painted-normal.jpg";
|
|
9
|
+
import mordenTexture from "./textures/morden.jpg";
|
|
10
|
+
import mordenNormal from "./textures/morden-normal.jpg";
|
|
2
11
|
var info = {
|
|
3
12
|
title: 'wall',
|
|
4
13
|
tag: ['wall'],
|
|
5
14
|
description: 'Wall with bricks or painted',
|
|
6
|
-
image:
|
|
15
|
+
image: wallImage,
|
|
7
16
|
visibility: {
|
|
8
17
|
catalog: true,
|
|
9
18
|
layerElementsVisible: true
|
|
@@ -12,11 +21,11 @@ var info = {
|
|
|
12
21
|
var textures = {
|
|
13
22
|
plaster: {
|
|
14
23
|
name: 'Plaster',
|
|
15
|
-
uri:
|
|
24
|
+
uri: plasterTexture,
|
|
16
25
|
lengthRepeatScale: 0.005,
|
|
17
26
|
heightRepeatScale: 0.005,
|
|
18
27
|
normal: {
|
|
19
|
-
uri:
|
|
28
|
+
uri: plasterNormal,
|
|
20
29
|
lengthRepeatScale: 0.005,
|
|
21
30
|
heightRepeatScale: 0.005,
|
|
22
31
|
normalScaleX: 0.4,
|
|
@@ -26,11 +35,11 @@ var textures = {
|
|
|
26
35
|
},
|
|
27
36
|
bricks: {
|
|
28
37
|
name: 'Bricks',
|
|
29
|
-
uri:
|
|
38
|
+
uri: bricksTexture,
|
|
30
39
|
lengthRepeatScale: 0.009,
|
|
31
40
|
heightRepeatScale: 0.009,
|
|
32
41
|
normal: {
|
|
33
|
-
uri:
|
|
42
|
+
uri: bricksNormal,
|
|
34
43
|
lengthRepeatScale: 0.009,
|
|
35
44
|
heightRepeatScale: 0.009,
|
|
36
45
|
normalScaleX: 0.4,
|
|
@@ -40,11 +49,11 @@ var textures = {
|
|
|
40
49
|
},
|
|
41
50
|
painted: {
|
|
42
51
|
name: 'Painted',
|
|
43
|
-
uri:
|
|
52
|
+
uri: paintedTexture,
|
|
44
53
|
lengthRepeatScale: 0.005,
|
|
45
54
|
heightRepeatScale: 0.005,
|
|
46
55
|
normal: {
|
|
47
|
-
uri:
|
|
56
|
+
uri: paintedNormal,
|
|
48
57
|
lengthRepeatScale: 0.005,
|
|
49
58
|
heightRepeatScale: 0.005,
|
|
50
59
|
normalScaleX: 0.4,
|
|
@@ -54,11 +63,11 @@ var textures = {
|
|
|
54
63
|
},
|
|
55
64
|
morden: {
|
|
56
65
|
name: 'Morden',
|
|
57
|
-
uri:
|
|
66
|
+
uri: mordenTexture,
|
|
58
67
|
lengthRepeatScale: 0.005,
|
|
59
68
|
heightRepeatScale: 0.005,
|
|
60
69
|
normal: {
|
|
61
|
-
uri:
|
|
70
|
+
uri: mordenNormal,
|
|
62
71
|
lengthRepeatScale: 0.005,
|
|
63
72
|
heightRepeatScale: 0.005,
|
|
64
73
|
normalScaleX: 0.4,
|
|
@@ -19,10 +19,12 @@ export default function (_ref) {
|
|
|
19
19
|
is_corner = _ref.is_corner,
|
|
20
20
|
alti = _ref.alti,
|
|
21
21
|
obj_property = _ref.obj_property,
|
|
22
|
-
outlineSVGData = _ref.outlineSVGData
|
|
22
|
+
outlineSVGData = _ref.outlineSVGData,
|
|
23
|
+
cds = _ref.cds;
|
|
23
24
|
var _length = alti || 0;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
var length = convert(_length).from('in').to('cm');
|
|
26
|
+
// const length = _length;
|
|
27
|
+
|
|
26
28
|
var additional_props = [];
|
|
27
29
|
if (type === 'cabinet' && long_name.toLowerCase().includes('filler')) {
|
|
28
30
|
additional_props = {
|
|
@@ -134,6 +136,8 @@ export default function (_ref) {
|
|
|
134
136
|
}),
|
|
135
137
|
img: base,
|
|
136
138
|
obj: obj_property,
|
|
139
|
+
cds: cds,
|
|
140
|
+
structure_json: structure_json,
|
|
137
141
|
render2D: function render2D(element, layer, scene) {
|
|
138
142
|
return render2DItem.call(this, element, layer, scene, sizeinfo, layoutpos, is_corner, shape_svg);
|
|
139
143
|
},
|
|
@@ -13,6 +13,7 @@ import { Item } from "../../models";
|
|
|
13
13
|
import * as GeomUtils from "./geom-utils";
|
|
14
14
|
import { loadGLTF } from "./load-obj";
|
|
15
15
|
import { animateDoor, isEmpty, translateDrawer } from "../../utils/helper";
|
|
16
|
+
import { isWarningItem } from "../../components/viewer2d/utils";
|
|
16
17
|
var INITIAL_NORMAL_MAP = '';
|
|
17
18
|
|
|
18
19
|
// env Map ///////////////
|
|
@@ -174,7 +175,6 @@ export function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corn
|
|
|
174
175
|
var rendered = null;
|
|
175
176
|
var svg_url, svg_width, svg_depth;
|
|
176
177
|
if (shape_svg || el_euro_shape_svg) {
|
|
177
|
-
var _element$toJS$doorSty;
|
|
178
178
|
if (typeof shape_svg == 'string' || typeof el_euro_shape_svg == 'string') {
|
|
179
179
|
if (el_DSN === 'Euro & Frameless' && el_is_euro_cds) {
|
|
180
180
|
svg_url = el_euro_shape_svg;
|
|
@@ -207,13 +207,22 @@ export function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corn
|
|
|
207
207
|
transform: "translate(".concat(-transX, "px, ").concat(-transY, "px)")
|
|
208
208
|
},
|
|
209
209
|
onMouseEnter: function onMouseEnter(event) {
|
|
210
|
-
var
|
|
211
|
-
document.getElementById('warning_box_2d')
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
var target = event.currentTarget;
|
|
211
|
+
var tooltip = document.getElementById('warning_box_2d');
|
|
212
|
+
var parent = document.querySelector('#kitchen-simulator-container');
|
|
213
|
+
if (!tooltip || !parent) return;
|
|
214
|
+
var targetRect = target.getBoundingClientRect();
|
|
215
|
+
var parentRect = parent.getBoundingClientRect();
|
|
216
|
+
var left = targetRect.left - parentRect.left;
|
|
217
|
+
var top = targetRect.top - parentRect.top;
|
|
218
|
+
tooltip.style.display = 'flex';
|
|
219
|
+
tooltip.style.left = "".concat(left, "px");
|
|
220
|
+
tooltip.style.top = "".concat(top - 60, "px");
|
|
214
221
|
},
|
|
215
222
|
onMouseLeave: function onMouseLeave() {
|
|
216
|
-
document.getElementById('warning_box_2d')
|
|
223
|
+
if (document.getElementById('warning_box_2d')) {
|
|
224
|
+
document.getElementById('warning_box_2d').style.display = 'none';
|
|
225
|
+
}
|
|
217
226
|
}
|
|
218
227
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
219
228
|
cx: 0,
|
|
@@ -299,9 +308,7 @@ export function render2DItem(element, layer, scene, sizeinfo, layoutpos, is_corn
|
|
|
299
308
|
}), /*#__PURE__*/React.createElement("g", {
|
|
300
309
|
transform: "translate(".concat(padding_width, ",").concat(padding_depth, ")")
|
|
301
310
|
}, txtContent)), element.category === 'cabinet' && /*#__PURE__*/React.createElement("g", {
|
|
302
|
-
visibility: (element
|
|
303
|
-
return cd.itemID == (element === null || element === void 0 ? void 0 : element.getIn(['itemID']));
|
|
304
|
-
}).length) > 0 ? 'hidden' : 'visible'
|
|
311
|
+
visibility: isWarningItem(element) ? 'visible' : 'hidden'
|
|
305
312
|
}, warning_buttons)));
|
|
306
313
|
} else {
|
|
307
314
|
rendered = /*#__PURE__*/React.createElement("g", {
|
|
@@ -447,7 +454,8 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
|
|
|
447
454
|
var tempDoorStyles = doorStyles.toJS();
|
|
448
455
|
var tempPlaceholders = structure.tempPlaceholders;
|
|
449
456
|
var tPlaceholders = tempPlaceholders.find(function (el) {
|
|
450
|
-
|
|
457
|
+
var _tempDoorStyles$cds$;
|
|
458
|
+
return el.id === (tempDoorStyles === null || tempDoorStyles === void 0 ? void 0 : tempDoorStyles.cabinet_door_style_id) || el.id === (tempDoorStyles === null || tempDoorStyles === void 0 || (_tempDoorStyles$cds$ = tempDoorStyles.cds[0]) === null || _tempDoorStyles$cds$ === void 0 ? void 0 : _tempDoorStyles$cds$.cabinet_door_style_id);
|
|
451
459
|
});
|
|
452
460
|
if (tPlaceholders !== undefined) {
|
|
453
461
|
placeholders = tPlaceholders.placeholders;
|
|
@@ -638,10 +646,10 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
|
|
|
638
646
|
vLine3.material.depthTest = false;
|
|
639
647
|
// translate vector to center of object
|
|
640
648
|
var uVec = new Three.Vector3(-posVec.x / scalevec.x, -posVec.y / scalevec.y, -posVec.z / scalevec.z);
|
|
641
|
-
vLine.translateY(0.1);
|
|
642
|
-
vLine1.translateY(0.1);
|
|
643
|
-
vLine2.translateY(0.1);
|
|
644
|
-
vLine3.translateY(0.1);
|
|
649
|
+
vLine.translateY(_boundingBox.min.y + 0.1);
|
|
650
|
+
vLine1.translateY(_boundingBox.min.y + 0.1);
|
|
651
|
+
vLine2.translateY(_boundingBox.min.y + 0.1);
|
|
652
|
+
vLine3.translateY(_boundingBox.min.y + 0.1);
|
|
645
653
|
|
|
646
654
|
//rotObj.translateOnAxis(uVec, 1);
|
|
647
655
|
upObj.translateOnAxis(uVec, 1);
|
|
@@ -993,6 +1001,8 @@ export function render3DItem(element, layer, scene, sizeinfo, structure_json, is
|
|
|
993
1001
|
try {
|
|
994
1002
|
counterTop = counterTop.toJS();
|
|
995
1003
|
} catch (error) {
|
|
1004
|
+
//@todo THIS IS A TEMPORARY FIX FOR COUNTERTOP TEXTURE UNDEFINED ISSUE
|
|
1005
|
+
counterTop.uri = 'https://media.test.diydesignspace.com/uploads/CountTop/202105074107_5/texture/Unique_Calcatta_texture.jpg';
|
|
996
1006
|
console.log(error);
|
|
997
1007
|
}
|
|
998
1008
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author angelxuanchang
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import * as THREE from 'three';
|
|
8
8
|
var MTLLoader;
|
|
9
9
|
MTLLoader = function MTLLoader(manager) {
|
|
10
10
|
this.manager = manager !== undefined ? manager : THREE.DefaultLoadingManager;
|
|
@@ -354,4 +354,4 @@ MTLLoader.MaterialCreator.prototype = {
|
|
|
354
354
|
return texture;
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
|
|
357
|
+
export default MTLLoader;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author mrdoob / http://mrdoob.com/
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import * as THREE from 'three';
|
|
5
5
|
var OBJLoader;
|
|
6
6
|
OBJLoader = function () {
|
|
7
7
|
// o object_name | g group_name
|
|
@@ -473,4 +473,4 @@ OBJLoader = function () {
|
|
|
473
473
|
};
|
|
474
474
|
return OBJLoader;
|
|
475
475
|
}();
|
|
476
|
-
|
|
476
|
+
export default OBJLoader;
|
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 {
|