door_models 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +5 -1294
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -1295
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/DoorModels.d.ts +0 -20
- package/dist/components/DoorModels.js +0 -924
- package/dist/components/Interface.d.ts +0 -1
- package/dist/components/Interface.js +0 -1307
- package/dist/context/DoorContext.d.ts +0 -130
- package/dist/context/DoorContext.js +0 -631
- package/dist/index.js +0 -33
|
@@ -1,924 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.availableMaterials = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _csg = require("@react-three/csg");
|
|
9
|
-
var _DoorContext = require("../context/DoorContext");
|
|
10
|
-
var _three = require("@react-spring/three");
|
|
11
|
-
var _three2 = require("three");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
const placeholderMaterial = new _three2.MeshStandardMaterial({
|
|
15
|
-
color: "#cccccc",
|
|
16
|
-
roughness: 0.8
|
|
17
|
-
});
|
|
18
|
-
const placeholderMaterialforFrames = new _three2.MeshStandardMaterial({
|
|
19
|
-
color: "#000",
|
|
20
|
-
roughness: 0.8
|
|
21
|
-
});
|
|
22
|
-
const availableMaterials = exports.availableMaterials = {
|
|
23
|
-
black: new _three2.MeshStandardMaterial({
|
|
24
|
-
color: "#000000"
|
|
25
|
-
}),
|
|
26
|
-
metal: new _three2.MeshStandardMaterial({
|
|
27
|
-
color: "#0xaaaaaa",
|
|
28
|
-
metalness: 1.0,
|
|
29
|
-
roughness: 0.4
|
|
30
|
-
}),
|
|
31
|
-
darkgrey: new _three2.MeshStandardMaterial({
|
|
32
|
-
color: "#5e5e5e"
|
|
33
|
-
}),
|
|
34
|
-
grey: new _three2.MeshStandardMaterial({
|
|
35
|
-
color: "#cccccc"
|
|
36
|
-
}),
|
|
37
|
-
yellow: new _three2.MeshStandardMaterial({
|
|
38
|
-
color: "#ffff00"
|
|
39
|
-
}),
|
|
40
|
-
darkBrown: new _three2.MeshStandardMaterial({
|
|
41
|
-
color: "#a0522d"
|
|
42
|
-
}),
|
|
43
|
-
brown: new _three2.MeshStandardMaterial({
|
|
44
|
-
color: "#d2b48c"
|
|
45
|
-
}),
|
|
46
|
-
glass: new _three2.MeshStandardMaterial({
|
|
47
|
-
color: "#ffffff",
|
|
48
|
-
roughness: 0.1,
|
|
49
|
-
transparent: true,
|
|
50
|
-
opacity: 0.7
|
|
51
|
-
}),
|
|
52
|
-
aluminum: new _three2.MeshStandardMaterial({
|
|
53
|
-
color: "#dcdcdc",
|
|
54
|
-
metalness: 1.0,
|
|
55
|
-
roughness: 0.3
|
|
56
|
-
}),
|
|
57
|
-
silver: new _three2.MeshStandardMaterial({
|
|
58
|
-
color: "#c0c0c0",
|
|
59
|
-
metalness: 1.0,
|
|
60
|
-
roughness: 0.2
|
|
61
|
-
}),
|
|
62
|
-
gold: new _three2.MeshStandardMaterial({
|
|
63
|
-
color: "#ffd700",
|
|
64
|
-
metalness: 1.0,
|
|
65
|
-
roughness: 0.3
|
|
66
|
-
}),
|
|
67
|
-
diamond: new _three2.MeshStandardMaterial({
|
|
68
|
-
color: "#e0f7fa",
|
|
69
|
-
metalness: 0.9,
|
|
70
|
-
roughness: 0.05,
|
|
71
|
-
transparent: true,
|
|
72
|
-
opacity: 0.9,
|
|
73
|
-
envMapIntensity: 1.5
|
|
74
|
-
})
|
|
75
|
-
};
|
|
76
|
-
function GlassHinge(_ref) {
|
|
77
|
-
let {
|
|
78
|
-
position,
|
|
79
|
-
pivot,
|
|
80
|
-
frameSideWidth,
|
|
81
|
-
doorDepthM,
|
|
82
|
-
material,
|
|
83
|
-
gasketMaterial
|
|
84
|
-
} = _ref;
|
|
85
|
-
const plateWidth = 130 / 1000;
|
|
86
|
-
const plateHeight = 55 / 1000;
|
|
87
|
-
const plateThickness = 8 / 1000;
|
|
88
|
-
const gasketThickness = 1 / 1000;
|
|
89
|
-
const pivotRadius = 10 / 1000;
|
|
90
|
-
const pivotHeight = plateHeight;
|
|
91
|
-
const sideMultiplier = pivot === "left" ? 1 : -1;
|
|
92
|
-
const plateOffsetX = sideMultiplier * (plateWidth / 2 + frameSideWidth);
|
|
93
|
-
const holeRadius = 10 / 1000;
|
|
94
|
-
const holeSpacingX = 45 / 1000;
|
|
95
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
96
|
-
position: position,
|
|
97
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
98
|
-
material: material,
|
|
99
|
-
castShadow: true,
|
|
100
|
-
receiveShadow: true,
|
|
101
|
-
"position-x": 0.01,
|
|
102
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
103
|
-
args: [pivotRadius, pivotRadius, pivotHeight, 32]
|
|
104
|
-
})
|
|
105
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
106
|
-
"position-x": plateOffsetX,
|
|
107
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
108
|
-
"position-z": -(doorDepthM / 2) - plateThickness / 2 - gasketThickness,
|
|
109
|
-
material: material,
|
|
110
|
-
castShadow: true,
|
|
111
|
-
receiveShadow: true,
|
|
112
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
113
|
-
args: [plateWidth, plateHeight, plateThickness]
|
|
114
|
-
})
|
|
115
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
116
|
-
"position-z": -(doorDepthM / 2) - gasketThickness / 2,
|
|
117
|
-
material: gasketMaterial,
|
|
118
|
-
castShadow: true,
|
|
119
|
-
receiveShadow: true,
|
|
120
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
121
|
-
args: [plateWidth, plateHeight, gasketThickness]
|
|
122
|
-
})
|
|
123
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
124
|
-
"position-z": doorDepthM / 2 + plateThickness / 2 + gasketThickness,
|
|
125
|
-
castShadow: true,
|
|
126
|
-
receiveShadow: true,
|
|
127
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_csg.Geometry, {
|
|
128
|
-
useGroups: true,
|
|
129
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Base, {
|
|
130
|
-
material: material,
|
|
131
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
132
|
-
args: [plateWidth, plateHeight, plateThickness]
|
|
133
|
-
})
|
|
134
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
135
|
-
position: [-sideMultiplier * (holeSpacingX / 2), 0, 0],
|
|
136
|
-
rotation: [Math.PI / 2, 0, 0],
|
|
137
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
138
|
-
args: [holeRadius, holeRadius, plateThickness + 0.01, 32]
|
|
139
|
-
})
|
|
140
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
141
|
-
position: [sideMultiplier * (holeSpacingX / 2), 0, 0],
|
|
142
|
-
rotation: [Math.PI / 2, 0, 0],
|
|
143
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
144
|
-
args: [holeRadius, holeRadius, plateThickness + 0.01, 32]
|
|
145
|
-
})
|
|
146
|
-
})]
|
|
147
|
-
})
|
|
148
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
149
|
-
"position-z": doorDepthM / 2 + gasketThickness / 2,
|
|
150
|
-
material: gasketMaterial,
|
|
151
|
-
castShadow: true,
|
|
152
|
-
receiveShadow: true,
|
|
153
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
154
|
-
args: [plateWidth, plateHeight, gasketThickness]
|
|
155
|
-
})
|
|
156
|
-
})]
|
|
157
|
-
})]
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
function DoorStopCuts(_ref2) {
|
|
161
|
-
let {
|
|
162
|
-
visible,
|
|
163
|
-
width,
|
|
164
|
-
height,
|
|
165
|
-
stopWidth,
|
|
166
|
-
stopDepth,
|
|
167
|
-
stopPositionZ,
|
|
168
|
-
centerZ,
|
|
169
|
-
glassDepthOffset = 0,
|
|
170
|
-
material,
|
|
171
|
-
setName
|
|
172
|
-
} = _ref2;
|
|
173
|
-
if (!visible) return null;
|
|
174
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
175
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
176
|
-
name: "cut-top-".concat(setName),
|
|
177
|
-
material: material,
|
|
178
|
-
position: [0, height / 2 - stopWidth / 2 + 0.0001, stopPositionZ - centerZ],
|
|
179
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
180
|
-
args: [width + 0.01, stopWidth, stopDepth + 0.01]
|
|
181
|
-
})
|
|
182
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
183
|
-
name: "cut-left-".concat(setName),
|
|
184
|
-
material: material,
|
|
185
|
-
position: [-width / 2 + stopWidth / 2 - 0.0001, 0, stopPositionZ - centerZ],
|
|
186
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
187
|
-
args: [stopWidth, height + 0.01, stopDepth + 0.01]
|
|
188
|
-
})
|
|
189
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
190
|
-
name: "cut-right-".concat(setName),
|
|
191
|
-
material: material,
|
|
192
|
-
position: [width / 2 - stopWidth / 2 + 0.0001, 0, stopPositionZ - centerZ],
|
|
193
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
194
|
-
args: [stopWidth, height + 0.01, stopDepth + 0.01]
|
|
195
|
-
})
|
|
196
|
-
})]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
function DoorModels(_ref3) {
|
|
200
|
-
let {
|
|
201
|
-
doorName
|
|
202
|
-
} = _ref3;
|
|
203
|
-
const {
|
|
204
|
-
isPlaneVisible,
|
|
205
|
-
isFrameVisible,
|
|
206
|
-
door,
|
|
207
|
-
doorFrame,
|
|
208
|
-
interiorFanlight,
|
|
209
|
-
exteriorFanlight,
|
|
210
|
-
occulus,
|
|
211
|
-
glass,
|
|
212
|
-
frontCoverPanel,
|
|
213
|
-
backCoverPanel,
|
|
214
|
-
frameType,
|
|
215
|
-
bodyType,
|
|
216
|
-
exteriorFanlightType,
|
|
217
|
-
testDoorMaterial,
|
|
218
|
-
testFrameMaterial,
|
|
219
|
-
testGasketMaterial,
|
|
220
|
-
testInteriorFanlightMaterial,
|
|
221
|
-
testExteriorFanlightMaterial,
|
|
222
|
-
testOcculusInfillMaterial,
|
|
223
|
-
testGlassInfillMaterial,
|
|
224
|
-
testDoorStopMaterial,
|
|
225
|
-
testHingeMaterial,
|
|
226
|
-
glassVisible,
|
|
227
|
-
testFrontCoverPanelMaterial,
|
|
228
|
-
testBackCoverPanelMaterial,
|
|
229
|
-
glassDepth,
|
|
230
|
-
handleParseCpid
|
|
231
|
-
} = (0, _DoorContext.useConfigurator)();
|
|
232
|
-
(0, _react.useEffect)(() => {
|
|
233
|
-
if (doorName) {
|
|
234
|
-
handleParseCpid(doorName);
|
|
235
|
-
}
|
|
236
|
-
}, [doorName, handleParseCpid]);
|
|
237
|
-
|
|
238
|
-
// here i get material names from context
|
|
239
|
-
const {
|
|
240
|
-
doorMaterial: doorMaterialName
|
|
241
|
-
} = door;
|
|
242
|
-
const {
|
|
243
|
-
frameMaterial: frameMaterialName,
|
|
244
|
-
gasketMaterial: gasketMaterialName,
|
|
245
|
-
doorStopMaterial: doorStopMaterialName,
|
|
246
|
-
hingeMaterial: hingeMaterialName
|
|
247
|
-
} = doorFrame;
|
|
248
|
-
const {
|
|
249
|
-
material: interiorFanlightMaterialName
|
|
250
|
-
} = interiorFanlight;
|
|
251
|
-
const {
|
|
252
|
-
material: exteriorFanlightMaterialName
|
|
253
|
-
} = exteriorFanlight;
|
|
254
|
-
const {
|
|
255
|
-
material: occulusInfillMaterialName
|
|
256
|
-
} = occulus;
|
|
257
|
-
const {
|
|
258
|
-
material: glassInfillMaterialName
|
|
259
|
-
} = glass;
|
|
260
|
-
const {
|
|
261
|
-
material: frontCoverPanelMaterialName
|
|
262
|
-
} = frontCoverPanel;
|
|
263
|
-
const {
|
|
264
|
-
material: backCoverPanelMaterialName
|
|
265
|
-
} = backCoverPanel;
|
|
266
|
-
|
|
267
|
-
// --- Material Logic ---
|
|
268
|
-
const doorMaterial = (0, _react.useMemo)(() => availableMaterials[testDoorMaterial] || availableMaterials[doorMaterialName] || placeholderMaterial, [testDoorMaterial, doorMaterialName]);
|
|
269
|
-
const frameMaterial = (0, _react.useMemo)(() => availableMaterials[testFrameMaterial] || availableMaterials[frameMaterialName] || placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
|
|
270
|
-
const gasketMaterial = (0, _react.useMemo)(() => availableMaterials[testGasketMaterial] || availableMaterials[gasketMaterialName] || new _three2.MeshStandardMaterial({
|
|
271
|
-
color: "#111111"
|
|
272
|
-
}), [testGasketMaterial, gasketMaterialName]);
|
|
273
|
-
const doorStopMaterial = (0, _react.useMemo)(() => {
|
|
274
|
-
return availableMaterials[testDoorStopMaterial] || availableMaterials[doorStopMaterialName || ""] || frameMaterial;
|
|
275
|
-
}, [testDoorStopMaterial, doorStopMaterialName, frameType, frameMaterial]);
|
|
276
|
-
const interiorFanlightMaterial = (0, _react.useMemo)(() => availableMaterials[testInteriorFanlightMaterial] || availableMaterials[interiorFanlightMaterialName] || placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
|
|
277
|
-
const exteriorFanlightMaterial = (0, _react.useMemo)(() => availableMaterials[testExteriorFanlightMaterial] || availableMaterials[exteriorFanlightMaterialName] || placeholderMaterial, [testExteriorFanlightMaterial, exteriorFanlightMaterialName]);
|
|
278
|
-
const occulusInfillMaterial = (0, _react.useMemo)(() => availableMaterials[testOcculusInfillMaterial] || availableMaterials[occulusInfillMaterialName] || placeholderMaterial, [testOcculusInfillMaterial, occulusInfillMaterialName]);
|
|
279
|
-
const glassInfillMaterial = (0, _react.useMemo)(() => availableMaterials[testGlassInfillMaterial] || availableMaterials[glassInfillMaterialName] || placeholderMaterial, [testGlassInfillMaterial, glassInfillMaterialName]);
|
|
280
|
-
const hingeBodyMaterial = (0, _react.useMemo)(() => availableMaterials[testHingeMaterial] || availableMaterials[hingeMaterialName] || new _three2.MeshStandardMaterial({
|
|
281
|
-
color: "#d4d4d4",
|
|
282
|
-
metalness: 1.0,
|
|
283
|
-
roughness: 0.4
|
|
284
|
-
}), [testHingeMaterial, hingeMaterialName]);
|
|
285
|
-
const frontCoverPanelMaterial = (0, _react.useMemo)(() => availableMaterials[testFrontCoverPanelMaterial] || availableMaterials[frontCoverPanelMaterialName] || placeholderMaterial, [testFrontCoverPanelMaterial, frontCoverPanelMaterialName]);
|
|
286
|
-
const backCoverPanelMaterial = (0, _react.useMemo)(() => availableMaterials[testBackCoverPanelMaterial] || availableMaterials[backCoverPanelMaterialName] || placeholderMaterial, [testBackCoverPanelMaterial, backCoverPanelMaterialName]);
|
|
287
|
-
const hingeAccentMaterial = (0, _react.useMemo)(() => new _three2.MeshStandardMaterial({
|
|
288
|
-
color: "#1a1a1a",
|
|
289
|
-
roughness: 0.1
|
|
290
|
-
}), []);
|
|
291
|
-
|
|
292
|
-
// --- Dimension calculations ---
|
|
293
|
-
const {
|
|
294
|
-
doorWidth,
|
|
295
|
-
doorHeight,
|
|
296
|
-
theDoorDepth,
|
|
297
|
-
doorPivot,
|
|
298
|
-
doorOpening
|
|
299
|
-
} = door;
|
|
300
|
-
const {
|
|
301
|
-
frameDepth,
|
|
302
|
-
topThk,
|
|
303
|
-
sidesThk,
|
|
304
|
-
doorStopWidth,
|
|
305
|
-
doorStopDepth,
|
|
306
|
-
doorStopOffset,
|
|
307
|
-
notchWidth,
|
|
308
|
-
notchDepth,
|
|
309
|
-
notchposition,
|
|
310
|
-
gasketWidth,
|
|
311
|
-
gasketDepth,
|
|
312
|
-
secondDoorStopWidth,
|
|
313
|
-
secondDoorStopDepth,
|
|
314
|
-
secondDoorStopOffset
|
|
315
|
-
} = doorFrame;
|
|
316
|
-
const {
|
|
317
|
-
height: interiorFanlightHeightValue
|
|
318
|
-
} = interiorFanlight;
|
|
319
|
-
const {
|
|
320
|
-
height: exteriorFanlightHeightValue,
|
|
321
|
-
depth: exteriorFanlightDepthValue
|
|
322
|
-
} = exteriorFanlight;
|
|
323
|
-
const {
|
|
324
|
-
x1: occulusX1,
|
|
325
|
-
x2: occulusX2,
|
|
326
|
-
y1: occulusY1,
|
|
327
|
-
y2: occulusY2,
|
|
328
|
-
depth: occulusInfillDepth
|
|
329
|
-
} = occulus;
|
|
330
|
-
const {
|
|
331
|
-
width: architraveWidth,
|
|
332
|
-
depth: architraveDepth
|
|
333
|
-
} = frontCoverPanel;
|
|
334
|
-
const interiorFanlightHeight = interiorFanlight.visible ? interiorFanlightHeightValue : 0;
|
|
335
|
-
const mainDoorHeight = doorHeight - interiorFanlightHeight;
|
|
336
|
-
const topThkValue = parseInt(topThk) || 20;
|
|
337
|
-
const sidesThkValue = parseInt(sidesThk) || 20;
|
|
338
|
-
|
|
339
|
-
// Convert dimensions from mm to meters
|
|
340
|
-
const doorWidthM = doorWidth / 1000;
|
|
341
|
-
const mainDoorHeightM = mainDoorHeight / 1000;
|
|
342
|
-
const interiorFanlightHeightM = interiorFanlightHeight / 1000;
|
|
343
|
-
const totalOpeningHeightM = doorHeight / 1000;
|
|
344
|
-
const doorDepthM = theDoorDepth / 1000;
|
|
345
|
-
const frameDepthM = frameDepth / 1000;
|
|
346
|
-
const topFrameWidthM = topThkValue / 1000;
|
|
347
|
-
const sidesFrameWidthM = sidesThkValue / 1000;
|
|
348
|
-
const exteriorFanlightHeightM = exteriorFanlightHeightValue / 1000;
|
|
349
|
-
const exteriorFanlightDepthM = exteriorFanlightDepthValue / 1000;
|
|
350
|
-
const occulusX1M = occulusX1 / 1000;
|
|
351
|
-
const occulusX2M = occulusX2 / 1000;
|
|
352
|
-
const occulusY1M = occulusY1 / 1000;
|
|
353
|
-
const occulusY2M = occulusY2 / 1000;
|
|
354
|
-
const occulusInfillDepthM = occulusInfillDepth / 1000;
|
|
355
|
-
const doorStopWidthM = doorStopWidth / 1000;
|
|
356
|
-
const doorStopDepthM = doorStopDepth / 1000;
|
|
357
|
-
|
|
358
|
-
// Architrave Dimensions
|
|
359
|
-
const architraveProfileM = architraveWidth / 1000;
|
|
360
|
-
const architraveDepthM = architraveDepth / 1000;
|
|
361
|
-
|
|
362
|
-
// Gasket Dimensions
|
|
363
|
-
const gasketWidthM = gasketWidth / 1000;
|
|
364
|
-
const gasketDepthM = gasketDepth / 1000;
|
|
365
|
-
const doorStopOffsetValue = parseInt(doorStopOffset);
|
|
366
|
-
const doorStopOffsetFromEdgeM = doorStopOffsetValue / 1000;
|
|
367
|
-
const notchDepthValue = parseInt(notchDepth) || 40;
|
|
368
|
-
const notchWidthValue = parseInt(notchWidth) || 20;
|
|
369
|
-
const notchWidthM = notchWidthValue / 1000;
|
|
370
|
-
const notchDepthM = notchDepthValue / 1000;
|
|
371
|
-
const isOpeningIn = doorOpening === "in";
|
|
372
|
-
const doorStopPositionZ = (0, _react.useMemo)(() => isOpeningIn ? frameDepthM / 2 - doorStopOffsetFromEdgeM - doorStopDepthM / 2 : -frameDepthM / 2 + doorStopOffsetFromEdgeM + doorStopDepthM / 2, [isOpeningIn, frameDepthM, doorStopOffsetFromEdgeM, doorStopDepthM]);
|
|
373
|
-
const gasketZPosition = (0, _react.useMemo)(() => isOpeningIn ? doorStopPositionZ - doorStopDepthM / 2 - gasketDepthM / 2 : doorStopPositionZ + doorStopDepthM / 2 + gasketDepthM / 2, [isOpeningIn, doorStopPositionZ, doorStopDepthM, gasketDepthM]);
|
|
374
|
-
const secondDoorStopWidthM = secondDoorStopWidth / 1000;
|
|
375
|
-
const secondDoorStopDepthM = secondDoorStopDepth / 1000;
|
|
376
|
-
const secondDoorStopPositionZ = isOpeningIn ? frameDepthM / 2 - secondDoorStopDepthM / 2 : -frameDepthM / 2 + secondDoorStopDepthM / 2;
|
|
377
|
-
|
|
378
|
-
// Position the first glass panel against the primary doorstop
|
|
379
|
-
|
|
380
|
-
const secondGasketZPosition = isOpeningIn ? secondDoorStopPositionZ - secondDoorStopDepthM / 2 - gasketDepthM / 2 : secondDoorStopPositionZ + secondDoorStopDepthM / 2 + gasketDepthM / 2;
|
|
381
|
-
const doorCenterZ = (0, _react.useMemo)(() => {
|
|
382
|
-
if (frameType === "WF_FLI") {
|
|
383
|
-
if (isOpeningIn) {
|
|
384
|
-
return frameDepthM / 2 - doorDepthM / 2;
|
|
385
|
-
} else {
|
|
386
|
-
return -frameDepthM / 2 + doorDepthM / 2;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
if (frameType === "WDGF_WDG100" || frameType === "WF_100") {
|
|
390
|
-
return 0;
|
|
391
|
-
} else {
|
|
392
|
-
if (isOpeningIn) {
|
|
393
|
-
const gasketBackFaceZ = gasketZPosition - gasketDepthM / 2;
|
|
394
|
-
return gasketBackFaceZ - doorDepthM / 2;
|
|
395
|
-
} else {
|
|
396
|
-
const gasketFrontFaceZ = gasketZPosition + gasketDepthM / 2;
|
|
397
|
-
return gasketFrontFaceZ + doorDepthM / 2;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}, [isOpeningIn, gasketZPosition, gasketDepthM, doorDepthM, frameType, frameDepthM]);
|
|
401
|
-
const GlassPanelDepthM = glassDepth / 1000;
|
|
402
|
-
const frontGlassOffsetZ = doorDepthM / 2 + GlassPanelDepthM / 2;
|
|
403
|
-
const backGlassOffsetZ = -doorDepthM / 2 - GlassPanelDepthM / 2;
|
|
404
|
-
|
|
405
|
-
// --- Door Stop Positions on Door ---
|
|
406
|
-
const doorStopOffsetOnDoor = frameType === "WDGF_WDG100" ? secondDoorStopWidthM / 2 : doorStopDepthM / 2;
|
|
407
|
-
const exteriorFanlightZPosition = exteriorFanlightType === "ALSGFL" ? 0 // Center it
|
|
408
|
-
: isOpeningIn ? -frameDepthM / 2 + exteriorFanlightDepthM / 2 : frameDepthM / 2 - exteriorFanlightDepthM / 2;
|
|
409
|
-
const occulusWidthM = doorWidthM - occulusX1M - occulusX2M;
|
|
410
|
-
const occulusHeightM = mainDoorHeightM - occulusY1M - occulusY2M;
|
|
411
|
-
const occulusPositionXM = (occulusX1M - occulusX2M) / 2;
|
|
412
|
-
const occulusPositionYM = (occulusY2M - occulusY1M) / 2;
|
|
413
|
-
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
414
|
-
const hingeSideX = doorPivot === "left" ? -doorWidthM / 2 : doorWidthM / 2;
|
|
415
|
-
const leftGlass_Z = -frameDepthM / 2 + GlassPanelDepthM / 2 - GlassPanelDepthM;
|
|
416
|
-
const rightGlass_Z = frameDepthM / 2 - GlassPanelDepthM / 2 + GlassPanelDepthM;
|
|
417
|
-
// --- PIVOT ---
|
|
418
|
-
const hingeZ = (0, _react.useMemo)(() => {
|
|
419
|
-
if (frameType === "WF_FLI") {
|
|
420
|
-
if (isOpeningIn) {
|
|
421
|
-
return doorCenterZ - doorDepthM / 2;
|
|
422
|
-
} else {
|
|
423
|
-
return doorCenterZ + doorDepthM / 2;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return isOpeningIn ? -frameDepthM / 2 : frameDepthM / 2;
|
|
427
|
-
}, [frameType, isOpeningIn, doorCenterZ, doorDepthM, frameDepthM]);
|
|
428
|
-
const doorOffsetZ = (0, _react.useMemo)(() => doorCenterZ - hingeZ, [doorCenterZ, hingeZ]);
|
|
429
|
-
const directionMultiplier = doorOpening === "in" ? 1 : -1;
|
|
430
|
-
const {
|
|
431
|
-
rotation
|
|
432
|
-
} = (0, _three.useSpring)({
|
|
433
|
-
rotation: isOpen ? [0, (doorPivot === "left" ? Math.PI / 2 : -Math.PI / 2) * directionMultiplier, 0] : [0, 0, 0],
|
|
434
|
-
config: {
|
|
435
|
-
mass: 1,
|
|
436
|
-
tension: 100,
|
|
437
|
-
friction: 20
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
const handleClick = () => setIsOpen(!isOpen);
|
|
441
|
-
const totalFrameWidth = doorWidthM + sidesFrameWidthM * 2;
|
|
442
|
-
const totalFrameHeightM = totalOpeningHeightM + topFrameWidthM;
|
|
443
|
-
const sideFrameCenterY = topFrameWidthM / 2;
|
|
444
|
-
const interiorFanlightYPosition = totalOpeningHeightM / 2 - interiorFanlightHeightM / 2;
|
|
445
|
-
const doorYPosition = -totalOpeningHeightM / 2 + mainDoorHeightM / 2;
|
|
446
|
-
const topFrameCenterY = totalOpeningHeightM / 2 + topFrameWidthM / 2;
|
|
447
|
-
const topOfFrameY = topFrameCenterY + topFrameWidthM / 2;
|
|
448
|
-
const exteriorFanlightYPosition = topOfFrameY + exteriorFanlightHeightM / 2;
|
|
449
|
-
const frontArchitraveZ = frameDepthM / 2 + architraveDepthM / 2;
|
|
450
|
-
const backArchitraveZ = -frameDepthM / 2 - architraveDepthM / 2;
|
|
451
|
-
const sideArchitraveHeight = totalOpeningHeightM;
|
|
452
|
-
const sideArchitraveCenterY = 0;
|
|
453
|
-
const leftArchitraveX = -doorWidthM / 2 - architraveProfileM / 2;
|
|
454
|
-
const rightArchitraveX = doorWidthM / 2 + architraveProfileM / 2;
|
|
455
|
-
const topArchitraveY = totalOpeningHeightM / 2 + architraveProfileM / 2;
|
|
456
|
-
const topArchitraveWidth = doorWidthM + 2 * architraveProfileM;
|
|
457
|
-
|
|
458
|
-
// --- Primary Gasket Edge Position Calculations ---
|
|
459
|
-
const topGasketYPosition = totalOpeningHeightM / 2 - doorStopWidthM + gasketWidthM / 2;
|
|
460
|
-
const leftGasketXPosition = -doorWidthM / 2 + doorStopWidthM - gasketWidthM / 2;
|
|
461
|
-
const rightGasketXPosition = doorWidthM / 2 - doorStopWidthM + gasketWidthM / 2;
|
|
462
|
-
|
|
463
|
-
// --- Second Gasket ---
|
|
464
|
-
|
|
465
|
-
const secondTopGasketYPosition = totalOpeningHeightM / 2 - secondDoorStopWidthM + gasketWidthM / 2;
|
|
466
|
-
const secondLeftGasketXPosition = -doorWidthM / 2 + secondDoorStopWidthM - gasketWidthM / 2;
|
|
467
|
-
const secondRightGasketXPosition = doorWidthM / 2 - secondDoorStopWidthM + gasketWidthM / 2;
|
|
468
|
-
// --- HINGE CALCULATIONS ---
|
|
469
|
-
const hingeTotalHeightM = 120 / 1000;
|
|
470
|
-
const hingeRadiusM = 8 / 1000;
|
|
471
|
-
const capHeightM = 4 / 1000;
|
|
472
|
-
const separatorHeightM = 4 / 1000;
|
|
473
|
-
const barrelPartHeight = (hingeTotalHeightM - capHeightM * 2 - separatorHeightM) / 2;
|
|
474
|
-
|
|
475
|
-
// --- HINGE VISIBILITY LOGIC ---
|
|
476
|
-
const isGlassDoor = (0, _react.useMemo)(() => ["SG8", "SG10", "SG12"].includes(bodyType), [bodyType]);
|
|
477
|
-
|
|
478
|
-
// Calculate evenly spaced hinge positions
|
|
479
|
-
const standardHingeYPositions = (0, _react.useMemo)(() => {
|
|
480
|
-
const numHinges = 4;
|
|
481
|
-
const topMargin = 180 / 1000;
|
|
482
|
-
const bottomMargin = 180 / 1000;
|
|
483
|
-
const availableHeight = mainDoorHeightM - topMargin - bottomMargin;
|
|
484
|
-
const spacing = availableHeight / (numHinges - 1);
|
|
485
|
-
const positions = [];
|
|
486
|
-
for (let i = 0; i < numHinges; i++) {
|
|
487
|
-
positions.push(mainDoorHeightM / 2 - topMargin - i * spacing);
|
|
488
|
-
}
|
|
489
|
-
return positions;
|
|
490
|
-
}, [mainDoorHeightM]);
|
|
491
|
-
|
|
492
|
-
// Y positions for the new glass hinges
|
|
493
|
-
const glassHingeYPositions = (0, _react.useMemo)(() => {
|
|
494
|
-
const topMargin = 250 / 1000;
|
|
495
|
-
const secondTopMargin = 450 / 1000;
|
|
496
|
-
const bottomMargin = 250 / 1000;
|
|
497
|
-
const top = mainDoorHeightM / 2 - topMargin;
|
|
498
|
-
const secondTop = mainDoorHeightM / 2 - secondTopMargin;
|
|
499
|
-
const bottom = -mainDoorHeightM / 2 + bottomMargin;
|
|
500
|
-
return [top, secondTop, bottom];
|
|
501
|
-
}, [mainDoorHeightM]);
|
|
502
|
-
const isStandardHingeVisible = (0, _react.useMemo)(() => {
|
|
503
|
-
if (isGlassDoor) return false;
|
|
504
|
-
if (!isFrameVisible) return false;
|
|
505
|
-
const invisibleFrameTypes = ["WDGF_WDG100", "WF_100", "WF_FLI"];
|
|
506
|
-
if (invisibleFrameTypes.includes(frameType)) {
|
|
507
|
-
return false;
|
|
508
|
-
}
|
|
509
|
-
return true;
|
|
510
|
-
}, [isFrameVisible, frameType, isGlassDoor]);
|
|
511
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
512
|
-
children: [frontCoverPanel.visible && /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
513
|
-
"position-z": frontArchitraveZ,
|
|
514
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
515
|
-
position: [0, topArchitraveY, 0],
|
|
516
|
-
castShadow: true,
|
|
517
|
-
material: frontCoverPanelMaterial,
|
|
518
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
519
|
-
args: [topArchitraveWidth, architraveProfileM, architraveDepthM]
|
|
520
|
-
})
|
|
521
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
522
|
-
position: [leftArchitraveX, sideArchitraveCenterY, 0],
|
|
523
|
-
castShadow: true,
|
|
524
|
-
material: frontCoverPanelMaterial,
|
|
525
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
526
|
-
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
527
|
-
})
|
|
528
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
529
|
-
position: [rightArchitraveX, sideArchitraveCenterY, 0],
|
|
530
|
-
castShadow: true,
|
|
531
|
-
material: frontCoverPanelMaterial,
|
|
532
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
533
|
-
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
534
|
-
})
|
|
535
|
-
})]
|
|
536
|
-
}), backCoverPanel.visible && /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
537
|
-
"position-z": backArchitraveZ,
|
|
538
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
539
|
-
position: [0, topArchitraveY, 0],
|
|
540
|
-
castShadow: true,
|
|
541
|
-
material: backCoverPanelMaterial,
|
|
542
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
543
|
-
args: [topArchitraveWidth, architraveProfileM, architraveDepthM]
|
|
544
|
-
})
|
|
545
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
546
|
-
position: [leftArchitraveX, sideArchitraveCenterY, 0],
|
|
547
|
-
castShadow: true,
|
|
548
|
-
material: backCoverPanelMaterial,
|
|
549
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
550
|
-
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
551
|
-
})
|
|
552
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
553
|
-
position: [rightArchitraveX, sideArchitraveCenterY, 0],
|
|
554
|
-
castShadow: true,
|
|
555
|
-
material: backCoverPanelMaterial,
|
|
556
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
557
|
-
args: [architraveProfileM, sideArchitraveHeight, architraveDepthM]
|
|
558
|
-
})
|
|
559
|
-
})]
|
|
560
|
-
}), exteriorFanlight.visible && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
561
|
-
position: [0, exteriorFanlightYPosition, exteriorFanlightZPosition],
|
|
562
|
-
castShadow: true,
|
|
563
|
-
material: exteriorFanlightMaterial,
|
|
564
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
565
|
-
args: [totalFrameWidth, exteriorFanlightHeightM, exteriorFanlightDepthM]
|
|
566
|
-
})
|
|
567
|
-
}), isFrameVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
568
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
569
|
-
castShadow: true,
|
|
570
|
-
position: [0, topFrameCenterY, 0],
|
|
571
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_csg.Geometry, {
|
|
572
|
-
useGroups: true,
|
|
573
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Base, {
|
|
574
|
-
name: "frame-base",
|
|
575
|
-
material: frameMaterial,
|
|
576
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
577
|
-
args: [doorWidthM, topFrameWidthM, frameDepthM]
|
|
578
|
-
})
|
|
579
|
-
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
580
|
-
name: "cut-exterior",
|
|
581
|
-
material: frameMaterial,
|
|
582
|
-
position: [0, notchposition, 0],
|
|
583
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
584
|
-
args: [doorWidthM + 0.01, notchWidthM, notchDepthM]
|
|
585
|
-
})
|
|
586
|
-
})]
|
|
587
|
-
})
|
|
588
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
589
|
-
castShadow: true,
|
|
590
|
-
position: [-doorWidthM / 2 - sidesFrameWidthM / 2, sideFrameCenterY, 0],
|
|
591
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_csg.Geometry, {
|
|
592
|
-
useGroups: true,
|
|
593
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Base, {
|
|
594
|
-
name: "frame-base",
|
|
595
|
-
material: frameMaterial,
|
|
596
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
597
|
-
args: [sidesFrameWidthM, totalFrameHeightM, frameDepthM]
|
|
598
|
-
})
|
|
599
|
-
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
600
|
-
name: "cut-exterior",
|
|
601
|
-
material: frameMaterial,
|
|
602
|
-
position: [-notchposition, 0, 0],
|
|
603
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
604
|
-
args: [notchWidthM, totalFrameHeightM + 0.01, notchDepthM]
|
|
605
|
-
})
|
|
606
|
-
})]
|
|
607
|
-
})
|
|
608
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
609
|
-
castShadow: true,
|
|
610
|
-
position: [doorWidthM / 2 + sidesFrameWidthM / 2, sideFrameCenterY, 0],
|
|
611
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_csg.Geometry, {
|
|
612
|
-
useGroups: true,
|
|
613
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Base, {
|
|
614
|
-
name: "frame-base",
|
|
615
|
-
material: frameMaterial,
|
|
616
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
617
|
-
args: [sidesFrameWidthM, totalFrameHeightM, frameDepthM]
|
|
618
|
-
})
|
|
619
|
-
}), !["MXF_40", "MXF_50", "MXCAF_40", "MXCAF_50"].includes(frameType) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
620
|
-
name: "cut-exterior",
|
|
621
|
-
material: frameMaterial,
|
|
622
|
-
position: [notchposition, 0, 0],
|
|
623
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
624
|
-
args: [notchWidthM, totalFrameHeightM + 0.01, notchDepthM]
|
|
625
|
-
})
|
|
626
|
-
})]
|
|
627
|
-
})
|
|
628
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
629
|
-
castShadow: true,
|
|
630
|
-
position: [0, totalOpeningHeightM / 2 - doorStopWidthM / 2, doorStopPositionZ],
|
|
631
|
-
material: doorStopMaterial,
|
|
632
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
633
|
-
args: [doorWidthM, doorStopWidthM, doorStopDepthM]
|
|
634
|
-
})
|
|
635
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
636
|
-
castShadow: true,
|
|
637
|
-
position: [-doorWidthM / 2 + doorStopWidthM / 2, 0, doorStopPositionZ],
|
|
638
|
-
material: doorStopMaterial,
|
|
639
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
640
|
-
args: [doorStopWidthM, totalOpeningHeightM, doorStopDepthM]
|
|
641
|
-
})
|
|
642
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
643
|
-
castShadow: true,
|
|
644
|
-
position: [doorWidthM / 2 - doorStopWidthM / 2, 0, doorStopPositionZ],
|
|
645
|
-
material: doorStopMaterial,
|
|
646
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
647
|
-
args: [doorStopWidthM, totalOpeningHeightM, doorStopDepthM]
|
|
648
|
-
})
|
|
649
|
-
}), frameType !== "WF_FLI" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
650
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
651
|
-
castShadow: true,
|
|
652
|
-
position: [0, topGasketYPosition, gasketZPosition],
|
|
653
|
-
material: gasketMaterial,
|
|
654
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
655
|
-
args: [doorWidthM - 0.03, gasketWidthM + 0.005, gasketDepthM]
|
|
656
|
-
})
|
|
657
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
658
|
-
castShadow: true,
|
|
659
|
-
position: [leftGasketXPosition - 0.005, -0.005, gasketZPosition],
|
|
660
|
-
material: gasketMaterial,
|
|
661
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
662
|
-
args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.02, gasketDepthM]
|
|
663
|
-
})
|
|
664
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
665
|
-
castShadow: true,
|
|
666
|
-
position: [rightGasketXPosition + 0.005, -0.005, gasketZPosition],
|
|
667
|
-
material: gasketMaterial,
|
|
668
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
669
|
-
args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.02, gasketDepthM]
|
|
670
|
-
})
|
|
671
|
-
})]
|
|
672
|
-
}), (frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI") && /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
673
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
674
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
675
|
-
castShadow: true,
|
|
676
|
-
position: [0, totalOpeningHeightM / 2 - secondDoorStopWidthM / 2, secondDoorStopPositionZ],
|
|
677
|
-
material: doorStopMaterial,
|
|
678
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
679
|
-
args: [doorWidthM, secondDoorStopWidthM, secondDoorStopDepthM]
|
|
680
|
-
})
|
|
681
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
682
|
-
castShadow: true,
|
|
683
|
-
position: [-doorWidthM / 2 + secondDoorStopWidthM / 2, 0, secondDoorStopPositionZ],
|
|
684
|
-
material: doorStopMaterial,
|
|
685
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
686
|
-
args: [secondDoorStopWidthM, totalOpeningHeightM, secondDoorStopDepthM]
|
|
687
|
-
})
|
|
688
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
689
|
-
castShadow: true,
|
|
690
|
-
position: [doorWidthM / 2 - secondDoorStopWidthM / 2, 0, secondDoorStopPositionZ],
|
|
691
|
-
material: doorStopMaterial,
|
|
692
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
693
|
-
args: [secondDoorStopWidthM, totalOpeningHeightM, secondDoorStopDepthM]
|
|
694
|
-
})
|
|
695
|
-
})]
|
|
696
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
697
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
698
|
-
castShadow: true,
|
|
699
|
-
position: [0, secondTopGasketYPosition - 0.005, secondGasketZPosition],
|
|
700
|
-
material: gasketMaterial,
|
|
701
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
702
|
-
args: [doorWidthM - 0.03, gasketWidthM + 0.005, gasketDepthM]
|
|
703
|
-
})
|
|
704
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
705
|
-
castShadow: true,
|
|
706
|
-
position: [secondLeftGasketXPosition - 0.005, -0.01, secondGasketZPosition],
|
|
707
|
-
material: gasketMaterial,
|
|
708
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
709
|
-
args: [gasketWidthM + 0.005, totalOpeningHeightM - 0.04, gasketDepthM]
|
|
710
|
-
})
|
|
711
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
712
|
-
castShadow: true,
|
|
713
|
-
position: [secondRightGasketXPosition + 0.005, -0.01, secondGasketZPosition],
|
|
714
|
-
material: gasketMaterial,
|
|
715
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
716
|
-
args: [gasketWidthM + 0.004, totalOpeningHeightM - 0.04, gasketDepthM]
|
|
717
|
-
})
|
|
718
|
-
})]
|
|
719
|
-
}), glassVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
720
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
721
|
-
children: [(frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
722
|
-
castShadow: true,
|
|
723
|
-
position: [0, topFrameCenterY - secondDoorStopWidthM / 2, leftGlass_Z],
|
|
724
|
-
material: glassInfillMaterial,
|
|
725
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
726
|
-
args: [doorWidthM - 2 * secondDoorStopWidthM, topFrameWidthM + secondDoorStopWidthM, GlassPanelDepthM]
|
|
727
|
-
})
|
|
728
|
-
}), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
729
|
-
castShadow: true,
|
|
730
|
-
position: [0, topFrameCenterY, leftGlass_Z],
|
|
731
|
-
material: glassInfillMaterial,
|
|
732
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
733
|
-
args: [doorWidthM - 2 * secondDoorStopWidthM, topFrameWidthM, GlassPanelDepthM]
|
|
734
|
-
})
|
|
735
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
736
|
-
castShadow: true,
|
|
737
|
-
position: [-doorWidthM / 2 - sidesFrameWidthM / 2 + secondDoorStopWidthM / 2, sideFrameCenterY, leftGlass_Z],
|
|
738
|
-
material: glassInfillMaterial,
|
|
739
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
740
|
-
args: [sidesFrameWidthM + secondDoorStopWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
741
|
-
})
|
|
742
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
743
|
-
castShadow: true,
|
|
744
|
-
position: [doorWidthM / 2 + sidesFrameWidthM / 2 - secondDoorStopWidthM / 2, sideFrameCenterY, leftGlass_Z],
|
|
745
|
-
material: glassInfillMaterial,
|
|
746
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
747
|
-
args: [sidesFrameWidthM + secondDoorStopWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
748
|
-
})
|
|
749
|
-
})]
|
|
750
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
751
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
752
|
-
castShadow: true,
|
|
753
|
-
position: [0, topFrameCenterY, rightGlass_Z],
|
|
754
|
-
material: glassInfillMaterial,
|
|
755
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
756
|
-
args: [doorWidthM, topFrameWidthM, GlassPanelDepthM]
|
|
757
|
-
})
|
|
758
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
759
|
-
castShadow: true,
|
|
760
|
-
position: [-doorWidthM / 2 - sidesFrameWidthM / 2, sideFrameCenterY, rightGlass_Z],
|
|
761
|
-
material: glassInfillMaterial,
|
|
762
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
763
|
-
args: [sidesFrameWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
764
|
-
})
|
|
765
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
766
|
-
castShadow: true,
|
|
767
|
-
position: [doorWidthM / 2 + sidesFrameWidthM / 2, sideFrameCenterY, rightGlass_Z],
|
|
768
|
-
material: glassInfillMaterial,
|
|
769
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
770
|
-
args: [sidesFrameWidthM, totalFrameHeightM, GlassPanelDepthM]
|
|
771
|
-
})
|
|
772
|
-
})]
|
|
773
|
-
})]
|
|
774
|
-
})]
|
|
775
|
-
})]
|
|
776
|
-
}), interiorFanlight.visible && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
777
|
-
position: [0, interiorFanlightYPosition, doorCenterZ],
|
|
778
|
-
castShadow: true,
|
|
779
|
-
material: interiorFanlightMaterial,
|
|
780
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
781
|
-
args: [doorWidthM, interiorFanlightHeightM, doorDepthM]
|
|
782
|
-
})
|
|
783
|
-
}), isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
784
|
-
position: [hingeSideX, doorYPosition + y, hingeZ],
|
|
785
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
786
|
-
material: hingeBodyMaterial,
|
|
787
|
-
position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
|
|
788
|
-
castShadow: true,
|
|
789
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
790
|
-
args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
|
|
791
|
-
})
|
|
792
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
793
|
-
material: hingeAccentMaterial,
|
|
794
|
-
position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
|
|
795
|
-
castShadow: true,
|
|
796
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
797
|
-
args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
|
|
798
|
-
})
|
|
799
|
-
})]
|
|
800
|
-
}, "frame-hinge-".concat(index))), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_three.a.group, {
|
|
801
|
-
position: [hingeSideX, doorYPosition, hingeZ],
|
|
802
|
-
rotation: rotation.to((x, y, z) => [x, y, z]),
|
|
803
|
-
onClick: handleClick,
|
|
804
|
-
onPointerOver: () => document.body.style.cursor = "pointer",
|
|
805
|
-
onPointerOut: () => document.body.style.cursor = "auto",
|
|
806
|
-
children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
807
|
-
position: [0, y, 0],
|
|
808
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
809
|
-
material: hingeBodyMaterial,
|
|
810
|
-
position: [0, -separatorHeightM / 2 - barrelPartHeight / 2, 0],
|
|
811
|
-
castShadow: true,
|
|
812
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
813
|
-
args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
|
|
814
|
-
})
|
|
815
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
816
|
-
material: hingeAccentMaterial,
|
|
817
|
-
position: [0, -separatorHeightM / 2 - barrelPartHeight - capHeightM / 2, 0],
|
|
818
|
-
castShadow: true,
|
|
819
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
820
|
-
args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
|
|
821
|
-
})
|
|
822
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
823
|
-
material: hingeAccentMaterial,
|
|
824
|
-
position: [0, 0, 0],
|
|
825
|
-
castShadow: true,
|
|
826
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("cylinderGeometry", {
|
|
827
|
-
args: [hingeRadiusM, hingeRadiusM, separatorHeightM, 32]
|
|
828
|
-
})
|
|
829
|
-
})]
|
|
830
|
-
}, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(GlassHinge, {
|
|
831
|
-
position: [0, y, doorOffsetZ],
|
|
832
|
-
pivot: doorPivot,
|
|
833
|
-
frameSideWidth: sidesFrameWidthM,
|
|
834
|
-
doorDepthM: doorDepthM,
|
|
835
|
-
material: hingeBodyMaterial,
|
|
836
|
-
gasketMaterial: gasketMaterial
|
|
837
|
-
}, "glass-hinge-".concat(index))), /*#__PURE__*/(0, _jsxRuntime.jsxs)("group", {
|
|
838
|
-
position: [-hingeSideX, 0, doorOffsetZ],
|
|
839
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
840
|
-
castShadow: true,
|
|
841
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_csg.Geometry, {
|
|
842
|
-
useGroups: true,
|
|
843
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Base, {
|
|
844
|
-
name: "door-base",
|
|
845
|
-
material: doorMaterial,
|
|
846
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
847
|
-
args: [doorWidthM, mainDoorHeightM, doorDepthM]
|
|
848
|
-
})
|
|
849
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(DoorStopCuts, {
|
|
850
|
-
visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
|
|
851
|
-
width: doorWidthM,
|
|
852
|
-
height: totalOpeningHeightM,
|
|
853
|
-
stopWidth: doorStopWidthM,
|
|
854
|
-
stopDepth: doorStopDepthM,
|
|
855
|
-
stopPositionZ: doorStopPositionZ,
|
|
856
|
-
centerZ: doorCenterZ,
|
|
857
|
-
glassDepthOffset: GlassPanelDepthM / 2,
|
|
858
|
-
material: doorMaterial,
|
|
859
|
-
setName: "1"
|
|
860
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(DoorStopCuts, {
|
|
861
|
-
visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
|
|
862
|
-
width: doorWidthM,
|
|
863
|
-
height: totalOpeningHeightM,
|
|
864
|
-
stopWidth: secondDoorStopWidthM,
|
|
865
|
-
stopDepth: secondDoorStopDepthM,
|
|
866
|
-
stopPositionZ: secondDoorStopPositionZ,
|
|
867
|
-
centerZ: doorCenterZ,
|
|
868
|
-
glassDepthOffset: GlassPanelDepthM / 2,
|
|
869
|
-
material: doorMaterial,
|
|
870
|
-
setName: "2"
|
|
871
|
-
}), glassVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
872
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
873
|
-
position: [0, 0, frontGlassOffsetZ],
|
|
874
|
-
castShadow: true,
|
|
875
|
-
material: glassInfillMaterial,
|
|
876
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
877
|
-
args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
|
|
878
|
-
})
|
|
879
|
-
}), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
880
|
-
position: [0, 0, backGlassOffsetZ],
|
|
881
|
-
castShadow: true,
|
|
882
|
-
material: glassInfillMaterial,
|
|
883
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
884
|
-
args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
|
|
885
|
-
})
|
|
886
|
-
}), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
887
|
-
position: [0, -secondDoorStopWidthM / 2, backGlassOffsetZ],
|
|
888
|
-
castShadow: true,
|
|
889
|
-
material: glassInfillMaterial,
|
|
890
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
891
|
-
args: [doorWidthM - 2 * secondDoorStopWidthM, mainDoorHeightM - secondDoorStopWidthM, GlassPanelDepthM]
|
|
892
|
-
})
|
|
893
|
-
})]
|
|
894
|
-
}), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_csg.Subtraction, {
|
|
895
|
-
material: placeholderMaterial,
|
|
896
|
-
position: [occulusPositionXM, occulusPositionYM, 0],
|
|
897
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
898
|
-
args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
|
|
899
|
-
})
|
|
900
|
-
})]
|
|
901
|
-
})
|
|
902
|
-
}), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("mesh", {
|
|
903
|
-
position: [occulusPositionXM, occulusPositionYM, 0],
|
|
904
|
-
castShadow: true,
|
|
905
|
-
material: occulusInfillMaterial,
|
|
906
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("boxGeometry", {
|
|
907
|
-
args: [occulusWidthM, occulusHeightM, occulusInfillDepthM]
|
|
908
|
-
})
|
|
909
|
-
})]
|
|
910
|
-
})]
|
|
911
|
-
}), isPlaneVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)("mesh", {
|
|
912
|
-
receiveShadow: true,
|
|
913
|
-
rotation: [-Math.PI / 2, 0, 0],
|
|
914
|
-
position: [0, -totalOpeningHeightM / 2 - 0.01, 0],
|
|
915
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("planeGeometry", {
|
|
916
|
-
args: [10, 10]
|
|
917
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("meshStandardMaterial", {
|
|
918
|
-
color: "#f9f9f9",
|
|
919
|
-
side: _three2.DoubleSide
|
|
920
|
-
})]
|
|
921
|
-
})]
|
|
922
|
-
});
|
|
923
|
-
}
|
|
924
|
-
var _default = exports.default = DoorModels;
|