kitchen-simulator 1.1.1-test.72 → 1.1.1-test.74
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 -5
- package/es/AppContext.js +3 -6
- package/es/KitchenConfigurator.js +86 -86
- package/es/KitchenConfiguratorApp.js +134 -128
- package/es/actions/area-actions.js +5 -8
- package/es/actions/export.js +12 -24
- package/es/actions/groups-actions.js +27 -41
- package/es/actions/holes-actions.js +34 -51
- package/es/actions/items-actions.js +94 -141
- package/es/actions/lines-actions.js +21 -32
- package/es/actions/project-actions.js +94 -141
- package/es/actions/scene-actions.js +11 -17
- package/es/actions/vertices-actions.js +7 -11
- package/es/actions/viewer2d-actions.js +21 -32
- package/es/actions/viewer3d-actions.js +9 -14
- package/es/catalog/areas/area/planner-element.js +2 -5
- package/es/catalog/catalog.js +15 -17
- package/es/catalog/factories/area-factory-3d.js +22 -26
- package/es/catalog/factories/area-factory.js +13 -15
- package/es/catalog/factories/export.js +6 -10
- package/es/catalog/factories/wall-factory-3d.js +31 -36
- package/es/catalog/factories/wall-factory.js +21 -26
- package/es/catalog/holes/door-closet/planner-element.js +15 -19
- package/es/catalog/holes/door-double/planner-element.js +15 -19
- package/es/catalog/holes/door-exterior/planner-element.js +16 -20
- package/es/catalog/holes/door-interior/planner-element.js +16 -20
- package/es/catalog/holes/door-panic/planner-element.js +7 -11
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -19
- package/es/catalog/holes/door-sliding/planner-element.js +17 -21
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -15
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -11
- package/es/catalog/holes/export.js +13 -29
- package/es/catalog/holes/window-clear/planner-element.js +10 -14
- package/es/catalog/holes/window-cross/planner-element.js +10 -14
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -14
- package/es/catalog/holes/window-vertical/planner-element.js +10 -14
- package/es/catalog/lines/wall/planner-element.js +2 -5
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -9
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -9
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -9
- package/es/catalog/properties/export.js +20 -31
- package/es/catalog/properties/property-checkbox.js +28 -29
- package/es/catalog/properties/property-color.js +16 -19
- package/es/catalog/properties/property-enum.js +24 -27
- package/es/catalog/properties/property-hidden.js +9 -12
- package/es/catalog/properties/property-lenght-measure.js +38 -41
- package/es/catalog/properties/property-length-measure.js +36 -39
- package/es/catalog/properties/property-length-measure_hole.js +38 -41
- package/es/catalog/properties/property-number.js +17 -20
- package/es/catalog/properties/property-read-only.js +16 -19
- package/es/catalog/properties/property-string.js +16 -19
- package/es/catalog/properties/property-toggle.js +16 -19
- package/es/catalog/properties/shared-property-style.js +1 -3
- package/es/catalog/utils/FuseUtils.js +12 -13
- package/es/catalog/utils/exporter.js +10 -11
- package/es/catalog/utils/geom-utils.js +13 -24
- package/es/catalog/utils/item-loader.js +86 -92
- package/es/catalog/utils/load-obj.js +20 -24
- package/es/catalog/utils/mtl-loader.js +3 -4
- package/es/catalog/utils/obj-loader.js +3 -4
- package/es/class/FuseUtils.js +12 -13
- package/es/class/area.js +24 -24
- package/es/class/export.js +23 -36
- package/es/class/group.js +53 -55
- package/es/class/guide.js +15 -17
- package/es/class/hole.js +83 -85
- package/es/class/item.js +155 -155
- package/es/class/layer.js +59 -61
- package/es/class/line.js +135 -138
- package/es/class/project.js +93 -94
- package/es/class/vertex.js +29 -31
- package/es/components/content.js +19 -23
- package/es/components/disclaimer/disclaimer.js +10 -13
- package/es/components/export.js +8 -13
- package/es/components/style/button.js +25 -25
- package/es/components/style/cancel-button.js +7 -10
- package/es/components/style/content-container.js +11 -12
- package/es/components/style/content-title.js +13 -15
- package/es/components/style/delete-button.js +8 -12
- package/es/components/style/export.js +30 -46
- package/es/components/style/form-block.js +10 -11
- package/es/components/style/form-color-input.js +7 -10
- package/es/components/style/form-label.js +10 -11
- package/es/components/style/form-number-input.js +45 -43
- package/es/components/style/form-number-input_2.js +41 -39
- package/es/components/style/form-select.js +19 -20
- package/es/components/style/form-slider.js +10 -13
- package/es/components/style/form-submit-button.js +8 -12
- package/es/components/style/form-text-input.js +30 -28
- package/es/components/viewer2d/area.js +17 -20
- package/es/components/viewer2d/export.js +30 -46
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -13
- package/es/components/viewer2d/grids/grids.js +10 -14
- package/es/components/viewer2d/group.js +15 -19
- package/es/components/viewer2d/item.js +61 -65
- package/es/components/viewer2d/layer.js +23 -26
- package/es/components/viewer2d/line.js +101 -106
- package/es/components/viewer2d/ruler.js +22 -25
- package/es/components/viewer2d/rulerDist.js +21 -24
- package/es/components/viewer2d/rulerX.js +46 -44
- package/es/components/viewer2d/rulerY.js +44 -42
- package/es/components/viewer2d/scene.js +34 -34
- package/es/components/viewer2d/snap.js +13 -17
- package/es/components/viewer2d/state.js +18 -22
- package/es/components/viewer2d/utils.js +24 -33
- package/es/components/viewer2d/vertex.js +8 -12
- package/es/components/viewer2d/viewer2d.js +156 -159
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +21 -19
- package/es/components/viewer3d/dcm.js +1 -3
- package/es/components/viewer3d/fbm.js +1 -3
- package/es/components/viewer3d/front3D.js +12 -16
- package/es/components/viewer3d/grid-creator.js +8 -12
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -9
- package/es/components/viewer3d/grids/grid-streak.js +5 -8
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -9
- package/es/components/viewer3d/libs/first-person-controls.js +2 -5
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -3
- package/es/components/viewer3d/libs/mtl-loader.js +1 -3
- package/es/components/viewer3d/libs/obj-loader.js +1 -3
- package/es/components/viewer3d/libs/orbit-controls.js +2 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -4
- package/es/components/viewer3d/lrm.js +1 -3
- package/es/components/viewer3d/model.js +1 -3
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -6
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -21
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -62
- package/es/components/viewer3d/ruler-utils/ruler3D.js +42 -43
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -13
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -7
- package/es/components/viewer3d/scene-creator.js +197 -223
- package/es/components/viewer3d/three-memory-cleaner.js +3 -7
- package/es/components/viewer3d/viewer3d-first-person.js +42 -42
- package/es/components/viewer3d/viewer3d.js +200 -198
- package/es/constants.js +349 -354
- package/es/index.js +7 -11
- package/es/models.js +193 -191
- package/es/plugins/SVGLoader.js +48 -49
- package/es/plugins/autosave.js +3 -5
- package/es/plugins/console-debugger.js +6 -7
- package/es/plugins/export.js +8 -13
- package/es/plugins/keyboard.js +29 -31
- package/es/reducers/areas-reducer.js +7 -9
- package/es/reducers/export.js +24 -37
- package/es/reducers/groups-reducer.js +31 -33
- package/es/reducers/holes-reducer.js +43 -45
- package/es/reducers/items-reducer.js +106 -108
- package/es/reducers/lines-reducer.js +28 -30
- package/es/reducers/project-reducer.js +105 -107
- package/es/reducers/reducer.js +16 -19
- package/es/reducers/scene-reducer.js +15 -17
- package/es/reducers/user-reducer.js +5 -7
- package/es/reducers/vertices-reducer.js +11 -13
- package/es/reducers/viewer2d-reducer.js +18 -20
- package/es/reducers/viewer3d-reducer.js +16 -18
- package/es/shared-style.js +10 -12
- package/es/styles/export.js +3 -6
- package/es/translator/en.js +1 -3
- package/es/translator/it.js +1 -3
- package/es/translator/ru.js +1 -3
- package/es/translator/translator.js +13 -15
- package/es/utils/browser.js +2 -5
- package/es/utils/convert-units-lite.js +1 -3
- package/es/utils/email-validator.js +1 -3
- package/es/utils/export.js +15 -29
- package/es/utils/geometry.js +190 -280
- package/es/utils/get-edges-of-subgraphs.js +2 -5
- package/es/utils/graph-cycles.js +8 -7
- package/es/utils/graph-inner-cycles.js +10 -14
- package/es/utils/graph.js +9 -13
- package/es/utils/helper.js +41 -58
- package/es/utils/history.js +8 -11
- package/es/utils/id-broker.js +8 -11
- package/es/utils/logger.js +1 -3
- package/es/utils/math.js +5 -8
- package/es/utils/molding.js +130 -146
- package/es/utils/name-generator.js +7 -9
- package/es/utils/objects-utils.js +7 -14
- package/es/utils/phone-validator.js +1 -3
- package/es/utils/process-black-list.js +5 -6
- package/es/utils/react-if.js +7 -9
- package/es/utils/snap-scene.js +27 -30
- package/es/utils/snap.js +53 -57
- package/es/utils/summarizeCart.js +1 -3
- package/es/utils/threeCSG.es6.js +13 -17
- package/es/version.js +1 -3
- package/package.json +1 -1
package/es/catalog/catalog.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var _constants = require("../constants");
|
|
9
|
-
var _utils = require("../components/viewer2d/utils");
|
|
10
|
-
var Catalog = exports["default"] = /*#__PURE__*/function () {
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly } from "./properties/export";
|
|
5
|
+
import { UNIT_CENTIMETER, UNIT_INCH } from "../constants";
|
|
6
|
+
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
7
|
+
var Catalog = /*#__PURE__*/function () {
|
|
11
8
|
function Catalog() {
|
|
12
|
-
var unit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
13
|
-
(
|
|
9
|
+
var unit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : UNIT_CENTIMETER;
|
|
10
|
+
_classCallCheck(this, Catalog);
|
|
14
11
|
this.elements = {};
|
|
15
12
|
this.categories = {
|
|
16
13
|
root: {
|
|
@@ -22,7 +19,7 @@ var Catalog = exports["default"] = /*#__PURE__*/function () {
|
|
|
22
19
|
};
|
|
23
20
|
this.propertyTypes = {};
|
|
24
21
|
this.unit = unit;
|
|
25
|
-
this.registerMultiplePropertyType([['color',
|
|
22
|
+
this.registerMultiplePropertyType([['color', PropertyColor, PropertyColor], ['enum', PropertyEnum, PropertyEnum], ['string', PropertyString, PropertyString], ['number', PropertyNumber, PropertyNumber], ['length-measure', PropertyLengthMeasure, PropertyLengthMeasure], ['toggle', PropertyToggle, PropertyToggle], ['checkbox', PropertyCheckbox, PropertyCheckbox], ['hidden', PropertyHidden, PropertyHidden], ['read-only', PropertyReadOnly, PropertyReadOnly]]);
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
/**
|
|
@@ -30,13 +27,13 @@ var Catalog = exports["default"] = /*#__PURE__*/function () {
|
|
|
30
27
|
* @param {string} type Element's type
|
|
31
28
|
* @return {?object} Element
|
|
32
29
|
*/
|
|
33
|
-
return (
|
|
30
|
+
return _createClass(Catalog, [{
|
|
34
31
|
key: "getElement",
|
|
35
32
|
value: function getElement(type) {
|
|
36
33
|
if (this.hasElement(type)) {
|
|
37
34
|
return this.elements[type];
|
|
38
35
|
} else {
|
|
39
|
-
var deepSearchType =
|
|
36
|
+
var deepSearchType = returnReplaceableDeepSearchType(type);
|
|
40
37
|
var element = this.elements[deepSearchType];
|
|
41
38
|
if (element) return element;
|
|
42
39
|
if (!element) return false;
|
|
@@ -129,7 +126,7 @@ var Catalog = exports["default"] = /*#__PURE__*/function () {
|
|
|
129
126
|
value: function registerMultiplePropertyType(propertyTypeArray) {
|
|
130
127
|
var _this2 = this;
|
|
131
128
|
propertyTypeArray.forEach(function (el) {
|
|
132
|
-
return _this2.registerPropertyType.apply(_this2, (
|
|
129
|
+
return _this2.registerPropertyType.apply(_this2, _toConsumableArray(el));
|
|
133
130
|
});
|
|
134
131
|
}
|
|
135
132
|
|
|
@@ -267,4 +264,5 @@ var Catalog = exports["default"] = /*#__PURE__*/function () {
|
|
|
267
264
|
return this.categories.hasOwnProperty(categoryName);
|
|
268
265
|
}
|
|
269
266
|
}]);
|
|
270
|
-
}();
|
|
267
|
+
}();
|
|
268
|
+
export { Catalog as default };
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _three = _interopRequireWildcard(require("three"));
|
|
6
|
-
var Three = _three;
|
|
7
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
8
|
-
var _RGBELoader = require("three/examples/jsm/loaders/RGBELoader");
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { Box3, Mesh, MeshBasicMaterial, MeshPhysicalMaterial, RepeatWrapping, Shape, TextureLoader, Vector2 } from 'three';
|
|
3
|
+
import * as SharedStyle from "../../shared-style";
|
|
4
|
+
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader';
|
|
9
5
|
var params = {
|
|
10
6
|
envMap: 'HDR',
|
|
11
7
|
roughness: 0.9,
|
|
@@ -22,19 +18,19 @@ var params = {
|
|
|
22
18
|
* @param height: The height of the face
|
|
23
19
|
*/
|
|
24
20
|
var applyTexture = function applyTexture(material, texture, length, height) {
|
|
25
|
-
var loader = new
|
|
21
|
+
var loader = new TextureLoader();
|
|
26
22
|
if (texture) {
|
|
27
23
|
material.map = loader.load(texture.uri);
|
|
28
24
|
material.map.colorSpace = Three.SRGBColorSpace;
|
|
29
25
|
material.needsUpdate = true;
|
|
30
|
-
material.map.wrapS =
|
|
31
|
-
material.map.wrapT =
|
|
26
|
+
material.map.wrapS = RepeatWrapping;
|
|
27
|
+
material.map.wrapT = RepeatWrapping;
|
|
32
28
|
material.map.repeat.set(length * texture.lengthRepeatScale, height * texture.heightRepeatScale);
|
|
33
29
|
if (texture.normal) {
|
|
34
30
|
material.normalMap = loader.load(texture.normal.uri);
|
|
35
|
-
material.normalScale = new
|
|
36
|
-
material.normalMap.wrapS =
|
|
37
|
-
material.normalMap.wrapT =
|
|
31
|
+
material.normalScale = new Vector2(texture.normal.normalScaleX, texture.normal.normalScaleY);
|
|
32
|
+
material.normalMap.wrapS = RepeatWrapping;
|
|
33
|
+
material.normalMap.wrapT = RepeatWrapping;
|
|
38
34
|
material.normalMap.repeat.set(length * texture.normal.lengthRepeatScale, height * texture.normal.heightRepeatScale);
|
|
39
35
|
}
|
|
40
36
|
}
|
|
@@ -49,8 +45,8 @@ var assignUVs = function assignUVs(geometry) {
|
|
|
49
45
|
var _geometry$boundingBox = geometry.boundingBox,
|
|
50
46
|
min = _geometry$boundingBox.min,
|
|
51
47
|
max = _geometry$boundingBox.max;
|
|
52
|
-
var offset = new
|
|
53
|
-
var range = new
|
|
48
|
+
var offset = new Vector2(0 - min.x, 0 - min.y);
|
|
49
|
+
var range = new Vector2(max.x - min.x, max.y - min.y);
|
|
54
50
|
var uvArray = [];
|
|
55
51
|
var position = geometry.attributes.position;
|
|
56
52
|
for (var i = 0; i < position.count; i += 3) {
|
|
@@ -65,7 +61,7 @@ var assignUVs = function assignUVs(geometry) {
|
|
|
65
61
|
geometry.setAttribute('uv', new Three.BufferAttribute(new Float32Array(uvArray), 2));
|
|
66
62
|
geometry.needsUpdate = true;
|
|
67
63
|
};
|
|
68
|
-
function createArea(element, layer, scene, textures) {
|
|
64
|
+
export function createArea(element, layer, scene, textures) {
|
|
69
65
|
var vertices = [];
|
|
70
66
|
element.vertices.forEach(function (vertexID) {
|
|
71
67
|
vertices.push(layer.vertices.get(vertexID));
|
|
@@ -82,20 +78,20 @@ function createArea(element, layer, scene, textures) {
|
|
|
82
78
|
if (texture.uri === undefined || texture.uri == '') {
|
|
83
79
|
texture.uri = layer.floorStyle.uri;
|
|
84
80
|
}
|
|
85
|
-
var shape = new
|
|
81
|
+
var shape = new Shape();
|
|
86
82
|
shape.moveTo(vertices[0].x, vertices[0].y);
|
|
87
83
|
for (var i = 1; i < vertices.length; i++) {
|
|
88
84
|
shape.lineTo(vertices[i].x, vertices[i].y);
|
|
89
85
|
}
|
|
90
86
|
function loadFloorENV() {
|
|
91
|
-
return new
|
|
87
|
+
return new RGBELoader().load('/assets/Window.hdr', function (texture) {
|
|
92
88
|
texture.mapping = Three.EquirectangularReflectionMapping;
|
|
93
89
|
return texture;
|
|
94
90
|
});
|
|
95
91
|
}
|
|
96
92
|
var floorENV = loadFloorENV();
|
|
97
|
-
var loader = new
|
|
98
|
-
var areaMaterial = new
|
|
93
|
+
var loader = new TextureLoader();
|
|
94
|
+
var areaMaterial = new MeshPhysicalMaterial({
|
|
99
95
|
side: Three.DoubleSide,
|
|
100
96
|
metalness: texture.metalness,
|
|
101
97
|
roughness: 0.3,
|
|
@@ -127,20 +123,20 @@ function createArea(element, layer, scene, textures) {
|
|
|
127
123
|
};
|
|
128
124
|
var shapeGeometry = new Three.ExtrudeGeometry(shape, extrudeSettings);
|
|
129
125
|
assignUVs(shapeGeometry);
|
|
130
|
-
var boundingBox = new
|
|
126
|
+
var boundingBox = new Box3().setFromObject(new Mesh(shapeGeometry, new MeshBasicMaterial()));
|
|
131
127
|
var width = boundingBox.max.x - boundingBox.min.x;
|
|
132
128
|
var height = boundingBox.max.y - boundingBox.min.y;
|
|
133
129
|
var texture_unit = 70 * 2.54; // 70 inch
|
|
134
130
|
|
|
135
131
|
applyTexture(areaMaterial, texture, width / texture_unit * 100, height / texture_unit * 100);
|
|
136
|
-
var area = new
|
|
132
|
+
var area = new Mesh(shapeGeometry, areaMaterial);
|
|
137
133
|
area.rotation.x -= Math.PI / 2;
|
|
138
134
|
area.receiveShadow = true;
|
|
139
135
|
area.name = 'floor';
|
|
140
136
|
// This mesh is use for creating ceiling mesh
|
|
141
137
|
|
|
142
138
|
var shapeGeometry2 = new Three.ShapeGeometry(shape);
|
|
143
|
-
var area2 = new
|
|
139
|
+
var area2 = new Mesh(shapeGeometry2, new MeshBasicMaterial({
|
|
144
140
|
transparent: true,
|
|
145
141
|
opacity: 0.0
|
|
146
142
|
}));
|
|
@@ -152,7 +148,7 @@ function createArea(element, layer, scene, textures) {
|
|
|
152
148
|
area.userData.floorSupport = floorSupport;
|
|
153
149
|
return Promise.resolve(area);
|
|
154
150
|
}
|
|
155
|
-
function updatedArea(element, layer, scene, textures, mesh, oldElement, differences, selfDestroy, selfBuild) {
|
|
151
|
+
export function updatedArea(element, layer, scene, textures, mesh, oldElement, differences, selfDestroy, selfBuild) {
|
|
156
152
|
var noPerf = function noPerf() {
|
|
157
153
|
selfDestroy();
|
|
158
154
|
return selfBuild();
|
|
@@ -176,7 +172,7 @@ function updatedArea(element, layer, scene, textures, mesh, oldElement, differen
|
|
|
176
172
|
* @returns {Shape}
|
|
177
173
|
*/
|
|
178
174
|
var createShape = function createShape(shapeCoords) {
|
|
179
|
-
var shape = new
|
|
175
|
+
var shape = new Shape();
|
|
180
176
|
shape.moveTo(shapeCoords[0][0], shapeCoords[0][1]);
|
|
181
177
|
for (var i = 1; i < shapeCoords.length; i++) {
|
|
182
178
|
shape.lineTo(shapeCoords[i][0], shapeCoords[i][1]);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var translator = new _translator["default"]();
|
|
11
|
-
function AreaFactory(name, info, textures) {
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { createArea, updatedArea } from "./area-factory-3d";
|
|
6
|
+
import * as SharedStyle from "../../shared-style";
|
|
7
|
+
import Translator from "../../translator/translator";
|
|
8
|
+
var translator = new Translator();
|
|
9
|
+
export default function AreaFactory(name, info, textures) {
|
|
12
10
|
var areaElement = {
|
|
13
11
|
name: name,
|
|
14
12
|
prototype: 'areas',
|
|
15
|
-
info: (
|
|
13
|
+
info: _objectSpread(_objectSpread({}, info), {}, {
|
|
16
14
|
visibility: {
|
|
17
15
|
catalog: false,
|
|
18
16
|
layerElementsVisible: false
|
|
@@ -50,16 +48,16 @@ function AreaFactory(name, info, textures) {
|
|
|
50
48
|
});
|
|
51
49
|
});
|
|
52
50
|
var fill = element.selected ? SharedStyle.AREA_MESH_COLOR.selected : SharedStyle.AREA_MESH_COLOR.unselected;
|
|
53
|
-
return /*#__PURE__*/
|
|
51
|
+
return /*#__PURE__*/React.createElement("path", {
|
|
54
52
|
d: path,
|
|
55
53
|
fill: fill
|
|
56
54
|
});
|
|
57
55
|
},
|
|
58
56
|
render3D: function render3D(element, layer, scene) {
|
|
59
|
-
return
|
|
57
|
+
return createArea(element, layer, scene, textures);
|
|
60
58
|
},
|
|
61
59
|
updateRender3D: function updateRender3D(element, layer, scene, mesh, oldElement, differences, selfDestroy, selfBuild) {
|
|
62
|
-
return
|
|
60
|
+
return updatedArea(element, layer, scene, textures, mesh, oldElement, differences, selfDestroy, selfBuild);
|
|
63
61
|
}
|
|
64
62
|
};
|
|
65
63
|
if (textures && textures !== {}) {
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.AreaFactory = _areaFactory["default"];
|
|
8
|
-
var _default = exports["default"] = {
|
|
9
|
-
WallFactory: _wallFactory["default"],
|
|
10
|
-
AreaFactory: _areaFactory["default"]
|
|
1
|
+
import WallFactory from "./wall-factory";
|
|
2
|
+
import AreaFactory from "./area-factory";
|
|
3
|
+
export { WallFactory, AreaFactory };
|
|
4
|
+
export default {
|
|
5
|
+
WallFactory: WallFactory,
|
|
6
|
+
AreaFactory: AreaFactory
|
|
11
7
|
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _helper = require("../../utils/helper");
|
|
10
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
11
|
-
var _constants = require("../../constants");
|
|
12
|
-
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
13
|
-
var _threeCSG = _interopRequireDefault(require("../../utils/threeCSG.es6"));
|
|
1
|
+
import * as Three from 'three';
|
|
2
|
+
import { BoxGeometry, Group, Mesh, MeshBasicMaterial, MeshStandardMaterial, RepeatWrapping, TextureLoader, Vector2 } from 'three';
|
|
3
|
+
import { verticesDistance } from "../../utils/geometry";
|
|
4
|
+
import { isElevationView } from "../../utils/helper";
|
|
5
|
+
import * as SharedStyle from "../../shared-style";
|
|
6
|
+
import { LINE_THICKNESS, UNIT_CENTIMETER } from "../../constants";
|
|
7
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
8
|
+
import ThreeBSP from "../../utils/threeCSG.es6";
|
|
14
9
|
var params = {
|
|
15
10
|
envMap: 'HDR',
|
|
16
11
|
roughness: 0.1,
|
|
@@ -28,23 +23,23 @@ var halfPI = Math.PI / 2;
|
|
|
28
23
|
* @param height: The height of the face
|
|
29
24
|
*/
|
|
30
25
|
var applyTexture = function applyTexture(material, texture, length, height) {
|
|
31
|
-
var loader = new
|
|
26
|
+
var loader = new TextureLoader();
|
|
32
27
|
if (texture) {
|
|
33
28
|
material.map = loader.load(texture.uri["default"]);
|
|
34
29
|
material.map.colorSpace = Three.SRGBColorSpace, material.needsUpdate = true;
|
|
35
|
-
material.map.wrapS =
|
|
36
|
-
material.map.wrapT =
|
|
30
|
+
material.map.wrapS = RepeatWrapping;
|
|
31
|
+
material.map.wrapT = RepeatWrapping;
|
|
37
32
|
material.map.repeat.set(length * texture.lengthRepeatScale, height * texture.heightRepeatScale);
|
|
38
33
|
if (texture.normal) {
|
|
39
34
|
material.normalMap = loader.load(texture.normal.uri["default"]);
|
|
40
|
-
material.normalScale = new
|
|
41
|
-
material.normalMap.wrapS =
|
|
42
|
-
material.normalMap.wrapT =
|
|
35
|
+
material.normalScale = new Vector2(texture.normal.normalScaleX, texture.normal.normalScaleY);
|
|
36
|
+
material.normalMap.wrapS = RepeatWrapping;
|
|
37
|
+
material.normalMap.wrapT = RepeatWrapping;
|
|
43
38
|
material.normalMap.repeat.set(length * texture.normal.lengthRepeatScale, height * texture.normal.heightRepeatScale);
|
|
44
39
|
}
|
|
45
40
|
}
|
|
46
41
|
};
|
|
47
|
-
function buildWall(element, layer, scene, textures, mode) {
|
|
42
|
+
export function buildWall(element, layer, scene, textures, mode) {
|
|
48
43
|
// Get the two vertices of the wall
|
|
49
44
|
var vetName0 = element.vertices.get(0);
|
|
50
45
|
var vetName1 = element.vertices.get(1);
|
|
@@ -64,9 +59,9 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
64
59
|
// Get height and thickness of the wall converting them into the current scene units
|
|
65
60
|
// let height = element.properties.getIn(['height', 'length']);
|
|
66
61
|
// let thickness = element.properties.getIn(['thickness', 'length']);
|
|
67
|
-
var height =
|
|
62
|
+
var height = convert(layer.ceilHeight).from(layer.unit).to(UNIT_CENTIMETER);
|
|
68
63
|
var thickness = 2.0;
|
|
69
|
-
var distance =
|
|
64
|
+
var distance = verticesDistance(vertex0, vertex1);
|
|
70
65
|
var soulMaterial = new Three.MeshPhongMaterial({
|
|
71
66
|
color: new Three.Color(wallColor).convertLinearToSRGB()
|
|
72
67
|
}); //element.selected ? SharedStyle.MESH_SELECTED : 0xD3D3D3
|
|
@@ -76,7 +71,7 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
76
71
|
soulVertices.push(new Three.Vector2(distance / 2, -height / 2));
|
|
77
72
|
soulVertices.push(new Three.Vector2(-distance / 2, -height / 2));
|
|
78
73
|
var soulShape = new Three.Shape(soulVertices);
|
|
79
|
-
var soulMesh = new
|
|
74
|
+
var soulMesh = new Mesh(new BoxGeometry(distance, height, thickness), soulMaterial);
|
|
80
75
|
if (element.userData.stateMode !== 'MODE_DRAWING_HOLE_3D') {
|
|
81
76
|
element.holes.forEach(function (holeID) {
|
|
82
77
|
var holeData = layer.holes.get(holeID);
|
|
@@ -99,14 +94,14 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
99
94
|
}
|
|
100
95
|
var shapeHole = new Three.Shape(holeVertices);
|
|
101
96
|
soulShape.holes.push(shapeHole);
|
|
102
|
-
var holeGeometry = new
|
|
103
|
-
var holeMesh = new
|
|
97
|
+
var holeGeometry = new BoxGeometry(holeWidth, holeHeight, thickness);
|
|
98
|
+
var holeMesh = new Mesh(holeGeometry);
|
|
104
99
|
holeMesh.position.x += holeWidth / 2;
|
|
105
100
|
holeMesh.position.y += holeHeight / 2;
|
|
106
101
|
holeMesh.position.x += holeDistance - distance / 2 - holeWidth / 2;
|
|
107
102
|
holeMesh.position.y -= height / 2 - holeAltitude;
|
|
108
|
-
var wallBSP = new
|
|
109
|
-
var holeBSP = new
|
|
103
|
+
var wallBSP = new ThreeBSP(soulMesh);
|
|
104
|
+
var holeBSP = new ThreeBSP(holeMesh);
|
|
110
105
|
var wallWithHoleBSP = wallBSP.subtract(holeBSP);
|
|
111
106
|
soulMesh = wallWithHoleBSP.toMesh(soulMaterial);
|
|
112
107
|
}
|
|
@@ -114,7 +109,7 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
114
109
|
}
|
|
115
110
|
var cAlpha = new Three.Vector2(vertex0.x - vertex1.x, vertex0.y - vertex1.y).angle();
|
|
116
111
|
var soulGeometry = new Three.ShapeGeometry(soulShape);
|
|
117
|
-
var soul = new
|
|
112
|
+
var soul = new Mesh(soulGeometry, soulMaterial);
|
|
118
113
|
soul.receiveShadow = true;
|
|
119
114
|
soul.castShadow = true;
|
|
120
115
|
soul.position.y += height / 2;
|
|
@@ -124,13 +119,13 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
124
119
|
soulMesh.rotation.y = cAlpha + Math.PI;
|
|
125
120
|
soulMesh.name = 'soul';
|
|
126
121
|
soulMesh.castShadow = true;
|
|
127
|
-
var frontMaterial = new
|
|
122
|
+
var frontMaterial = new MeshStandardMaterial({
|
|
128
123
|
color: new Three.Color(wallColor).convertLinearToSRGB(),
|
|
129
124
|
metalness: 0.1,
|
|
130
125
|
roughness: 0.9
|
|
131
126
|
// envMap: textureCube,
|
|
132
127
|
});
|
|
133
|
-
var backMaterial = new
|
|
128
|
+
var backMaterial = new MeshStandardMaterial({
|
|
134
129
|
color: new Three.Color(wallColor).convertLinearToSRGB(),
|
|
135
130
|
metalness: 0.1,
|
|
136
131
|
roughness: 0.9
|
|
@@ -142,11 +137,11 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
142
137
|
frontFace.material = frontMaterial;
|
|
143
138
|
frontFace.name = 'frontFace';
|
|
144
139
|
soulMesh.material = frontMaterial;
|
|
145
|
-
var merged = new
|
|
140
|
+
var merged = new Group();
|
|
146
141
|
merged.add(frontFace, soulMesh);
|
|
147
142
|
|
|
148
143
|
// if this wall is front of camera, show/hide
|
|
149
|
-
if (!
|
|
144
|
+
if (!isElevationView(mode)) {
|
|
150
145
|
frontFace.onBeforeRender = function (renderer, scene, camera, geometry, material, group) {
|
|
151
146
|
var soulMesh = this.parent.getObjectByName('soul');
|
|
152
147
|
if (geometry.attributes.normal === undefined) return soulMesh.visible = false;
|
|
@@ -165,7 +160,7 @@ function buildWall(element, layer, scene, textures, mode) {
|
|
|
165
160
|
}
|
|
166
161
|
return Promise.resolve(merged);
|
|
167
162
|
}
|
|
168
|
-
function updatedWall(element, layer, scene, textures, mesh, oldElement, differences, selfDestroy, selfBuild) {
|
|
163
|
+
export function updatedWall(element, layer, scene, textures, mesh, oldElement, differences, selfDestroy, selfBuild) {
|
|
169
164
|
var noPerf = function noPerf() {
|
|
170
165
|
selfDestroy();
|
|
171
166
|
return selfBuild();
|
|
@@ -176,7 +171,7 @@ function updatedWall(element, layer, scene, textures, mesh, oldElement, differen
|
|
|
176
171
|
if (differences[0] == 'selected') {
|
|
177
172
|
if (soul !== undefined) {
|
|
178
173
|
if (element.selected) {
|
|
179
|
-
soul.material = new
|
|
174
|
+
soul.material = new MeshBasicMaterial({
|
|
180
175
|
color: new Three.Color(SharedStyle.MESH_SELECTED).convertLinearToSRGB()
|
|
181
176
|
});
|
|
182
177
|
} else {
|
|
@@ -186,8 +181,8 @@ function updatedWall(element, layer, scene, textures, mesh, oldElement, differen
|
|
|
186
181
|
}
|
|
187
182
|
} else if (differences[0] == 'properties') {
|
|
188
183
|
if (differences[1] == 'thickness') {
|
|
189
|
-
var newThickness =
|
|
190
|
-
var oldThickness =
|
|
184
|
+
var newThickness = LINE_THICKNESS / 2;
|
|
185
|
+
var oldThickness = LINE_THICKNESS / 2;
|
|
191
186
|
// let newThickness = element.getIn(['properties', 'thickness', 'length']);
|
|
192
187
|
// let oldThickness = oldElement.getIn(['properties', 'thickness', 'length']);
|
|
193
188
|
var halfNewThickness = newThickness / 2;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var SharedStyle = _interopRequireWildcard(require("../../shared-style"));
|
|
8
|
-
var Geometry = _interopRequireWildcard(require("../../utils/geometry"));
|
|
9
|
-
var _translator = _interopRequireDefault(require("../../translator/translator"));
|
|
10
|
-
var _constants = require("../../constants");
|
|
11
|
-
var _line = _interopRequireDefault(require("../../class/line"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { buildWall, updatedWall } from "./wall-factory-3d";
|
|
3
|
+
import * as SharedStyle from "../../shared-style";
|
|
4
|
+
import * as Geometry from "../../utils/geometry";
|
|
5
|
+
import Translator from "../../translator/translator";
|
|
6
|
+
import { LINE_THICKNESS } from "../../constants";
|
|
12
7
|
// import Line from 'src/class/line';
|
|
13
|
-
|
|
8
|
+
import Line from "../../class/line";
|
|
14
9
|
var epsilon = 20;
|
|
15
10
|
var STYLE_TEXT = {
|
|
16
11
|
textAnchor: 'middle'
|
|
@@ -50,11 +45,11 @@ var STYLE_POLYGON_SELECTED = {
|
|
|
50
45
|
stroke: SharedStyle.LINE_MESH_COLOR.selected,
|
|
51
46
|
fill: SharedStyle.LINE_MESH_COLOR.selected
|
|
52
47
|
};
|
|
53
|
-
var translator = new
|
|
48
|
+
var translator = new Translator();
|
|
54
49
|
|
|
55
50
|
/** Create Lines from State */
|
|
56
51
|
var createLineGeometry = function createLineGeometry(scene, state) {
|
|
57
|
-
var wall_thickness =
|
|
52
|
+
var wall_thickness = LINE_THICKNESS / 2;
|
|
58
53
|
var layerID = scene.selectedLayer;
|
|
59
54
|
var layer = scene.getIn(['layers', layerID]);
|
|
60
55
|
var lines = layer.lines;
|
|
@@ -138,13 +133,13 @@ var createLineGeometry = function createLineGeometry(scene, state) {
|
|
|
138
133
|
});
|
|
139
134
|
}
|
|
140
135
|
});
|
|
141
|
-
state =
|
|
136
|
+
state = Line.setRelatedLine(state, layer.id, line.id, intersection).updatedState;
|
|
142
137
|
});
|
|
143
138
|
return {
|
|
144
139
|
updatedState: state
|
|
145
140
|
};
|
|
146
141
|
};
|
|
147
|
-
function WallFactory(name, info, textures) {
|
|
142
|
+
export default function WallFactory(name, info, textures) {
|
|
148
143
|
var wallElement = {
|
|
149
144
|
name: name,
|
|
150
145
|
prototype: 'lines',
|
|
@@ -160,7 +155,7 @@ function WallFactory(name, info, textures) {
|
|
|
160
155
|
label: translator.t('thickness'),
|
|
161
156
|
type: 'length-measure',
|
|
162
157
|
defaultValue: {
|
|
163
|
-
length:
|
|
158
|
+
length: LINE_THICKNESS / 2
|
|
164
159
|
}
|
|
165
160
|
},
|
|
166
161
|
properties: {},
|
|
@@ -180,7 +175,7 @@ function WallFactory(name, info, textures) {
|
|
|
180
175
|
var verticesinfo = layer.vertices.get(element.vertices.get(0));
|
|
181
176
|
var length = Geometry.pointsDistance(x1, y1, x2, y2);
|
|
182
177
|
var length_5 = length / 5;
|
|
183
|
-
var thickness =
|
|
178
|
+
var thickness = LINE_THICKNESS;
|
|
184
179
|
// let thickness = element.getIn(['properties', 'thickness', 'length']);
|
|
185
180
|
var half_thickness = thickness / 2;
|
|
186
181
|
var half_thickness_eps = half_thickness + epsilon;
|
|
@@ -203,35 +198,35 @@ function WallFactory(name, info, textures) {
|
|
|
203
198
|
});
|
|
204
199
|
|
|
205
200
|
//Fill a polygon with the pattern specified by the polygon's id.(For example:fill='url(#pat) =><pattern id="pat">)
|
|
206
|
-
var outwall = /*#__PURE__*/
|
|
201
|
+
var outwall = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
|
|
207
202
|
id: "pat",
|
|
208
203
|
x: "0",
|
|
209
204
|
y: "0",
|
|
210
205
|
width: "5",
|
|
211
206
|
height: "5",
|
|
212
207
|
patternUnits: "userSpaceOnUse"
|
|
213
|
-
}, /*#__PURE__*/
|
|
208
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
214
209
|
x1: "0",
|
|
215
210
|
y1: "0",
|
|
216
211
|
x2: "3",
|
|
217
212
|
y2: "3",
|
|
218
213
|
style: STYLE_LINE
|
|
219
214
|
})));
|
|
220
|
-
return !element.selected ? /*#__PURE__*/
|
|
215
|
+
return !element.selected ? /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("polygon", {
|
|
221
216
|
points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
|
|
222
217
|
fill: "url(#pat)",
|
|
223
218
|
fillRule: "evenodd"
|
|
224
|
-
}), outwall, /*#__PURE__*/
|
|
219
|
+
}), outwall, /*#__PURE__*/React.createElement("line", {
|
|
225
220
|
x1: x1,
|
|
226
221
|
y1: y1,
|
|
227
222
|
x2: x2,
|
|
228
223
|
y2: y2,
|
|
229
224
|
style: STYLE_INTERIOR_LINE
|
|
230
|
-
})) : /*#__PURE__*/
|
|
225
|
+
})) : /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("polygon", {
|
|
231
226
|
points: "".concat(x1, ",").concat(y1, " ").concat(related0x, ",").concat(related0y, " ").concat(related1x, ",").concat(related1y, " ").concat(x2, ",").concat(y2),
|
|
232
227
|
fill: "url(#pat)",
|
|
233
228
|
fillRule: "evenodd"
|
|
234
|
-
}), outwall, /*#__PURE__*/
|
|
229
|
+
}), outwall, /*#__PURE__*/React.createElement("line", {
|
|
235
230
|
x1: x1,
|
|
236
231
|
y1: y1,
|
|
237
232
|
x2: x2,
|
|
@@ -240,10 +235,10 @@ function WallFactory(name, info, textures) {
|
|
|
240
235
|
}));
|
|
241
236
|
},
|
|
242
237
|
render3D: function render3D(element, layer, scene, mode) {
|
|
243
|
-
return
|
|
238
|
+
return buildWall(element, layer, scene, textures, mode);
|
|
244
239
|
},
|
|
245
240
|
updateRender3D: function updateRender3D(element, layer, scene, mesh, oldElement, differences, selfDestroy, selfBuild) {
|
|
246
|
-
return
|
|
241
|
+
return updatedWall(element, layer, scene, textures, mesh, oldElement, differences, selfDestroy, selfBuild);
|
|
247
242
|
}
|
|
248
243
|
};
|
|
249
244
|
if (textures && textures !== {}) {
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
var Three = _interopRequireWildcard(require("three"));
|
|
7
|
-
var _loadObj = require("../../utils/load-obj");
|
|
8
|
-
var _constants = require("../../../constants");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Three from 'three';
|
|
3
|
+
import { loadGLTF } from "../../utils/load-obj";
|
|
4
|
+
import { OBJTYPE_MESH } from "../../../constants";
|
|
9
5
|
var cached3DDoor = null;
|
|
10
6
|
var STYLE_HOLE_BASE = {
|
|
11
7
|
stroke: 'rgb(73, 73, 73)',
|
|
@@ -64,7 +60,7 @@ var STYLE_FNT0 = {
|
|
|
64
60
|
fontFamily: 'Proxima Nova Rg'
|
|
65
61
|
};
|
|
66
62
|
var EPSILON = 3;
|
|
67
|
-
|
|
63
|
+
export default {
|
|
68
64
|
name: 'Closet',
|
|
69
65
|
prototype: 'holes',
|
|
70
66
|
info: {
|
|
@@ -125,20 +121,20 @@ var _default = exports["default"] = {
|
|
|
125
121
|
var rectStyle = element.selected ? STYLE_STR0_S : STYLE_STR0;
|
|
126
122
|
var length = element.properties.get('width').get('length');
|
|
127
123
|
if (flip == false) {
|
|
128
|
-
return /*#__PURE__*/
|
|
124
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
129
125
|
transform: "translate(".concat(-length / 2, ", 0)")
|
|
130
|
-
}, /*#__PURE__*/
|
|
126
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
131
127
|
d: arcPath,
|
|
132
128
|
style: arcStyle,
|
|
133
129
|
transform: "translate(".concat(0, ",", holeWidth, ") scale(", 1, ",").concat(-1, ") rotate(", 0, ")")
|
|
134
|
-
}), /*#__PURE__*/
|
|
130
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
135
131
|
x1: 0,
|
|
136
132
|
y1: holeWidth - EPSILON,
|
|
137
133
|
x2: 0,
|
|
138
134
|
y2: 0 - EPSILON,
|
|
139
135
|
style: holeStyle,
|
|
140
136
|
transform: "scale(".concat(-1, ",", 1, ")")
|
|
141
|
-
}), /*#__PURE__*/
|
|
137
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
142
138
|
style: rectStyle,
|
|
143
139
|
x: "0",
|
|
144
140
|
y: -lineWidth / 2,
|
|
@@ -146,20 +142,20 @@ var _default = exports["default"] = {
|
|
|
146
142
|
height: lineWidth
|
|
147
143
|
}));
|
|
148
144
|
} else {
|
|
149
|
-
return /*#__PURE__*/
|
|
145
|
+
return /*#__PURE__*/React.createElement("g", {
|
|
150
146
|
transform: "translate(".concat(-length / 2, ", 0)")
|
|
151
|
-
}, /*#__PURE__*/
|
|
147
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
152
148
|
d: arcPath,
|
|
153
149
|
style: arcStyle,
|
|
154
150
|
transform: "translate(".concat(0, ",", -holeWidth, ") scale(", 1, ",", 1, ") rotate(", 0, ")")
|
|
155
|
-
}), /*#__PURE__*/
|
|
151
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
156
152
|
x1: 0,
|
|
157
153
|
y1: -holeWidth - EPSILON,
|
|
158
154
|
x2: 0,
|
|
159
155
|
y2: 0 - EPSILON,
|
|
160
156
|
style: holeStyle,
|
|
161
157
|
transform: "scale(".concat(1, ",", 1, ")")
|
|
162
|
-
}), /*#__PURE__*/
|
|
158
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
163
159
|
style: rectStyle,
|
|
164
160
|
x: "0",
|
|
165
161
|
y: -lineWidth / 2,
|
|
@@ -202,7 +198,7 @@ var _default = exports["default"] = {
|
|
|
202
198
|
// mat2.map = t;
|
|
203
199
|
// mat2.envMap = textureCube;
|
|
204
200
|
for (var j = 0; j < object.children.length; j++) {
|
|
205
|
-
if (object.children[j].type ===
|
|
201
|
+
if (object.children[j].type === OBJTYPE_MESH) {
|
|
206
202
|
object.children[j].material = mat2;
|
|
207
203
|
object.children[j].receiveShadow = true;
|
|
208
204
|
}
|
|
@@ -218,7 +214,7 @@ var _default = exports["default"] = {
|
|
|
218
214
|
if (cached3DDoor) {
|
|
219
215
|
return Promise.resolve(onLoadItem(cached3DDoor.clone()));
|
|
220
216
|
}
|
|
221
|
-
return
|
|
217
|
+
return loadGLTF(element.url).then(function (object) {
|
|
222
218
|
cached3DDoor = object;
|
|
223
219
|
return onLoadItem(cached3DDoor.clone());
|
|
224
220
|
});
|