kitchen-simulator 1.1.1-test.47 → 1.1.1-test.49
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/lib/KitchenConfiguratorApp.js +3 -0
- package/package.json +15 -16
- package/es/@history.js +0 -2
- package/es/AppContext.js +0 -3
- package/es/KitchenConfigurator.js +0 -645
- package/es/KitchenConfiguratorApp.js +0 -478
- package/es/actions/area-actions.js +0 -14
- package/es/actions/export.js +0 -23
- package/es/actions/groups-actions.js +0 -89
- package/es/actions/holes-actions.js +0 -119
- package/es/actions/items-actions.js +0 -313
- package/es/actions/lines-actions.js +0 -81
- package/es/actions/project-actions.js +0 -281
- package/es/actions/scene-actions.js +0 -33
- package/es/actions/vertices-actions.js +0 -27
- package/es/actions/viewer2d-actions.js +0 -58
- package/es/actions/viewer3d-actions.js +0 -23
- package/es/catalog/areas/area/planner-element.js +0 -40
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/catalog.js +0 -277
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/factories/area-factory-3d.js +0 -181
- package/es/catalog/factories/area-factory.js +0 -81
- package/es/catalog/factories/export.js +0 -7
- package/es/catalog/factories/wall-factory-3d.js +0 -202
- package/es/catalog/factories/wall-factory.js +0 -268
- package/es/catalog/holes/door-closet/planner-element.js +0 -222
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +0 -315
- package/es/catalog/holes/door-exterior/planner-element.js +0 -215
- package/es/catalog/holes/door-interior/planner-element.js +0 -227
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +0 -503
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
- package/es/catalog/holes/door-sliding/planner-element.js +0 -225
- package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
- package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
- package/es/catalog/holes/export.js +0 -13
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +0 -166
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +0 -165
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +0 -276
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +0 -70
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +0 -28
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +0 -28
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +0 -28
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -116
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -97
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -101
- package/es/catalog/properties/property-length-measure.js +0 -134
- package/es/catalog/properties/property-length-measure_hole.js +0 -101
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -82
- package/es/catalog/utils/exporter.js +0 -148
- package/es/catalog/utils/geom-utils.js +0 -189
- package/es/catalog/utils/item-loader.js +0 -1521
- package/es/catalog/utils/load-obj.js +0 -91
- package/es/catalog/utils/mtl-loader.js +0 -358
- package/es/catalog/utils/obj-loader.js +0 -477
- package/es/class/FuseUtils.js +0 -82
- package/es/class/area.js +0 -145
- package/es/class/export.js +0 -24
- package/es/class/group.js +0 -440
- package/es/class/guide.js +0 -62
- package/es/class/hole.js +0 -929
- package/es/class/item.js +0 -1883
- package/es/class/layer.js +0 -667
- package/es/class/line.js +0 -1180
- package/es/class/project.js +0 -793
- package/es/class/vertex.js +0 -202
- package/es/components/content.js +0 -107
- package/es/components/disclaimer/disclaimer.js +0 -97
- package/es/components/export.js +0 -9
- package/es/components/style/button.js +0 -113
- package/es/components/style/cancel-button.js +0 -22
- package/es/components/style/content-container.js +0 -33
- package/es/components/style/content-title.js +0 -29
- package/es/components/style/delete-button.js +0 -25
- package/es/components/style/export.js +0 -31
- package/es/components/style/form-block.js +0 -24
- package/es/components/style/form-color-input.js +0 -27
- package/es/components/style/form-label.js +0 -26
- package/es/components/style/form-number-input.js +0 -213
- package/es/components/style/form-number-input_2.js +0 -206
- package/es/components/style/form-select.js +0 -68
- package/es/components/style/form-slider.js +0 -61
- package/es/components/style/form-submit-button.js +0 -26
- package/es/components/style/form-text-input.js +0 -95
- package/es/components/viewer2d/area.js +0 -81
- package/es/components/viewer2d/export.js +0 -31
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-streak.js +0 -37
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -37
- package/es/components/viewer2d/grids/grids.js +0 -35
- package/es/components/viewer2d/group.js +0 -53
- package/es/components/viewer2d/item.js +0 -513
- package/es/components/viewer2d/layer.js +0 -164
- package/es/components/viewer2d/line.js +0 -882
- package/es/components/viewer2d/ruler.js +0 -100
- package/es/components/viewer2d/rulerDist.js +0 -146
- package/es/components/viewer2d/rulerX.js +0 -151
- package/es/components/viewer2d/rulerY.js +0 -153
- package/es/components/viewer2d/scene.js +0 -140
- package/es/components/viewer2d/snap.js +0 -74
- package/es/components/viewer2d/state.js +0 -78
- package/es/components/viewer2d/utils.js +0 -198
- package/es/components/viewer2d/vertex.js +0 -65
- package/es/components/viewer2d/viewer2d.js +0 -1398
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2592
- package/es/components/viewer3d/dcm.js +0 -401
- package/es/components/viewer3d/fbm.js +0 -414
- package/es/components/viewer3d/front3D.js +0 -66
- package/es/components/viewer3d/grid-creator.js +0 -25
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer3d/grids/grid-streak.js +0 -27
- package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer3d/libs/first-person-controls.js +0 -67
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
- package/es/components/viewer3d/libs/mtl-loader.js +0 -357
- package/es/components/viewer3d/libs/obj-loader.js +0 -462
- package/es/components/viewer3d/libs/orbit-controls.js +0 -699
- package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -46
- package/es/components/viewer3d/lrm.js +0 -305
- package/es/components/viewer3d/model.js +0 -708
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
- package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
- package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
- package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -227
- package/es/components/viewer3d/ruler-utils/scene3D.js +0 -60
- package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
- package/es/components/viewer3d/scene-creator.js +0 -3608
- package/es/components/viewer3d/three-memory-cleaner.js +0 -51
- package/es/components/viewer3d/viewer3d-first-person.js +0 -315
- package/es/components/viewer3d/viewer3d.js +0 -2527
- package/es/constants.js +0 -636
- package/es/index.js +0 -16
- package/es/models.js +0 -510
- package/es/plugins/SVGLoader.js +0 -1412
- package/es/plugins/autosave.js +0 -33
- package/es/plugins/console-debugger.js +0 -37
- package/es/plugins/export.js +0 -9
- package/es/plugins/keyboard.js +0 -101
- package/es/reducers/areas-reducer.js +0 -12
- package/es/reducers/export.js +0 -25
- package/es/reducers/groups-reducer.js +0 -38
- package/es/reducers/holes-reducer.js +0 -62
- package/es/reducers/items-reducer.js +0 -140
- package/es/reducers/lines-reducer.js +0 -45
- package/es/reducers/project-reducer.js +0 -129
- package/es/reducers/reducer.js +0 -19
- package/es/reducers/scene-reducer.js +0 -28
- package/es/reducers/user-reducer.js +0 -40
- package/es/reducers/vertices-reducer.js +0 -19
- package/es/reducers/viewer2d-reducer.js +0 -75
- package/es/reducers/viewer3d-reducer.js +0 -56
- package/es/shared-style.js +0 -66
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/es/translator/en.js +0 -104
- package/es/translator/it.js +0 -79
- package/es/translator/ru.js +0 -79
- package/es/translator/translator.js +0 -84
- package/es/utils/browser.js +0 -33
- package/es/utils/email-validator.js +0 -4
- package/es/utils/export.js +0 -25
- package/es/utils/geometry.js +0 -2420
- package/es/utils/get-edges-of-subgraphs.js +0 -27
- package/es/utils/graph-cycles.js +0 -237
- package/es/utils/graph-inner-cycles.js +0 -46
- package/es/utils/graph.js +0 -150
- package/es/utils/helper.js +0 -268
- package/es/utils/history.js +0 -29
- package/es/utils/id-broker.js +0 -19
- package/es/utils/logger.js +0 -8
- package/es/utils/math.js +0 -50
- package/es/utils/molding.js +0 -871
- package/es/utils/name-generator.js +0 -18
- package/es/utils/objects-utils.js +0 -50
- package/es/utils/phone-validator.js +0 -4
- package/es/utils/process-black-list.js +0 -18
- package/es/utils/react-if.js +0 -18
- package/es/utils/snap-scene.js +0 -99
- package/es/utils/snap.js +0 -237
- package/es/utils/summarizeCart.js +0 -24
- package/es/utils/threeCSG.es6.js +0 -498
- package/es/version.js +0 -2
- package/lib/catalog/properties/property-string.js +0 -55
- package/lib/catalog/properties/property-toggle.js +0 -46
- package/lib/catalog/properties/shared-property-style.js +0 -20
- package/lib/catalog/utils/FuseUtils.js +0 -88
- package/lib/catalog/utils/exporter.js +0 -155
- package/lib/catalog/utils/geom-utils.js +0 -205
- package/lib/catalog/utils/item-loader.js +0 -1533
- package/lib/catalog/utils/load-obj.js +0 -99
- package/lib/catalog/utils/mtl-loader.js +0 -363
- package/lib/catalog/utils/obj-loader.js +0 -482
- package/lib/class/FuseUtils.js +0 -88
- package/lib/class/area.js +0 -150
- package/lib/class/export.js +0 -96
- package/lib/class/group.js +0 -445
- package/lib/class/guide.js +0 -67
- package/lib/class/hole.js +0 -934
- package/lib/class/item.js +0 -1889
- package/lib/class/layer.js +0 -672
- package/lib/class/line.js +0 -1186
- package/lib/class/project.js +0 -799
- package/lib/class/vertex.js +0 -207
- package/lib/components/content.js +0 -116
- package/lib/components/disclaimer/disclaimer.js +0 -105
- package/lib/components/export.js +0 -33
- package/lib/components/style/button.js +0 -120
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -40
- package/lib/components/style/content-title.js +0 -37
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/export.js +0 -121
- package/lib/components/style/form-block.js +0 -31
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -33
- package/lib/components/style/form-number-input.js +0 -220
- package/lib/components/style/form-number-input_2.js +0 -213
- package/lib/components/style/form-select.js +0 -75
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-submit-button.js +0 -35
- package/lib/components/style/form-text-input.js +0 -101
- package/lib/components/viewer2d/area.js +0 -88
- package/lib/components/viewer2d/export.js +0 -121
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer2d/grids/grids.js +0 -44
- package/lib/components/viewer2d/group.js +0 -62
- package/lib/components/viewer2d/item.js +0 -521
- package/lib/components/viewer2d/layer.js +0 -171
- package/lib/components/viewer2d/line.js +0 -892
- package/lib/components/viewer2d/ruler.js +0 -107
- package/lib/components/viewer2d/rulerDist.js +0 -153
- package/lib/components/viewer2d/rulerX.js +0 -158
- package/lib/components/viewer2d/rulerY.js +0 -160
- package/lib/components/viewer2d/scene.js +0 -147
- package/lib/components/viewer2d/snap.js +0 -83
- package/lib/components/viewer2d/state.js +0 -87
- package/lib/components/viewer2d/utils.js +0 -210
- package/lib/components/viewer2d/vertex.js +0 -74
- package/lib/components/viewer2d/viewer2d.js +0 -1405
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2597
- package/lib/components/viewer3d/dcm.js +0 -407
- package/lib/components/viewer3d/fbm.js +0 -420
- package/lib/components/viewer3d/front3D.js +0 -75
- package/lib/components/viewer3d/grid-creator.js +0 -34
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer3d/grids/grid-streak.js +0 -35
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -363
- package/lib/components/viewer3d/libs/obj-loader.js +0 -468
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -705
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -52
- package/lib/components/viewer3d/lrm.js +0 -311
- package/lib/components/viewer3d/model.js +0 -714
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -68
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -502
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -234
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -68
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -25
- package/lib/components/viewer3d/scene-creator.js +0 -3642
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -320
- package/lib/components/viewer3d/viewer3d.js +0 -2532
- package/lib/constants.js +0 -645
- package/lib/index.js +0 -96
- package/lib/models.js +0 -517
- package/lib/plugins/SVGLoader.js +0 -1417
- package/lib/plugins/autosave.js +0 -39
- package/lib/plugins/console-debugger.js +0 -44
- package/lib/plugins/export.js +0 -33
- package/lib/plugins/keyboard.js +0 -107
- package/lib/reducers/areas-reducer.js +0 -18
- package/lib/reducers/export.js +0 -97
- package/lib/reducers/groups-reducer.js +0 -44
- package/lib/reducers/holes-reducer.js +0 -68
- package/lib/reducers/items-reducer.js +0 -146
- package/lib/reducers/lines-reducer.js +0 -51
- package/lib/reducers/project-reducer.js +0 -135
- package/lib/reducers/reducer.js +0 -26
- package/lib/reducers/scene-reducer.js +0 -34
- package/lib/reducers/user-reducer.js +0 -46
- package/lib/reducers/vertices-reducer.js +0 -25
- package/lib/reducers/viewer2d-reducer.js +0 -82
- package/lib/reducers/viewer3d-reducer.js +0 -63
- package/lib/shared-style.js +0 -72
- package/lib/styles/export.js +0 -13
- package/lib/translator/en.js +0 -110
- package/lib/translator/it.js +0 -85
- package/lib/translator/ru.js +0 -85
- package/lib/translator/translator.js +0 -90
- package/lib/utils/browser.js +0 -40
- package/lib/utils/email-validator.js +0 -10
- package/lib/utils/export.js +0 -56
- package/lib/utils/geometry.js +0 -2516
- package/lib/utils/get-edges-of-subgraphs.js +0 -34
- package/lib/utils/graph-cycles.js +0 -240
- package/lib/utils/graph-inner-cycles.js +0 -54
- package/lib/utils/graph.js +0 -157
- package/lib/utils/helper.js +0 -291
- package/lib/utils/history.js +0 -36
- package/lib/utils/id-broker.js +0 -26
- package/lib/utils/logger.js +0 -14
- package/lib/utils/math.js +0 -57
- package/lib/utils/molding.js +0 -895
- package/lib/utils/name-generator.js +0 -23
- package/lib/utils/objects-utils.js +0 -60
- package/lib/utils/phone-validator.js +0 -10
- package/lib/utils/process-black-list.js +0 -24
- package/lib/utils/react-if.js +0 -24
- package/lib/utils/snap-scene.js +0 -105
- package/lib/utils/snap.js +0 -249
- package/lib/utils/summarizeCart.js +0 -30
- package/lib/utils/threeCSG.es6.js +0 -503
- package/lib/version.js +0 -8
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as Three from 'three';
|
|
3
|
-
var black = new Three.MeshLambertMaterial({
|
|
4
|
-
color: 0x000000
|
|
5
|
-
});
|
|
6
|
-
var metalBlue = new Three.MeshLambertMaterial({
|
|
7
|
-
color: 0xb7ceec
|
|
8
|
-
});
|
|
9
|
-
var grey = new Three.MeshLambertMaterial({
|
|
10
|
-
color: 0xd2b06a
|
|
11
|
-
});
|
|
12
|
-
var darkGrey = new Three.MeshLambertMaterial({
|
|
13
|
-
color: 0xffefce
|
|
14
|
-
});
|
|
15
|
-
var boxMaterials = [grey, grey, grey, grey, darkGrey, darkGrey];
|
|
16
|
-
function makeDoor(width, height, thickness) {
|
|
17
|
-
var door_double = new Three.Mesh();
|
|
18
|
-
var LongDoorGeometry = new Three.BoxGeometry(0.75 * width, height, thickness);
|
|
19
|
-
var longDoor = new Three.Mesh(LongDoorGeometry, boxMaterials);
|
|
20
|
-
longDoor.position.x -= width * 0.25;
|
|
21
|
-
door_double.add(longDoor);
|
|
22
|
-
var ShortDoorGeometry = new Three.BoxGeometry(0.25 * width, height, thickness);
|
|
23
|
-
var shortDoor = new Three.Mesh(ShortDoorGeometry, boxMaterials);
|
|
24
|
-
shortDoor.position.x += width * 0.25;
|
|
25
|
-
shortDoor.position.z += thickness / 10;
|
|
26
|
-
door_double.add(shortDoor);
|
|
27
|
-
var handle = makeHandle(width);
|
|
28
|
-
handle.position.set(width / 20, height / 40, thickness / 2 + thickness / 10);
|
|
29
|
-
handle.rotation.z += Math.PI;
|
|
30
|
-
handle.rotation.x += Math.PI / 2;
|
|
31
|
-
door_double.add(handle);
|
|
32
|
-
var handleBase = makeHandleBase();
|
|
33
|
-
handleBase.position.set(width / 20, 0, thickness / 2);
|
|
34
|
-
handleBase.rotation.x = 0;
|
|
35
|
-
door_double.add(handleBase);
|
|
36
|
-
var handle2 = makeHandle(width);
|
|
37
|
-
handle2.position.set(width / 20, height / 40, -thickness / 2 - thickness / 10);
|
|
38
|
-
handle2.rotation.z += Math.PI;
|
|
39
|
-
handle2.rotation.x -= Math.PI / 2;
|
|
40
|
-
door_double.add(handle2);
|
|
41
|
-
var handleBase2 = makeHandleBase();
|
|
42
|
-
handleBase2.position.set(width / 20, 0, -thickness / 2);
|
|
43
|
-
handleBase2.rotation.x = 0;
|
|
44
|
-
door_double.add(handleBase2);
|
|
45
|
-
return door_double;
|
|
46
|
-
}
|
|
47
|
-
function makeHandle(width) {
|
|
48
|
-
var handle = new Three.Object3D();
|
|
49
|
-
var geometry_p1 = new Three.CylinderGeometry(width / 100, width / 100, width / 32.5, Math.round(32));
|
|
50
|
-
var geometry_p2 = new Three.SphereGeometry(width / 100, Math.round(32), Math.round(32));
|
|
51
|
-
var geometry_p3 = new Three.CylinderGeometry(width / 100, width / 100, width / 14.5, Math.round(32));
|
|
52
|
-
var p1 = new Three.Mesh(geometry_p1, black);
|
|
53
|
-
var p2 = new Three.Mesh(geometry_p2, black);
|
|
54
|
-
var p3 = new Three.Mesh(geometry_p3, black);
|
|
55
|
-
var p4 = new Three.Mesh(geometry_p2, black);
|
|
56
|
-
p3.rotation.z = Math.PI / 2;
|
|
57
|
-
p3.position.x = width / 14.5 / 2;
|
|
58
|
-
p2.position.y = -width / 32.5 / 2;
|
|
59
|
-
p4.position.y = -width / 14.5 / 2;
|
|
60
|
-
p3.add(p4);
|
|
61
|
-
p2.add(p3);
|
|
62
|
-
p1.add(p2);
|
|
63
|
-
handle.add(p1);
|
|
64
|
-
return handle;
|
|
65
|
-
}
|
|
66
|
-
function makeHandleBase() {
|
|
67
|
-
var handleBase = new Three.Object3D();
|
|
68
|
-
var geometryBase1 = new Three.BoxGeometry(7.6, 28, 2);
|
|
69
|
-
var geometryBase2 = new Three.CylinderGeometry(3.6, 3.6, 2, Math.round(32));
|
|
70
|
-
var lock = makeLock();
|
|
71
|
-
var handleBase1 = new Three.Mesh(geometryBase1, black);
|
|
72
|
-
var handleBase2 = new Three.Mesh(geometryBase2, black);
|
|
73
|
-
lock.rotation.x = Math.PI / 2;
|
|
74
|
-
lock.position.y = -3;
|
|
75
|
-
handleBase2.rotation.x = Math.PI / 2;
|
|
76
|
-
handleBase2.position.y = -3.3;
|
|
77
|
-
handleBase2.scale.z = 1.5;
|
|
78
|
-
handleBase1.add(lock);
|
|
79
|
-
handleBase1.add(handleBase2);
|
|
80
|
-
handleBase.add(handleBase1);
|
|
81
|
-
return handleBase;
|
|
82
|
-
}
|
|
83
|
-
function makeLock() {
|
|
84
|
-
var lock = new Three.Object3D();
|
|
85
|
-
var LockGeometry1 = new Three.CylinderGeometry(1.5, 1.5, 4, Math.round(32));
|
|
86
|
-
var lockGeometry2 = new Three.BoxGeometry(1.6, 4, 4);
|
|
87
|
-
var lockGeometry3 = new Three.BoxGeometry(1.4, 4.06, 0.36);
|
|
88
|
-
var lock_p1 = new Three.Mesh(LockGeometry1, metalBlue);
|
|
89
|
-
var lock_p2 = new Three.Mesh(lockGeometry2, metalBlue);
|
|
90
|
-
var lock_p3 = new Three.Mesh(lockGeometry3, grey);
|
|
91
|
-
lock_p2.position.z = 1;
|
|
92
|
-
lock_p1.add(lock_p2);
|
|
93
|
-
lock_p1.add(lock_p3);
|
|
94
|
-
lock.add(lock_p1);
|
|
95
|
-
return lock;
|
|
96
|
-
}
|
|
97
|
-
export default {
|
|
98
|
-
name: 'Double Door',
|
|
99
|
-
prototype: 'holes',
|
|
100
|
-
info: {
|
|
101
|
-
tag: ['door'],
|
|
102
|
-
title: 'Double Door',
|
|
103
|
-
description: 'iron door',
|
|
104
|
-
image: '/assets/img/svg/doors_patio.svg'
|
|
105
|
-
},
|
|
106
|
-
properties: {
|
|
107
|
-
width: {
|
|
108
|
-
label: 'width',
|
|
109
|
-
type: 'length-measure',
|
|
110
|
-
defaultValue: {
|
|
111
|
-
length: 200,
|
|
112
|
-
unit: 'cm'
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
height: {
|
|
116
|
-
label: 'height',
|
|
117
|
-
type: 'length-measure',
|
|
118
|
-
defaultValue: {
|
|
119
|
-
length: 215,
|
|
120
|
-
unit: 'cm'
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
thickness: {
|
|
124
|
-
label: 'thickness',
|
|
125
|
-
type: 'length-measure',
|
|
126
|
-
defaultValue: {
|
|
127
|
-
length: 6,
|
|
128
|
-
unit: 'cm'
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
altitude: {
|
|
132
|
-
label: 'altitude',
|
|
133
|
-
type: 'length-measure',
|
|
134
|
-
defaultValue: {
|
|
135
|
-
length: 0,
|
|
136
|
-
unit: 'cm'
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
flip_horizontal: {
|
|
140
|
-
label: 'flip',
|
|
141
|
-
type: 'checkbox',
|
|
142
|
-
defaultValue: false,
|
|
143
|
-
values: {
|
|
144
|
-
none: false,
|
|
145
|
-
yes: true
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
render2D: function render2D(element, layer, scene) {
|
|
150
|
-
var STYLE_HOLE_BASE = {
|
|
151
|
-
stroke: 'rgb(73, 73, 73)',
|
|
152
|
-
strokeDasharray: '9,5',
|
|
153
|
-
strokeWidth: '1px',
|
|
154
|
-
fill: 'rgb(73, 73, 73)'
|
|
155
|
-
};
|
|
156
|
-
var STYLE_HOLE_SELECTED = {
|
|
157
|
-
stroke: '#0096fd',
|
|
158
|
-
strokeWidth: '1px',
|
|
159
|
-
strokeDasharray: '9,5',
|
|
160
|
-
fill: '#0096fd',
|
|
161
|
-
cursor: 'move'
|
|
162
|
-
};
|
|
163
|
-
var STYLE_ARC_BASE = {
|
|
164
|
-
stroke: 'rgb(73, 73, 73)',
|
|
165
|
-
strokeWidth: '1px',
|
|
166
|
-
strokeDasharray: '9,5',
|
|
167
|
-
fill: 'none'
|
|
168
|
-
};
|
|
169
|
-
var STYLE_ARC_SELECTED = {
|
|
170
|
-
stroke: '#0096fd',
|
|
171
|
-
strokeWidth: '1px',
|
|
172
|
-
strokeDasharray: '9,5',
|
|
173
|
-
fill: 'none',
|
|
174
|
-
cursor: 'move'
|
|
175
|
-
};
|
|
176
|
-
var STYLE_STR0 = {
|
|
177
|
-
fill: 'rgb(185, 185, 185)',
|
|
178
|
-
stroke: '#494949',
|
|
179
|
-
strokeWidth: '1',
|
|
180
|
-
strokeMiterlimit: '2.61313'
|
|
181
|
-
};
|
|
182
|
-
var STYLE_STR0_S = {
|
|
183
|
-
fill: 'rgb(185, 185, 185)',
|
|
184
|
-
stroke: '#0096fd',
|
|
185
|
-
strokeWidth: '1',
|
|
186
|
-
strokeMiterlimit: '2.61313'
|
|
187
|
-
};
|
|
188
|
-
var STYLE_STR1 = {
|
|
189
|
-
fill: 'none',
|
|
190
|
-
stroke: '#494949',
|
|
191
|
-
strokeWidth: '1',
|
|
192
|
-
strokeLinecap: 'round',
|
|
193
|
-
strokeLinejoin: 'round',
|
|
194
|
-
strokeMiterlimit: '2.61313',
|
|
195
|
-
strokeDasharray: '23.860041 11.930021'
|
|
196
|
-
};
|
|
197
|
-
var STYLE_FILL2 = {
|
|
198
|
-
fill: '#1183B7'
|
|
199
|
-
};
|
|
200
|
-
var STYLE_FNT0 = {
|
|
201
|
-
fill: 'white',
|
|
202
|
-
fontWeight: 'normal',
|
|
203
|
-
fontSize: '13px',
|
|
204
|
-
fontFamily: 'Proxima Nova Rg'
|
|
205
|
-
};
|
|
206
|
-
var lineWidth = 15;
|
|
207
|
-
var epsilon = 3;
|
|
208
|
-
var flip = element.properties.get('flip_horizontal');
|
|
209
|
-
var holeWidth = element.properties.get('width').get('length');
|
|
210
|
-
var holePath = "M".concat(0, " ", -epsilon, " L").concat(holeWidth, " ").concat(-epsilon, " L").concat(holeWidth, " ").concat(epsilon, " L", 0, " ").concat(epsilon, " z");
|
|
211
|
-
var arcPath = "M".concat(0, ",", 0, " A", holeWidth / 4, ",").concat(holeWidth / 4, " 0 0,1 ").concat(holeWidth / 4, ",").concat(holeWidth / 4);
|
|
212
|
-
var arcPath2 = "M".concat(0, ",", 0, " A", holeWidth / 2 + holeWidth / 4, ",").concat(holeWidth / 2 + holeWidth / 4, " 0 0,0 ").concat(holeWidth / 2 + holeWidth / 4, ",").concat(holeWidth / 2 + holeWidth / 4);
|
|
213
|
-
var holeStyle = element.selected ? STYLE_HOLE_SELECTED : STYLE_HOLE_BASE;
|
|
214
|
-
var arcStyle = element.selected ? STYLE_ARC_SELECTED : STYLE_ARC_BASE;
|
|
215
|
-
var rectStyle = element.selected ? STYLE_STR0_S : STYLE_STR0;
|
|
216
|
-
var length = element.properties.get('width').get('length');
|
|
217
|
-
if (flip) {
|
|
218
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
219
|
-
transform: "translate(".concat(-element.properties.get('width').get('length') / 2, ", 0)")
|
|
220
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
221
|
-
key: "1",
|
|
222
|
-
d: arcPath,
|
|
223
|
-
style: arcStyle,
|
|
224
|
-
transform: "translate(".concat(0, ",", -holeWidth / 4, ")")
|
|
225
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
226
|
-
key: "2",
|
|
227
|
-
x1: 0,
|
|
228
|
-
y1: 0 - epsilon,
|
|
229
|
-
x2: 0,
|
|
230
|
-
y2: -holeWidth / 4 - epsilon,
|
|
231
|
-
style: holeStyle
|
|
232
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
233
|
-
key: "3",
|
|
234
|
-
d: arcPath2,
|
|
235
|
-
style: arcStyle,
|
|
236
|
-
transform: "translate(".concat(holeWidth, ",").concat(-holeWidth / 2 - holeWidth / 4, ") rotate(90)")
|
|
237
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
238
|
-
key: "4",
|
|
239
|
-
x1: holeWidth,
|
|
240
|
-
y1: 0 - epsilon,
|
|
241
|
-
x2: holeWidth,
|
|
242
|
-
y2: -holeWidth / 2 - holeWidth / 4 - epsilon,
|
|
243
|
-
style: holeStyle
|
|
244
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
245
|
-
style: rectStyle,
|
|
246
|
-
x: "0",
|
|
247
|
-
y: -lineWidth / 2,
|
|
248
|
-
width: holeWidth,
|
|
249
|
-
height: lineWidth
|
|
250
|
-
}));
|
|
251
|
-
} else {
|
|
252
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
253
|
-
transform: "translate(".concat(-element.properties.get('width').get('length') / 2, ", 0)")
|
|
254
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
255
|
-
key: "1",
|
|
256
|
-
d: arcPath,
|
|
257
|
-
style: arcStyle,
|
|
258
|
-
transform: "translate(".concat(holeWidth, ",").concat(holeWidth / 4, ") rotate(180)")
|
|
259
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
260
|
-
key: "2",
|
|
261
|
-
x1: 0,
|
|
262
|
-
y1: 0 - epsilon,
|
|
263
|
-
x2: 0,
|
|
264
|
-
y2: holeWidth / 2 + holeWidth / 4 - epsilon,
|
|
265
|
-
style: holeStyle
|
|
266
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
267
|
-
key: "3",
|
|
268
|
-
d: arcPath2,
|
|
269
|
-
style: arcStyle,
|
|
270
|
-
transform: "translate(".concat(0, ",", holeWidth / 2 + holeWidth / 4, ") rotate(270)")
|
|
271
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
272
|
-
key: "4",
|
|
273
|
-
x1: holeWidth,
|
|
274
|
-
y1: 0 - epsilon,
|
|
275
|
-
x2: holeWidth,
|
|
276
|
-
y2: holeWidth / 4 - epsilon,
|
|
277
|
-
style: holeStyle
|
|
278
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
279
|
-
style: rectStyle,
|
|
280
|
-
x: "0",
|
|
281
|
-
y: -lineWidth / 2,
|
|
282
|
-
width: holeWidth,
|
|
283
|
-
height: lineWidth
|
|
284
|
-
}));
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
render3D: function render3D(element, layer, scene) {
|
|
288
|
-
var flip = element.properties.get('flip_horizontal');
|
|
289
|
-
var width = element.properties.get('width').get('length');
|
|
290
|
-
var height = element.properties.get('height').get('length');
|
|
291
|
-
var thickness = element.properties.get('thickness').get('length');
|
|
292
|
-
var newAltitude = element.properties.get('altitude').get('length');
|
|
293
|
-
var door_double = new Three.Object3D();
|
|
294
|
-
door_double.add(makeDoor(width, height, thickness).clone(width, height, thickness));
|
|
295
|
-
var valuePosition = new Three.Box3().setFromObject(door_double);
|
|
296
|
-
var deltaX = Math.abs(valuePosition.max.x - valuePosition.min.x);
|
|
297
|
-
var deltaY = Math.abs(valuePosition.max.y - valuePosition.min.y);
|
|
298
|
-
var deltaZ = Math.abs(valuePosition.max.z - valuePosition.min.z);
|
|
299
|
-
if (element.selected) {
|
|
300
|
-
var bbox = new Three.BoxHelper(door_double, 0x99c3fb);
|
|
301
|
-
bbox.material.linewidth = 5;
|
|
302
|
-
bbox.renderOrder = 1000;
|
|
303
|
-
bbox.material.depthTest = false;
|
|
304
|
-
door_double.add(bbox);
|
|
305
|
-
}
|
|
306
|
-
if (flip) {
|
|
307
|
-
door_double.rotation.y += Math.PI;
|
|
308
|
-
door_double.position.x -= width / 4;
|
|
309
|
-
}
|
|
310
|
-
door_double.position.y += newAltitude;
|
|
311
|
-
door_double.position.x += width / 8;
|
|
312
|
-
door_double.scale.set(width / deltaX, height / deltaY, thickness / deltaZ);
|
|
313
|
-
return Promise.resolve(door_double);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as Three from 'three';
|
|
3
|
-
import { loadGLTF } from "../../utils/load-obj";
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { OBJTYPE_MESH } from "../../../constants";
|
|
6
|
-
var cached3DDoor = null;
|
|
7
|
-
var STYLE_HOLE_BASE = {
|
|
8
|
-
stroke: 'rgb(73, 73, 73)',
|
|
9
|
-
strokeWidth: '1px',
|
|
10
|
-
strokeDasharray: '9,5',
|
|
11
|
-
fill: 'rgb(73, 73, 73)'
|
|
12
|
-
};
|
|
13
|
-
var STYLE_HOLE_SELECTED = {
|
|
14
|
-
stroke: '#0096fd',
|
|
15
|
-
strokeWidth: '1px',
|
|
16
|
-
strokeDasharray: '9,5',
|
|
17
|
-
fill: '#0096fd',
|
|
18
|
-
cursor: 'move'
|
|
19
|
-
};
|
|
20
|
-
var STYLE_ARC_BASE = {
|
|
21
|
-
stroke: 'rgb(73, 73, 73)',
|
|
22
|
-
strokeWidth: '1px',
|
|
23
|
-
strokeDasharray: '9,5',
|
|
24
|
-
fill: 'none'
|
|
25
|
-
};
|
|
26
|
-
var STYLE_ARC_SELECTED = {
|
|
27
|
-
stroke: '#0096fd',
|
|
28
|
-
strokeWidth: '1px',
|
|
29
|
-
strokeDasharray: '9,5',
|
|
30
|
-
fill: 'none',
|
|
31
|
-
cursor: 'move'
|
|
32
|
-
};
|
|
33
|
-
var STYLE_STR0 = {
|
|
34
|
-
fill: 'rgb(185, 185, 185)',
|
|
35
|
-
stroke: '#494949',
|
|
36
|
-
strokeWidth: '1',
|
|
37
|
-
strokeMiterlimit: '2.61313'
|
|
38
|
-
};
|
|
39
|
-
var STYLE_STR0_S = {
|
|
40
|
-
fill: 'rgb(185, 185, 185)',
|
|
41
|
-
stroke: '#0096fd',
|
|
42
|
-
strokeWidth: '1',
|
|
43
|
-
strokeMiterlimit: '2.61313'
|
|
44
|
-
};
|
|
45
|
-
var STYLE_STR1 = {
|
|
46
|
-
fill: 'none',
|
|
47
|
-
stroke: '#494949',
|
|
48
|
-
strokeWidth: '1',
|
|
49
|
-
strokeLinecap: 'round',
|
|
50
|
-
strokeLinejoin: 'round',
|
|
51
|
-
strokeMiterlimit: '2.61313',
|
|
52
|
-
strokeDasharray: '23.860041 11.930021'
|
|
53
|
-
};
|
|
54
|
-
var STYLE_FILL2 = {
|
|
55
|
-
fill: '#1183B7'
|
|
56
|
-
};
|
|
57
|
-
var STYLE_FNT0 = {
|
|
58
|
-
fill: 'white',
|
|
59
|
-
fontWeight: 'normal',
|
|
60
|
-
fontSize: '13px',
|
|
61
|
-
fontFamily: 'Proxima Nova Rg'
|
|
62
|
-
};
|
|
63
|
-
var EPSILON = 3;
|
|
64
|
-
export default {
|
|
65
|
-
name: 'Exterior',
|
|
66
|
-
prototype: 'holes',
|
|
67
|
-
info: {
|
|
68
|
-
title: 'Exterior',
|
|
69
|
-
tag: ['door'],
|
|
70
|
-
description: 'Exterior door',
|
|
71
|
-
image: '/assets/img/svg/door/Exterior.svg',
|
|
72
|
-
url: '/assets/gltf/door_exterior.gltf'
|
|
73
|
-
},
|
|
74
|
-
properties: {
|
|
75
|
-
width: {
|
|
76
|
-
label: 'Width',
|
|
77
|
-
type: 'length-measure',
|
|
78
|
-
defaultValue: {
|
|
79
|
-
length: 91.44
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
height: {
|
|
83
|
-
label: 'Height',
|
|
84
|
-
type: 'length-measure',
|
|
85
|
-
defaultValue: {
|
|
86
|
-
length: 215
|
|
87
|
-
},
|
|
88
|
-
length: 215
|
|
89
|
-
},
|
|
90
|
-
altitude: {
|
|
91
|
-
label: 'Altitude',
|
|
92
|
-
type: 'length-measure',
|
|
93
|
-
defaultValue: {
|
|
94
|
-
length: 0
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
thickness: {
|
|
98
|
-
label: 'Thickness',
|
|
99
|
-
type: 'length-measure',
|
|
100
|
-
defaultValue: {
|
|
101
|
-
length: 6
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
flip_orizzontal: {
|
|
105
|
-
label: 'Flip Door',
|
|
106
|
-
type: 'checkbox',
|
|
107
|
-
defaultValue: false,
|
|
108
|
-
values: {
|
|
109
|
-
none: false,
|
|
110
|
-
yes: true
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
render2D: function render2D(element, layer, scene) {
|
|
115
|
-
var flip = element.properties.get('flip_orizzontal');
|
|
116
|
-
var lineWidth = 6;
|
|
117
|
-
var holeWidth = element.properties.get('width').get('length');
|
|
118
|
-
var holePath = "M".concat(0, " ", -EPSILON, " L").concat(holeWidth, " ").concat(-EPSILON, " L").concat(holeWidth, " ").concat(EPSILON, " L", 0, " ").concat(EPSILON, " z");
|
|
119
|
-
var arcPath = "M".concat(0, ",", 0, " A", holeWidth, ",").concat(holeWidth, " 0 0,1 ").concat(holeWidth, ",").concat(holeWidth);
|
|
120
|
-
var holeStyle = element.selected ? STYLE_HOLE_SELECTED : STYLE_HOLE_BASE;
|
|
121
|
-
var arcStyle = element.selected ? STYLE_ARC_SELECTED : STYLE_ARC_BASE;
|
|
122
|
-
var rectStyle = element.selected ? STYLE_STR0_S : STYLE_STR0;
|
|
123
|
-
var length = element.properties.get('width').get('length');
|
|
124
|
-
if (flip == false) {
|
|
125
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
126
|
-
transform: "translate(".concat(-length / 2, ", 0)")
|
|
127
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
128
|
-
d: arcPath,
|
|
129
|
-
style: arcStyle,
|
|
130
|
-
transform: "translate(".concat(0, ",", holeWidth, ") scale(", 1, ",").concat(-1, ") rotate(", 0, ")")
|
|
131
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
132
|
-
x1: 0,
|
|
133
|
-
y1: holeWidth - EPSILON,
|
|
134
|
-
x2: 0,
|
|
135
|
-
y2: 0 - EPSILON,
|
|
136
|
-
style: holeStyle,
|
|
137
|
-
transform: "scale(".concat(-1, ",", 1, ")")
|
|
138
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
139
|
-
style: rectStyle,
|
|
140
|
-
x: "0",
|
|
141
|
-
y: -lineWidth / 2,
|
|
142
|
-
width: holeWidth,
|
|
143
|
-
height: lineWidth
|
|
144
|
-
}));
|
|
145
|
-
} else {
|
|
146
|
-
return /*#__PURE__*/React.createElement("g", {
|
|
147
|
-
transform: "translate(".concat(-length / 2, ", 0)")
|
|
148
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
149
|
-
d: arcPath,
|
|
150
|
-
style: arcStyle,
|
|
151
|
-
transform: "translate(".concat(0, ",", -holeWidth, ") scale(", 1, ",", 1, ") rotate(", 0, ")")
|
|
152
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
153
|
-
x1: 0,
|
|
154
|
-
y1: -holeWidth - EPSILON,
|
|
155
|
-
x2: 0,
|
|
156
|
-
y2: 0 - EPSILON,
|
|
157
|
-
style: holeStyle,
|
|
158
|
-
transform: "scale(".concat(1, ",", 1, ")")
|
|
159
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
160
|
-
style: rectStyle,
|
|
161
|
-
x: "0",
|
|
162
|
-
y: -lineWidth / 2,
|
|
163
|
-
width: holeWidth,
|
|
164
|
-
height: lineWidth
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
render3D: function render3D(element, layer, scene) {
|
|
169
|
-
var onLoadItem = function onLoadItem(object) {
|
|
170
|
-
var boundingBox = new Three.Box3().setFromObject(object);
|
|
171
|
-
var initialWidth = boundingBox.max.x - boundingBox.min.x;
|
|
172
|
-
var initialHeight = boundingBox.max.y - boundingBox.min.y;
|
|
173
|
-
var initialThickness = boundingBox.max.z - boundingBox.min.z;
|
|
174
|
-
if (element.selected) {
|
|
175
|
-
var box = new Three.BoxHelper(object, 0x99c3fb);
|
|
176
|
-
box.material.linewidth = 2;
|
|
177
|
-
box.material.depthTest = false;
|
|
178
|
-
box.renderOrder = 1000;
|
|
179
|
-
object.add(box);
|
|
180
|
-
}
|
|
181
|
-
var params = {
|
|
182
|
-
envMap: 'HDR',
|
|
183
|
-
roughness: 0.9,
|
|
184
|
-
metalness: 0.1,
|
|
185
|
-
exposure: 1.0
|
|
186
|
-
};
|
|
187
|
-
var examplecolor = new Three.Color(0xffffff);
|
|
188
|
-
var mat2 = new Three.MeshStandardMaterial({
|
|
189
|
-
color: examplecolor,
|
|
190
|
-
metalness: params.metalness,
|
|
191
|
-
roughness: params.roughness
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// mat2.envMap = textureCube;
|
|
195
|
-
for (var j = 0; j < object.children.length; j++) {
|
|
196
|
-
if (object.children[j].type === OBJTYPE_MESH) {
|
|
197
|
-
object.children[j].material = mat2;
|
|
198
|
-
object.children[j].receiveShadow = true;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
var width = element.properties.get('width').get('length');
|
|
202
|
-
var height = element.properties.get('height').get('length');
|
|
203
|
-
var thickness = element.properties.get('thickness').get('length');
|
|
204
|
-
object.scale.set(width / initialWidth, height / initialHeight, thickness / initialThickness);
|
|
205
|
-
return object;
|
|
206
|
-
};
|
|
207
|
-
if (cached3DDoor) {
|
|
208
|
-
return Promise.resolve(onLoadItem(cached3DDoor.clone()));
|
|
209
|
-
}
|
|
210
|
-
return loadGLTF(element.url).then(function (object) {
|
|
211
|
-
cached3DDoor = object;
|
|
212
|
-
return onLoadItem(cached3DDoor.clone());
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
};
|