kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50
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/@history.js +2 -0
- package/es/AppContext.js +3 -0
- package/es/KitchenConfigurator.js +645 -0
- package/es/KitchenConfiguratorApp.js +480 -0
- package/es/actions/area-actions.js +14 -0
- package/es/actions/export.js +23 -0
- package/es/actions/groups-actions.js +89 -0
- package/es/actions/holes-actions.js +119 -0
- package/es/actions/items-actions.js +313 -0
- package/es/actions/lines-actions.js +81 -0
- package/es/actions/project-actions.js +281 -0
- package/es/actions/scene-actions.js +33 -0
- package/es/actions/vertices-actions.js +27 -0
- package/es/actions/viewer2d-actions.js +58 -0
- package/es/actions/viewer3d-actions.js +23 -0
- package/es/catalog/areas/area/planner-element.js +40 -0
- 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 +277 -0
- 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 +181 -0
- package/es/catalog/factories/area-factory.js +81 -0
- package/es/catalog/factories/export.js +7 -0
- package/es/catalog/factories/wall-factory-3d.js +202 -0
- package/es/catalog/factories/wall-factory.js +268 -0
- package/es/catalog/holes/door-closet/planner-element.js +222 -0
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +315 -0
- package/es/catalog/holes/door-exterior/planner-element.js +215 -0
- package/es/catalog/holes/door-interior/planner-element.js +227 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +503 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
- package/es/catalog/holes/door-sliding/planner-element.js +225 -0
- package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
- package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
- package/es/catalog/holes/export.js +13 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +166 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +165 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +276 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +70 -0
- 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 +28 -0
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +116 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +97 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +101 -0
- package/es/catalog/properties/property-length-measure.js +134 -0
- package/es/catalog/properties/property-length-measure_hole.js +101 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/FuseUtils.js +82 -0
- package/es/catalog/utils/exporter.js +148 -0
- package/es/catalog/utils/geom-utils.js +189 -0
- package/es/catalog/utils/item-loader.js +1521 -0
- package/es/catalog/utils/load-obj.js +91 -0
- package/es/catalog/utils/mtl-loader.js +358 -0
- package/es/catalog/utils/obj-loader.js +477 -0
- package/es/class/FuseUtils.js +82 -0
- package/es/class/area.js +145 -0
- package/es/class/export.js +24 -0
- package/es/class/group.js +440 -0
- package/es/class/guide.js +62 -0
- package/es/class/hole.js +929 -0
- package/es/class/item.js +1883 -0
- package/es/class/layer.js +667 -0
- package/es/class/line.js +1180 -0
- package/es/class/project.js +793 -0
- package/es/class/vertex.js +202 -0
- package/es/components/content.js +107 -0
- package/es/components/disclaimer/disclaimer.js +97 -0
- package/es/components/export.js +9 -0
- package/es/components/style/button.js +113 -0
- package/es/components/style/cancel-button.js +22 -0
- package/es/components/style/content-container.js +33 -0
- package/es/components/style/content-title.js +29 -0
- package/es/components/style/delete-button.js +25 -0
- package/es/components/style/export.js +31 -0
- package/es/components/style/form-block.js +24 -0
- package/es/components/style/form-color-input.js +27 -0
- package/es/components/style/form-label.js +26 -0
- package/es/components/style/form-number-input.js +213 -0
- package/es/components/style/form-number-input_2.js +206 -0
- package/es/components/style/form-select.js +68 -0
- package/es/components/style/form-slider.js +61 -0
- package/es/components/style/form-submit-button.js +26 -0
- package/es/components/style/form-text-input.js +95 -0
- package/es/components/viewer2d/area.js +81 -0
- package/es/components/viewer2d/export.js +31 -0
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
- package/es/components/viewer2d/grids/grids.js +35 -0
- package/es/components/viewer2d/group.js +53 -0
- package/es/components/viewer2d/item.js +513 -0
- package/es/components/viewer2d/layer.js +164 -0
- package/es/components/viewer2d/line.js +882 -0
- package/es/components/viewer2d/ruler.js +100 -0
- package/es/components/viewer2d/rulerDist.js +146 -0
- package/es/components/viewer2d/rulerX.js +151 -0
- package/es/components/viewer2d/rulerY.js +153 -0
- package/es/components/viewer2d/scene.js +140 -0
- package/es/components/viewer2d/snap.js +74 -0
- package/es/components/viewer2d/state.js +78 -0
- package/es/components/viewer2d/utils.js +198 -0
- package/es/components/viewer2d/vertex.js +65 -0
- package/es/components/viewer2d/viewer2d.js +1398 -0
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
- package/es/components/viewer3d/dcm.js +401 -0
- package/es/components/viewer3d/fbm.js +414 -0
- package/es/components/viewer3d/front3D.js +66 -0
- package/es/components/viewer3d/grid-creator.js +25 -0
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer3d/grids/grid-streak.js +27 -0
- package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer3d/libs/first-person-controls.js +67 -0
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
- package/es/components/viewer3d/libs/mtl-loader.js +357 -0
- package/es/components/viewer3d/libs/obj-loader.js +462 -0
- package/es/components/viewer3d/libs/orbit-controls.js +699 -0
- package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
- package/es/components/viewer3d/lrm.js +305 -0
- package/es/components/viewer3d/model.js +708 -0
- package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
- package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
- package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
- package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
- package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
- package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
- package/es/components/viewer3d/scene-creator.js +3608 -0
- package/es/components/viewer3d/three-memory-cleaner.js +51 -0
- package/es/components/viewer3d/viewer3d-first-person.js +315 -0
- package/es/components/viewer3d/viewer3d.js +2527 -0
- package/es/constants.js +636 -0
- package/es/index.js +16 -0
- package/es/models.js +510 -0
- package/es/plugins/SVGLoader.js +1412 -0
- package/es/plugins/autosave.js +33 -0
- package/es/plugins/console-debugger.js +37 -0
- package/es/plugins/export.js +9 -0
- package/es/plugins/keyboard.js +101 -0
- package/es/reducers/areas-reducer.js +12 -0
- package/es/reducers/export.js +25 -0
- package/es/reducers/groups-reducer.js +38 -0
- package/es/reducers/holes-reducer.js +62 -0
- package/es/reducers/items-reducer.js +140 -0
- package/es/reducers/lines-reducer.js +45 -0
- package/es/reducers/project-reducer.js +129 -0
- package/es/reducers/reducer.js +19 -0
- package/es/reducers/scene-reducer.js +28 -0
- package/es/reducers/user-reducer.js +40 -0
- package/es/reducers/vertices-reducer.js +19 -0
- package/es/reducers/viewer2d-reducer.js +75 -0
- package/es/reducers/viewer3d-reducer.js +56 -0
- package/es/shared-style.js +66 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/translator/en.js +104 -0
- package/es/translator/it.js +79 -0
- package/es/translator/ru.js +79 -0
- package/es/translator/translator.js +84 -0
- package/es/utils/browser.js +33 -0
- package/es/utils/email-validator.js +4 -0
- package/es/utils/export.js +25 -0
- package/es/utils/geometry.js +2420 -0
- package/es/utils/get-edges-of-subgraphs.js +27 -0
- package/es/utils/graph-cycles.js +237 -0
- package/es/utils/graph-inner-cycles.js +46 -0
- package/es/utils/graph.js +150 -0
- package/es/utils/helper.js +268 -0
- package/es/utils/history.js +29 -0
- package/es/utils/id-broker.js +19 -0
- package/es/utils/logger.js +8 -0
- package/es/utils/math.js +50 -0
- package/es/utils/molding.js +871 -0
- package/es/utils/name-generator.js +18 -0
- package/es/utils/objects-utils.js +50 -0
- package/es/utils/phone-validator.js +4 -0
- package/es/utils/process-black-list.js +18 -0
- package/es/utils/react-if.js +18 -0
- package/es/utils/snap-scene.js +99 -0
- package/es/utils/snap.js +237 -0
- package/es/utils/summarizeCart.js +24 -0
- package/es/utils/threeCSG.es6.js +498 -0
- package/es/version.js +2 -0
- package/lib/catalog/properties/property-string.js +55 -0
- package/lib/catalog/properties/property-toggle.js +46 -0
- package/lib/catalog/properties/shared-property-style.js +20 -0
- package/lib/catalog/utils/FuseUtils.js +88 -0
- package/lib/catalog/utils/exporter.js +155 -0
- package/lib/catalog/utils/geom-utils.js +205 -0
- package/lib/catalog/utils/item-loader.js +1533 -0
- package/lib/catalog/utils/load-obj.js +99 -0
- package/lib/catalog/utils/mtl-loader.js +363 -0
- package/lib/catalog/utils/obj-loader.js +482 -0
- package/lib/class/FuseUtils.js +88 -0
- package/lib/class/area.js +150 -0
- package/lib/class/export.js +96 -0
- package/lib/class/group.js +445 -0
- package/lib/class/guide.js +67 -0
- package/lib/class/hole.js +934 -0
- package/lib/class/item.js +1889 -0
- package/lib/class/layer.js +672 -0
- package/lib/class/line.js +1186 -0
- package/lib/class/project.js +799 -0
- package/lib/class/vertex.js +207 -0
- package/lib/components/content.js +116 -0
- package/lib/components/disclaimer/disclaimer.js +105 -0
- package/lib/components/export.js +33 -0
- package/lib/components/style/button.js +120 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +40 -0
- package/lib/components/style/content-title.js +37 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +121 -0
- package/lib/components/style/form-block.js +31 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +33 -0
- package/lib/components/style/form-number-input.js +220 -0
- package/lib/components/style/form-number-input_2.js +213 -0
- package/lib/components/style/form-select.js +75 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +101 -0
- package/lib/components/viewer2d/area.js +88 -0
- package/lib/components/viewer2d/export.js +121 -0
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer2d/grids/grids.js +44 -0
- package/lib/components/viewer2d/group.js +62 -0
- package/lib/components/viewer2d/item.js +521 -0
- package/lib/components/viewer2d/layer.js +171 -0
- package/lib/components/viewer2d/line.js +892 -0
- package/lib/components/viewer2d/ruler.js +107 -0
- package/lib/components/viewer2d/rulerDist.js +153 -0
- package/lib/components/viewer2d/rulerX.js +158 -0
- package/lib/components/viewer2d/rulerY.js +160 -0
- package/lib/components/viewer2d/scene.js +147 -0
- package/lib/components/viewer2d/snap.js +83 -0
- package/lib/components/viewer2d/state.js +87 -0
- package/lib/components/viewer2d/utils.js +210 -0
- package/lib/components/viewer2d/vertex.js +74 -0
- package/lib/components/viewer2d/viewer2d.js +1405 -0
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
- package/lib/components/viewer3d/dcm.js +407 -0
- package/lib/components/viewer3d/fbm.js +420 -0
- package/lib/components/viewer3d/front3D.js +75 -0
- package/lib/components/viewer3d/grid-creator.js +34 -0
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer3d/grids/grid-streak.js +35 -0
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
- package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
- package/lib/components/viewer3d/libs/obj-loader.js +468 -0
- package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
- package/lib/components/viewer3d/lrm.js +311 -0
- package/lib/components/viewer3d/model.js +714 -0
- package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
- package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
- package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
- package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
- package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
- package/lib/components/viewer3d/scene-creator.js +3642 -0
- package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
- package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
- package/lib/components/viewer3d/viewer3d.js +2532 -0
- package/lib/constants.js +645 -0
- package/lib/index.js +96 -0
- package/lib/models.js +517 -0
- package/lib/plugins/SVGLoader.js +1417 -0
- package/lib/plugins/autosave.js +39 -0
- package/lib/plugins/console-debugger.js +44 -0
- package/lib/plugins/export.js +33 -0
- package/lib/plugins/keyboard.js +107 -0
- package/lib/reducers/areas-reducer.js +18 -0
- package/lib/reducers/export.js +97 -0
- package/lib/reducers/groups-reducer.js +44 -0
- package/lib/reducers/holes-reducer.js +68 -0
- package/lib/reducers/items-reducer.js +146 -0
- package/lib/reducers/lines-reducer.js +51 -0
- package/lib/reducers/project-reducer.js +135 -0
- package/lib/reducers/reducer.js +26 -0
- package/lib/reducers/scene-reducer.js +34 -0
- package/lib/reducers/user-reducer.js +46 -0
- package/lib/reducers/vertices-reducer.js +25 -0
- package/lib/reducers/viewer2d-reducer.js +82 -0
- package/lib/reducers/viewer3d-reducer.js +63 -0
- package/lib/shared-style.js +72 -0
- package/lib/styles/export.js +13 -0
- package/lib/translator/en.js +110 -0
- package/lib/translator/it.js +85 -0
- package/lib/translator/ru.js +85 -0
- package/lib/translator/translator.js +90 -0
- package/lib/utils/browser.js +40 -0
- package/lib/utils/email-validator.js +10 -0
- package/lib/utils/export.js +56 -0
- package/lib/utils/geometry.js +2516 -0
- package/lib/utils/get-edges-of-subgraphs.js +34 -0
- package/lib/utils/graph-cycles.js +240 -0
- package/lib/utils/graph-inner-cycles.js +54 -0
- package/lib/utils/graph.js +157 -0
- package/lib/utils/helper.js +291 -0
- package/lib/utils/history.js +36 -0
- package/lib/utils/id-broker.js +25 -0
- package/lib/utils/logger.js +14 -0
- package/lib/utils/math.js +57 -0
- package/lib/utils/molding.js +895 -0
- package/lib/utils/name-generator.js +23 -0
- package/lib/utils/objects-utils.js +60 -0
- package/lib/utils/phone-validator.js +10 -0
- package/lib/utils/process-black-list.js +24 -0
- package/lib/utils/react-if.js +24 -0
- package/lib/utils/snap-scene.js +105 -0
- package/lib/utils/snap.js +249 -0
- package/lib/utils/summarizeCart.js +30 -0
- package/lib/utils/threeCSG.es6.js +503 -0
- package/lib/version.js +8 -0
- package/package.json +3 -3
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Three from 'three';
|
|
3
|
+
import { loadGLTF, scaleObject } from "../../utils/load-obj";
|
|
4
|
+
import { OBJTYPE_MESH } from "../../../constants";
|
|
5
|
+
var cached3DWindow = null;
|
|
6
|
+
export default {
|
|
7
|
+
name: 'Double Hung Window',
|
|
8
|
+
prototype: 'holes',
|
|
9
|
+
info: {
|
|
10
|
+
title: 'Double Hung',
|
|
11
|
+
tag: ['window'],
|
|
12
|
+
description: 'Double Hung Window',
|
|
13
|
+
image: '/assets/img/svg/window/Double_hung.svg',
|
|
14
|
+
url: '/assets/gltf/window_double_hung.gltf'
|
|
15
|
+
},
|
|
16
|
+
properties: {
|
|
17
|
+
width: {
|
|
18
|
+
label: 'Width',
|
|
19
|
+
type: 'length-measure',
|
|
20
|
+
defaultValue: {
|
|
21
|
+
length: 86.36
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
height: {
|
|
25
|
+
label: 'Height',
|
|
26
|
+
type: 'length-measure',
|
|
27
|
+
defaultValue: {
|
|
28
|
+
length: 100
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
altitude: {
|
|
32
|
+
label: 'Distance from floor',
|
|
33
|
+
type: 'length-measure',
|
|
34
|
+
defaultValue: {
|
|
35
|
+
length: 121.92
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
thickness: {
|
|
39
|
+
label: 'Thickness',
|
|
40
|
+
type: 'length-measure',
|
|
41
|
+
defaultValue: {
|
|
42
|
+
length: 6
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// flip: {
|
|
46
|
+
// label: 'Flip',
|
|
47
|
+
// type: 'checkbox',
|
|
48
|
+
// defaultValue: 'false',
|
|
49
|
+
// },
|
|
50
|
+
},
|
|
51
|
+
render2D: function render2D(element, layer, scene) {
|
|
52
|
+
var STYLE_HOLE_BASE = {
|
|
53
|
+
stroke: 'rgb(73, 73, 73)',
|
|
54
|
+
strokeWidth: '1px',
|
|
55
|
+
strokeDasharray: '9,5',
|
|
56
|
+
fill: 'rgb(73, 73, 73)'
|
|
57
|
+
};
|
|
58
|
+
var STYLE_HOLE_SELECTED = {
|
|
59
|
+
stroke: '#0096fd',
|
|
60
|
+
strokeWidth: '1px',
|
|
61
|
+
strokeDasharray: '9,5',
|
|
62
|
+
fill: '#0096fd',
|
|
63
|
+
cursor: 'move'
|
|
64
|
+
};
|
|
65
|
+
var STYLE_ARC_BASE = {
|
|
66
|
+
stroke: 'rgb(73, 73, 73)',
|
|
67
|
+
strokeWidth: '1px',
|
|
68
|
+
strokeDasharray: '9,5',
|
|
69
|
+
fill: 'none'
|
|
70
|
+
};
|
|
71
|
+
var STYLE_ARC_SELECTED = {
|
|
72
|
+
stroke: '#0096fd',
|
|
73
|
+
strokeWidth: '1px',
|
|
74
|
+
strokeDasharray: '9,5',
|
|
75
|
+
fill: 'none',
|
|
76
|
+
cursor: 'move'
|
|
77
|
+
};
|
|
78
|
+
var STYLE_STR0 = {
|
|
79
|
+
fill: 'rgb(185, 185, 185)',
|
|
80
|
+
stroke: '#494949',
|
|
81
|
+
strokeWidth: '1',
|
|
82
|
+
strokeMiterlimit: '2.61313'
|
|
83
|
+
};
|
|
84
|
+
var STYLE_STR0_S = {
|
|
85
|
+
fill: 'rgb(185, 185, 185)',
|
|
86
|
+
stroke: '#0096fd',
|
|
87
|
+
strokeWidth: '1',
|
|
88
|
+
strokeMiterlimit: '2.61313'
|
|
89
|
+
};
|
|
90
|
+
var STYLE_STR1 = {
|
|
91
|
+
fill: 'none',
|
|
92
|
+
stroke: '#494949',
|
|
93
|
+
strokeWidth: '1',
|
|
94
|
+
strokeLinecap: 'round',
|
|
95
|
+
strokeLinejoin: 'round',
|
|
96
|
+
strokeMiterlimit: '2.61313',
|
|
97
|
+
strokeDasharray: '23.860041 11.930021'
|
|
98
|
+
};
|
|
99
|
+
var STYLE_FILL2 = {
|
|
100
|
+
fill: '#1183B7'
|
|
101
|
+
};
|
|
102
|
+
var STYLE_FNT0 = {
|
|
103
|
+
fill: 'white',
|
|
104
|
+
fontWeight: 'normal',
|
|
105
|
+
fontSize: '12px',
|
|
106
|
+
fontFamily: 'Proxima Nova Rg'
|
|
107
|
+
};
|
|
108
|
+
//let line = layer.lines.get(hole.line);
|
|
109
|
+
//let epsilon = line.properties.get('thickness') / 2;
|
|
110
|
+
|
|
111
|
+
var EPSILON = 3;
|
|
112
|
+
var lineWidth = element.properties.get('thickness').get('length');
|
|
113
|
+
// let flip = element.properties.get('flip');
|
|
114
|
+
var holeWidth = element.properties.get('width').get('length');
|
|
115
|
+
var holePath = "M".concat(0, " ", -EPSILON, " L").concat(holeWidth, " ").concat(-EPSILON, " L").concat(holeWidth, " ").concat(EPSILON, " L", 0, " ").concat(EPSILON, " z");
|
|
116
|
+
var arcPath = "M".concat(0, ",", 0, " A", holeWidth, ",").concat(holeWidth, " 0 0,1 ").concat(holeWidth, ",").concat(holeWidth);
|
|
117
|
+
var holeStyle = element.selected ? STYLE_HOLE_SELECTED : STYLE_HOLE_BASE;
|
|
118
|
+
var arcStyle = element.selected ? STYLE_ARC_SELECTED : STYLE_ARC_BASE;
|
|
119
|
+
var rectStyle = element.selected ? STYLE_STR0_S : STYLE_STR0;
|
|
120
|
+
var length = element.properties.get('width').get('length');
|
|
121
|
+
// if(flip == false) {
|
|
122
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
123
|
+
transform: "translate(".concat(-length / 2, ", 0)")
|
|
124
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
125
|
+
style: rectStyle,
|
|
126
|
+
x: "0",
|
|
127
|
+
y: -lineWidth / 2,
|
|
128
|
+
width: holeWidth,
|
|
129
|
+
height: lineWidth
|
|
130
|
+
}));
|
|
131
|
+
// }
|
|
132
|
+
// else{
|
|
133
|
+
// return (
|
|
134
|
+
// <g transform={`translate(${-length / 2}, 0)`}>
|
|
135
|
+
// {/* <path d={arcPath} style={arcStyle} transform={`translate(${0},${-holeWidth}) scale(${1},${1}) rotate(${0})`}/>
|
|
136
|
+
// <line x1={0} y1={- holeWidth - EPSILON} x2={0} y2={0 - EPSILON} style={holeStyle} transform={`scale(${1},${1})`}/> */}
|
|
137
|
+
// <rect style={rectStyle} x="0" y={-lineWidth/2} width={holeWidth} height={lineWidth}/>
|
|
138
|
+
// <rect style={STYLE_FILL2} x={holeWidth - 16} y="-8.5" width="18" height="17" rx="1.27" ry="1.27"/>
|
|
139
|
+
// <text x={holeWidth - 15} y="4.5" style={STYLE_FNT0}>W3</text>
|
|
140
|
+
// </g>
|
|
141
|
+
// )
|
|
142
|
+
// }
|
|
143
|
+
},
|
|
144
|
+
render3D: function render3D(element, layer, scene) {
|
|
145
|
+
var onLoadItem = function onLoadItem(object) {
|
|
146
|
+
var venetian = new Three.Object3D();
|
|
147
|
+
var width = element.properties.get('width').get('length');
|
|
148
|
+
var height = element.properties.get('height').get('length');
|
|
149
|
+
var thickness = element.properties.get('thickness').get('length');
|
|
150
|
+
scaleObject(object, [90, 100, 6], [width, height, thickness]);
|
|
151
|
+
if (element.selected) {
|
|
152
|
+
var box = new Three.BoxHelper(object, 0x99c3fb);
|
|
153
|
+
box.material.linewidth = 2;
|
|
154
|
+
box.material.depthTest = false;
|
|
155
|
+
box.renderOrder = 1000;
|
|
156
|
+
object.add(box);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
//let normalMap = require('./texture.png');
|
|
160
|
+
//let t = new Three.TextureLoader().load(normalMap);
|
|
161
|
+
var examplecolor = new Three.Color(0xffffff);
|
|
162
|
+
var mat2 = new Three.MeshStandardMaterial({
|
|
163
|
+
color: examplecolor,
|
|
164
|
+
metalness: 0.1,
|
|
165
|
+
roughness: 0.9
|
|
166
|
+
});
|
|
167
|
+
//mat2.map = t;
|
|
168
|
+
// mat2.envMap = textureCube;
|
|
169
|
+
|
|
170
|
+
for (var j = 0; j < object.children.length; j++) {
|
|
171
|
+
if (object.children[j].type === OBJTYPE_MESH) {
|
|
172
|
+
object.children[j].material = mat2;
|
|
173
|
+
object.children[j].receiveShadow = true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
venetian.add(object);
|
|
177
|
+
//venetian.add(createTenda());
|
|
178
|
+
|
|
179
|
+
return object;
|
|
180
|
+
};
|
|
181
|
+
if (cached3DWindow) {
|
|
182
|
+
return Promise.resolve(onLoadItem(cached3DWindow.clone()));
|
|
183
|
+
}
|
|
184
|
+
return loadGLTF(element.url).then(function (object) {
|
|
185
|
+
cached3DWindow = object;
|
|
186
|
+
return onLoadItem(cached3DWindow.clone());
|
|
187
|
+
});
|
|
188
|
+
function createTenda() {
|
|
189
|
+
var venetian = new Three.Object3D();
|
|
190
|
+
|
|
191
|
+
//colors
|
|
192
|
+
var white = new Three.MeshLambertMaterial({
|
|
193
|
+
color: 0xffffff,
|
|
194
|
+
opacity: 0.5,
|
|
195
|
+
transparent: true
|
|
196
|
+
});
|
|
197
|
+
var grey = new Three.MeshLambertMaterial({
|
|
198
|
+
color: 0xcccccc
|
|
199
|
+
});
|
|
200
|
+
var roundedRectShape = new Three.Shape();
|
|
201
|
+
var x = 0;
|
|
202
|
+
var y = 0;
|
|
203
|
+
var width = 1;
|
|
204
|
+
var height = 18;
|
|
205
|
+
var radius = 0.25;
|
|
206
|
+
roundedRectShape.moveTo(x, y + radius);
|
|
207
|
+
roundedRectShape.lineTo(x, y + height - radius);
|
|
208
|
+
roundedRectShape.quadraticCurveTo(x, y + height, x + radius, y + height);
|
|
209
|
+
roundedRectShape.lineTo(x + width - radius, y + height);
|
|
210
|
+
roundedRectShape.quadraticCurveTo(x + width, y + height, x + width, y + height - radius);
|
|
211
|
+
roundedRectShape.lineTo(x + width, y + radius);
|
|
212
|
+
roundedRectShape.quadraticCurveTo(x + width, y, x + width - radius, y);
|
|
213
|
+
roundedRectShape.lineTo(x + radius, y);
|
|
214
|
+
roundedRectShape.quadraticCurveTo(x, y, x, y + radius);
|
|
215
|
+
var holePath1 = new Three.Path();
|
|
216
|
+
holePath1.moveTo(0.5, 0.6);
|
|
217
|
+
holePath1.arc(0, 0.7, 0.15, 0, Math.PI, false);
|
|
218
|
+
holePath1.arc(0.15, -0.09, 0.15, Math.PI, 0, false);
|
|
219
|
+
roundedRectShape.holes.push(holePath1);
|
|
220
|
+
var holePath2 = new Three.Path();
|
|
221
|
+
holePath2.moveTo(0.5, 4.6);
|
|
222
|
+
holePath2.arc(0, 0.7, 0.15, 0, Math.PI, false);
|
|
223
|
+
holePath2.arc(0.15, -0.09, 0.15, Math.PI, 0, false);
|
|
224
|
+
roundedRectShape.holes.push(holePath2);
|
|
225
|
+
var holePath3 = new Three.Path();
|
|
226
|
+
holePath3.moveTo(0.5, 8.6);
|
|
227
|
+
holePath3.arc(0, 0.7, 0.15, 0, Math.PI, false);
|
|
228
|
+
holePath3.arc(0.15, -0.09, 0.15, Math.PI, 0, false);
|
|
229
|
+
roundedRectShape.holes.push(holePath3);
|
|
230
|
+
var holePath4 = new Three.Path();
|
|
231
|
+
holePath4.moveTo(0.5, 12.6);
|
|
232
|
+
holePath4.arc(0, 0.7, 0.15, 0, Math.PI, false);
|
|
233
|
+
holePath4.arc(0.15, -0.09, 0.15, Math.PI, 0, false);
|
|
234
|
+
roundedRectShape.holes.push(holePath4);
|
|
235
|
+
var holePath5 = new Three.Path();
|
|
236
|
+
holePath5.moveTo(0.5, 16.6);
|
|
237
|
+
holePath5.arc(0, 0.7, 0.15, 0, Math.PI, false);
|
|
238
|
+
holePath5.arc(0.15, -0.09, 0.15, Math.PI, 0, false);
|
|
239
|
+
roundedRectShape.holes.push(holePath5);
|
|
240
|
+
var extrudeSettings = {
|
|
241
|
+
steps: 1,
|
|
242
|
+
depth: 0.2,
|
|
243
|
+
bevelEnabled: false,
|
|
244
|
+
bevelThickness: 0.4,
|
|
245
|
+
bevelSize: 0.4,
|
|
246
|
+
bevelSegments: 1
|
|
247
|
+
};
|
|
248
|
+
for (var i = 0; i < 25; i += 0.7) {
|
|
249
|
+
var geometry = new Three.ExtrudeGeometry(roundedRectShape, extrudeSettings);
|
|
250
|
+
var mesh = new Three.Mesh(geometry, grey);
|
|
251
|
+
mesh.position.set(0, i, 0.86);
|
|
252
|
+
mesh.rotation.z += Math.PI / 2;
|
|
253
|
+
mesh.rotation.x += -Math.PI / 2;
|
|
254
|
+
venetian.add(mesh);
|
|
255
|
+
}
|
|
256
|
+
for (var j = -1.25; j > -19; j += -4) {
|
|
257
|
+
var geometry1 = new Three.CylinderGeometry(0.105, 0.105, 26, 32);
|
|
258
|
+
var tubo = new Three.Mesh(geometry1, white);
|
|
259
|
+
tubo.position.set(j, 12.5, 0.35);
|
|
260
|
+
venetian.add(tubo);
|
|
261
|
+
}
|
|
262
|
+
var roundedRectShape2 = new Three.Shape();
|
|
263
|
+
var x1 = 0;
|
|
264
|
+
var y1 = 0;
|
|
265
|
+
var width1 = 1;
|
|
266
|
+
var height1 = 18;
|
|
267
|
+
var radius1 = 0.25;
|
|
268
|
+
roundedRectShape2.moveTo(x1, y1 + radius1);
|
|
269
|
+
roundedRectShape2.lineTo(x1, y1 + height1 - radius1);
|
|
270
|
+
roundedRectShape2.quadraticCurveTo(x1, y1 + height1, x1 + radius1, y1 + height1);
|
|
271
|
+
roundedRectShape2.lineTo(x1 + width1 - radius1, y1 + height1);
|
|
272
|
+
roundedRectShape2.quadraticCurveTo(x1 + width1, y1 + height1, x1 + width1, y1 + height1 - radius1);
|
|
273
|
+
roundedRectShape2.lineTo(x1 + width1, y1 + radius1);
|
|
274
|
+
roundedRectShape2.quadraticCurveTo(x1 + width1, y1, x1 + width1 - radius1, y1);
|
|
275
|
+
roundedRectShape2.lineTo(x1 + radius1, y1);
|
|
276
|
+
roundedRectShape2.quadraticCurveTo(x1, y1, x1, y1 + radius1);
|
|
277
|
+
var extrudeSettings2 = {
|
|
278
|
+
steps: 1,
|
|
279
|
+
depth: 0.4,
|
|
280
|
+
bevelEnabled: false,
|
|
281
|
+
bevelThickness: 0.4,
|
|
282
|
+
bevelSize: 0.4,
|
|
283
|
+
bevelSegments: 1
|
|
284
|
+
};
|
|
285
|
+
for (var k = -0.5; k < 27; k += 26) {
|
|
286
|
+
var geometry2 = new Three.ExtrudeGeometry(roundedRectShape2, extrudeSettings2);
|
|
287
|
+
var mesh2 = new Three.Mesh(geometry2, grey);
|
|
288
|
+
mesh2.position.set(0, k, 1);
|
|
289
|
+
mesh2.rotation.z += Math.PI / 2;
|
|
290
|
+
mesh2.rotation.x += -Math.PI / 2;
|
|
291
|
+
venetian.add(mesh2);
|
|
292
|
+
}
|
|
293
|
+
var valueObject = new Three.Box3().setFromObject(venetian);
|
|
294
|
+
var deltaX = Math.abs(valueObject.max.x - valueObject.min.x);
|
|
295
|
+
var deltaY = Math.abs(valueObject.max.y - valueObject.min.y);
|
|
296
|
+
var deltaZ = Math.abs(valueObject.max.z - valueObject.min.z);
|
|
297
|
+
venetian.position.x += width1 / 0.025;
|
|
298
|
+
venetian.position.y += -height1 / 0.4;
|
|
299
|
+
venetian.scale.set(5.2 * width1 / deltaZ, 5.45 * height1 / deltaY, 2.5 * thickness / deltaX);
|
|
300
|
+
return venetian;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Three from 'three';
|
|
3
|
+
import { loadGLTF, scaleObject } from "../../utils/load-obj";
|
|
4
|
+
import { OBJTYPE_MESH } from "../../../constants";
|
|
5
|
+
var cached3DWindow = null;
|
|
6
|
+
var STYLE_HOLE_BASE = {
|
|
7
|
+
stroke: '#000',
|
|
8
|
+
strokeWidth: '3px',
|
|
9
|
+
fill: '#000'
|
|
10
|
+
};
|
|
11
|
+
var STYLE_HOLE_SELECTED = {
|
|
12
|
+
stroke: '#0096fd',
|
|
13
|
+
strokeWidth: '3px',
|
|
14
|
+
fill: '#0096fd',
|
|
15
|
+
cursor: 'move'
|
|
16
|
+
};
|
|
17
|
+
var EPSILON = 3;
|
|
18
|
+
export default {
|
|
19
|
+
name: 'window-vertical',
|
|
20
|
+
prototype: 'holes',
|
|
21
|
+
info: {
|
|
22
|
+
tag: ['window'],
|
|
23
|
+
title: 'Vertical',
|
|
24
|
+
description: 'Vertical Window',
|
|
25
|
+
image: '/assets/img/svg/window/Vertical.svg',
|
|
26
|
+
url: '/assets/gltf/window_vertical.gltf'
|
|
27
|
+
},
|
|
28
|
+
properties: {
|
|
29
|
+
width: {
|
|
30
|
+
label: 'width',
|
|
31
|
+
type: 'length-measure',
|
|
32
|
+
defaultValue: {
|
|
33
|
+
length: 86.36
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
height: {
|
|
37
|
+
label: 'height',
|
|
38
|
+
type: 'length-measure',
|
|
39
|
+
defaultValue: {
|
|
40
|
+
length: 100
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
altitude: {
|
|
44
|
+
label: 'Distance from floor',
|
|
45
|
+
type: 'length-measure',
|
|
46
|
+
defaultValue: {
|
|
47
|
+
length: 121.92
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
thickness: {
|
|
51
|
+
label: 'thickness',
|
|
52
|
+
type: 'length-measure',
|
|
53
|
+
defaultValue: {
|
|
54
|
+
length: 6
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
render2D: function render2D(element, layer, scene) {
|
|
59
|
+
var STYLE_HOLE_BASE = {
|
|
60
|
+
stroke: 'rgb(73, 73, 73)',
|
|
61
|
+
strokeWidth: '1px',
|
|
62
|
+
strokeDasharray: '9,5',
|
|
63
|
+
fill: 'rgb(73, 73, 73)'
|
|
64
|
+
};
|
|
65
|
+
var STYLE_HOLE_SELECTED = {
|
|
66
|
+
stroke: '#0096fd',
|
|
67
|
+
strokeWidth: '1px',
|
|
68
|
+
strokeDasharray: '9,5',
|
|
69
|
+
fill: '#0096fd',
|
|
70
|
+
cursor: 'move'
|
|
71
|
+
};
|
|
72
|
+
var STYLE_ARC_BASE = {
|
|
73
|
+
stroke: 'rgb(73, 73, 73)',
|
|
74
|
+
strokeWidth: '1px',
|
|
75
|
+
strokeDasharray: '9,5',
|
|
76
|
+
fill: 'none'
|
|
77
|
+
};
|
|
78
|
+
var STYLE_ARC_SELECTED = {
|
|
79
|
+
stroke: '#0096fd',
|
|
80
|
+
strokeWidth: '1px',
|
|
81
|
+
strokeDasharray: '9,5',
|
|
82
|
+
fill: 'none',
|
|
83
|
+
cursor: 'move'
|
|
84
|
+
};
|
|
85
|
+
var STYLE_STR0 = {
|
|
86
|
+
fill: 'rgb(185, 185, 185)',
|
|
87
|
+
stroke: '#494949',
|
|
88
|
+
strokeWidth: '1',
|
|
89
|
+
strokeMiterlimit: '2.61313'
|
|
90
|
+
};
|
|
91
|
+
var STYLE_STR0_S = {
|
|
92
|
+
fill: 'rgb(185, 185, 185)',
|
|
93
|
+
stroke: '#0096fd',
|
|
94
|
+
strokeWidth: '1',
|
|
95
|
+
strokeMiterlimit: '2.61313'
|
|
96
|
+
};
|
|
97
|
+
var STYLE_STR1 = {
|
|
98
|
+
fill: 'none',
|
|
99
|
+
stroke: '#494949',
|
|
100
|
+
strokeWidth: '1',
|
|
101
|
+
strokeLinecap: 'round',
|
|
102
|
+
strokeLinejoin: 'round',
|
|
103
|
+
strokeMiterlimit: '2.61313',
|
|
104
|
+
strokeDasharray: '23.860041 11.930021'
|
|
105
|
+
};
|
|
106
|
+
var STYLE_FILL2 = {
|
|
107
|
+
fill: '#1183B7'
|
|
108
|
+
};
|
|
109
|
+
var STYLE_FNT0 = {
|
|
110
|
+
fill: 'white',
|
|
111
|
+
fontWeight: 'normal',
|
|
112
|
+
fontSize: '12px',
|
|
113
|
+
fontFamily: 'Proxima Nova Rg'
|
|
114
|
+
};
|
|
115
|
+
//let line = layer.lines.get(hole.line);
|
|
116
|
+
//let epsilon = line.properties.get('thickness') / 2;
|
|
117
|
+
|
|
118
|
+
var EPSILON = 3;
|
|
119
|
+
var lineWidth = element.properties.get('thickness').get('length');
|
|
120
|
+
var flip = element.properties.get('flip');
|
|
121
|
+
var holeWidth = element.properties.get('width').get('length');
|
|
122
|
+
var holePath = "M".concat(0, " ", -EPSILON, " L").concat(holeWidth, " ").concat(-EPSILON, " L").concat(holeWidth, " ").concat(EPSILON, " L", 0, " ").concat(EPSILON, " z");
|
|
123
|
+
var arcPath = "M".concat(0, ",", 0, " A", holeWidth, ",").concat(holeWidth, " 0 0,1 ").concat(holeWidth, ",").concat(holeWidth);
|
|
124
|
+
var holeStyle = element.selected ? STYLE_HOLE_SELECTED : STYLE_HOLE_BASE;
|
|
125
|
+
var arcStyle = element.selected ? STYLE_ARC_SELECTED : STYLE_ARC_BASE;
|
|
126
|
+
var rectStyle = element.selected ? STYLE_STR0_S : STYLE_STR0;
|
|
127
|
+
var length = element.properties.get('width').get('length');
|
|
128
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
129
|
+
transform: "translate(".concat(-length / 2, ", 0)")
|
|
130
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
131
|
+
style: rectStyle,
|
|
132
|
+
x: "0",
|
|
133
|
+
y: -lineWidth / 2,
|
|
134
|
+
width: holeWidth,
|
|
135
|
+
height: lineWidth
|
|
136
|
+
}));
|
|
137
|
+
},
|
|
138
|
+
render3D: function render3D(element, layer, scene) {
|
|
139
|
+
var onLoadItem = function onLoadItem(object) {
|
|
140
|
+
var width = element.properties.get('width').get('length');
|
|
141
|
+
var height = element.properties.get('height').get('length');
|
|
142
|
+
var thickness = element.properties.get('thickness').get('length');
|
|
143
|
+
scaleObject(object, [90, 100, 6], [width, height, thickness]);
|
|
144
|
+
if (element.selected) {
|
|
145
|
+
var box = new Three.BoxHelper(object, 0x99c3fb);
|
|
146
|
+
box.material.linewidth = 2;
|
|
147
|
+
box.material.depthTest = false;
|
|
148
|
+
box.renderOrder = 1000;
|
|
149
|
+
object.add(box);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
//let normalMap = require('./texture.png');
|
|
153
|
+
//let t = new Three.TextureLoader().load(normalMap);
|
|
154
|
+
var examplecolor = new Three.Color(0xffffff);
|
|
155
|
+
var mat2 = new Three.MeshStandardMaterial({
|
|
156
|
+
color: examplecolor,
|
|
157
|
+
metalness: 0.1,
|
|
158
|
+
roughness: 0.9
|
|
159
|
+
});
|
|
160
|
+
//mat2.map = t;
|
|
161
|
+
// mat2.envMap = textureCube;
|
|
162
|
+
|
|
163
|
+
for (var j = 0; j < object.children.length; j++) {
|
|
164
|
+
if (object.children[j].type === OBJTYPE_MESH) {
|
|
165
|
+
if (object.children[j].name.includes('_glass')) object.children[j].scale.z /= 2;
|
|
166
|
+
object.children[j].material = mat2;
|
|
167
|
+
object.children[j].receiveShadow = true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return object;
|
|
171
|
+
};
|
|
172
|
+
if (cached3DWindow) {
|
|
173
|
+
return Promise.resolve(onLoadItem(cached3DWindow.clone()));
|
|
174
|
+
}
|
|
175
|
+
return loadGLTF(element.url).then(function (object) {
|
|
176
|
+
cached3DWindow = object;
|
|
177
|
+
return onLoadItem(cached3DWindow.clone());
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// function createTenda() {
|
|
181
|
+
|
|
182
|
+
// let radialWave = function (u, v) {
|
|
183
|
+
// let r = 10;
|
|
184
|
+
// let x = Math.sin(u) * 3 * r;
|
|
185
|
+
// let z = Math.sin(v / 2) * 2 * r;
|
|
186
|
+
// let y = (Math.sin(u * 2 * Math.PI) + Math.cos(v * 2 * Math.PI)) * .5;
|
|
187
|
+
|
|
188
|
+
// return new Three.Vector3(x, y, z);
|
|
189
|
+
// };
|
|
190
|
+
|
|
191
|
+
// //color
|
|
192
|
+
// let white = new Three.MeshLambertMaterial({ color: 0xeae6ca });
|
|
193
|
+
|
|
194
|
+
// let Tenda = new Three.Object3D();
|
|
195
|
+
|
|
196
|
+
// let mesh = createMesh(new Three.ParametricGeometry(radialWave, 20, 20));
|
|
197
|
+
// mesh.rotation.x += Math.PI / 2;
|
|
198
|
+
// mesh.rotation.y += Math.PI / 2;
|
|
199
|
+
// mesh.position.y += 3.1;
|
|
200
|
+
// mesh.position.x += .05;
|
|
201
|
+
// mesh.scale.set(.125, .125, .125);
|
|
202
|
+
|
|
203
|
+
// let mesh2 = mesh.clone();
|
|
204
|
+
// mesh2.rotation.x += Math.PI;
|
|
205
|
+
// mesh2.position.set(1.4, 0, 0.06);
|
|
206
|
+
|
|
207
|
+
// Tenda.add(mesh);
|
|
208
|
+
// Tenda.add(mesh2);
|
|
209
|
+
|
|
210
|
+
// for (let i = -.7; i > -3.4; i -= .45) {
|
|
211
|
+
// let geometry = new Three.TorusGeometry(.08, .016, 32, 32, 2 * Math.PI);
|
|
212
|
+
// let torus = new Three.Mesh(geometry, white);
|
|
213
|
+
|
|
214
|
+
// if (i == -1.15)
|
|
215
|
+
// torus.position.set(i, 3.14, .045);
|
|
216
|
+
// else if (i == -2.5)
|
|
217
|
+
// torus.position.set(i, 3.14, -.01);
|
|
218
|
+
// else
|
|
219
|
+
// torus.position.set(i, 3.14, .04);
|
|
220
|
+
// torus.rotation.y += Math.PI / 2;
|
|
221
|
+
// Tenda.add(torus);
|
|
222
|
+
// }
|
|
223
|
+
|
|
224
|
+
// let geometryAsta = new Three.CylinderGeometry(0.02, 0.02, 1.25, 32);
|
|
225
|
+
// let asta = new Three.Mesh(geometryAsta, white);
|
|
226
|
+
// asta.position.set(-1.1, 3.18, 0.02);
|
|
227
|
+
// asta.rotation.z += Math.PI / 2;
|
|
228
|
+
// Tenda.add(asta);
|
|
229
|
+
|
|
230
|
+
// let asta2 = asta.clone();
|
|
231
|
+
// asta2.position.set(-2.5, 3.18, 0.02);
|
|
232
|
+
// Tenda.add(asta2);
|
|
233
|
+
|
|
234
|
+
// let geometrySphereUp = new Three.SphereGeometry(0.04, 32, 32);
|
|
235
|
+
// let sphere = new Three.Mesh(geometrySphereUp, white);
|
|
236
|
+
// sphere.position.set(-.5, 3.18, 0.02);
|
|
237
|
+
// sphere.rotation.x += Math.PI / 2;
|
|
238
|
+
// sphere.scale.set(0.8, 1, 1);
|
|
239
|
+
// Tenda.add(sphere);
|
|
240
|
+
|
|
241
|
+
// let sphere2 = sphere.clone();
|
|
242
|
+
// sphere2.position.x += -1.2;
|
|
243
|
+
// Tenda.add(sphere2);
|
|
244
|
+
|
|
245
|
+
// let sphere3 = sphere.clone();
|
|
246
|
+
// sphere3.position.x += -1.4;
|
|
247
|
+
// Tenda.add(sphere3);
|
|
248
|
+
|
|
249
|
+
// let sphere4 = sphere.clone();
|
|
250
|
+
// sphere4.position.x += -2.6;
|
|
251
|
+
// Tenda.add(sphere4);
|
|
252
|
+
|
|
253
|
+
// let valueObject = new Three.Box3().setFromObject(Tenda);
|
|
254
|
+
|
|
255
|
+
// let deltaX = Math.abs(valueObject.max.x - valueObject.min.x);
|
|
256
|
+
// let deltaY = Math.abs(valueObject.max.y - valueObject.min.y);
|
|
257
|
+
// let deltaZ = Math.abs(valueObject.max.z - valueObject.min.z);
|
|
258
|
+
|
|
259
|
+
// Tenda.position.x += width / 1.48;
|
|
260
|
+
// Tenda.position.y += -height / 2.1;
|
|
261
|
+
// Tenda.position.z += thickness / 1024;
|
|
262
|
+
// Tenda.scale.set(width / deltaX, height / deltaY, thickness / deltaZ);
|
|
263
|
+
|
|
264
|
+
// return Tenda;
|
|
265
|
+
// }
|
|
266
|
+
|
|
267
|
+
// function createMesh(geom) {
|
|
268
|
+
// geom.applyMatrix(new Three.Matrix4().makeTranslation(-25, 0, -25));
|
|
269
|
+
// let meshMaterial = new Three.MeshLambertMaterial({ color: 0xffffff, opacity: 0.9, transparent: true });
|
|
270
|
+
// meshMaterial.side = Three.DoubleSide;
|
|
271
|
+
|
|
272
|
+
// let plane = new Three.Mesh(geom, meshMaterial);
|
|
273
|
+
// return plane;
|
|
274
|
+
// }
|
|
275
|
+
}
|
|
276
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ElementsFactories } from "../../..";
|
|
2
|
+
var info = {
|
|
3
|
+
title: 'wall',
|
|
4
|
+
tag: ['wall'],
|
|
5
|
+
description: 'Wall with bricks or painted',
|
|
6
|
+
image: require("./wall.png"),
|
|
7
|
+
visibility: {
|
|
8
|
+
catalog: true,
|
|
9
|
+
layerElementsVisible: true
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var textures = {
|
|
13
|
+
plaster: {
|
|
14
|
+
name: 'Plaster',
|
|
15
|
+
uri: require("./textures/plaster.jpg"),
|
|
16
|
+
lengthRepeatScale: 0.005,
|
|
17
|
+
heightRepeatScale: 0.005,
|
|
18
|
+
normal: {
|
|
19
|
+
uri: require("./textures/plaster-normal.jpg"),
|
|
20
|
+
lengthRepeatScale: 0.005,
|
|
21
|
+
heightRepeatScale: 0.005,
|
|
22
|
+
normalScaleX: 0.4,
|
|
23
|
+
normalScaleY: 0.4,
|
|
24
|
+
color: '#000000'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
bricks: {
|
|
28
|
+
name: 'Bricks',
|
|
29
|
+
uri: require("./textures/bricks.jpg"),
|
|
30
|
+
lengthRepeatScale: 0.009,
|
|
31
|
+
heightRepeatScale: 0.009,
|
|
32
|
+
normal: {
|
|
33
|
+
uri: require("./textures/bricks-normal.jpg"),
|
|
34
|
+
lengthRepeatScale: 0.009,
|
|
35
|
+
heightRepeatScale: 0.009,
|
|
36
|
+
normalScaleX: 0.4,
|
|
37
|
+
normalScaleY: 0.4,
|
|
38
|
+
color: '#000000'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
painted: {
|
|
42
|
+
name: 'Painted',
|
|
43
|
+
uri: require("./textures/painted.jpg"),
|
|
44
|
+
lengthRepeatScale: 0.005,
|
|
45
|
+
heightRepeatScale: 0.005,
|
|
46
|
+
normal: {
|
|
47
|
+
uri: require("./textures/painted-normal.jpg"),
|
|
48
|
+
lengthRepeatScale: 0.005,
|
|
49
|
+
heightRepeatScale: 0.005,
|
|
50
|
+
normalScaleX: 0.4,
|
|
51
|
+
normalScaleY: 0.4,
|
|
52
|
+
color: '#000000'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
morden: {
|
|
56
|
+
name: 'Morden',
|
|
57
|
+
uri: require("./textures/morden.jpg"),
|
|
58
|
+
lengthRepeatScale: 0.005,
|
|
59
|
+
heightRepeatScale: 0.005,
|
|
60
|
+
normal: {
|
|
61
|
+
uri: require("./textures/morden-normal.jpg"),
|
|
62
|
+
lengthRepeatScale: 0.005,
|
|
63
|
+
heightRepeatScale: 0.005,
|
|
64
|
+
normalScaleX: 0.4,
|
|
65
|
+
normalScaleY: 0.4,
|
|
66
|
+
color: '#000000'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export default ElementsFactories.WallFactory('wall', info, textures);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|