door_models 5.1.5 → 5.1.7

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 CHANGED
@@ -336,8 +336,9 @@ const ConfiguratorProvider = _ref => {
336
336
  setOcculus(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
337
337
  visible: newConfig.occulusVisible
338
338
  }));
339
+ setCpid(cpidToParse);
339
340
  showMessage("Configuration Applied!", "success");
340
- }, [setBodyType, setExteriorFanlight, setExteriorFanlightType, setFrameType, setInteriorFanlight, setOcculus, setIsDoubleDoor, setTotalWidth]);
341
+ }, [setCpid, setBodyType, setExteriorFanlight, setExteriorFanlightType, setFrameType, setInteriorFanlight, setOcculus, setIsDoubleDoor, setTotalWidth]);
341
342
 
342
343
  // --- BodyType Effect ---
343
344
  React.useEffect(() => {
@@ -1628,6 +1629,9 @@ function DoorModels(_ref7) {
1628
1629
  x: 0
1629
1630
  }];
1630
1631
  }, [isDoubleDoor, doorWidthM, doorPivot]);
1632
+ if (cpid !== doorName) {
1633
+ return null;
1634
+ }
1631
1635
  if (is2D) {
1632
1636
  return /*#__PURE__*/jsxRuntime.jsx("group", {
1633
1637
  "position-y": yCenteringOffset + 0.1,
@@ -2206,180 +2210,178 @@ function DoorLeaf(_ref8) {
2206
2210
  }
2207
2211
  return true;
2208
2212
  }, [isFrameVisible, frameType, isGlassDoor]);
2209
- return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
2210
- children: /*#__PURE__*/jsxRuntime.jsxs("group", {
2211
- "position-x": xOffset,
2213
+ return /*#__PURE__*/jsxRuntime.jsxs("group", {
2214
+ "position-x": xOffset,
2215
+ children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
2216
+ position: [hingeSideX, doorYPosition + y, hingeZ],
2217
+ children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2218
+ material: hingeBodyMaterial,
2219
+ position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
2220
+ castShadow: true,
2221
+ children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2222
+ args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2223
+ })
2224
+ }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2225
+ material: hingeAccentMaterial,
2226
+ position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
2227
+ castShadow: true,
2228
+ children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2229
+ args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2230
+ })
2231
+ })]
2232
+ }, "frame-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs(three.a.group, {
2233
+ position: [hingeSideX, doorYPosition, hingeZ],
2234
+ rotation: rotation.to((x, y, z) => [x, y, z]),
2235
+ onClick: handleClick,
2236
+ onPointerOver: () => document.body.style.cursor = "pointer",
2237
+ onPointerOut: () => document.body.style.cursor = "auto",
2212
2238
  children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
2213
- position: [hingeSideX, doorYPosition + y, hingeZ],
2239
+ position: [0, y, 0],
2214
2240
  children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2215
2241
  material: hingeBodyMaterial,
2216
- position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
2242
+ position: [0, -separatorHeightM / 2 - barrelPartHeight / 2, 0],
2217
2243
  castShadow: true,
2218
2244
  children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2219
2245
  args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2220
2246
  })
2221
2247
  }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2222
2248
  material: hingeAccentMaterial,
2223
- position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
2249
+ position: [0, -separatorHeightM / 2 - barrelPartHeight - capHeightM / 2, 0],
2224
2250
  castShadow: true,
2225
2251
  children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2226
2252
  args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2227
2253
  })
2254
+ }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2255
+ material: hingeAccentMaterial,
2256
+ position: [0, 0, 0],
2257
+ castShadow: true,
2258
+ children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2259
+ args: [hingeRadiusM, hingeRadiusM, separatorHeightM, 32]
2260
+ })
2228
2261
  })]
2229
- }, "frame-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs(three.a.group, {
2230
- position: [hingeSideX, doorYPosition, hingeZ],
2231
- rotation: rotation.to((x, y, z) => [x, y, z]),
2232
- onClick: handleClick,
2233
- onPointerOver: () => document.body.style.cursor = "pointer",
2234
- onPointerOut: () => document.body.style.cursor = "auto",
2235
- children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
2236
- position: [0, y, 0],
2237
- children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2238
- material: hingeBodyMaterial,
2239
- position: [0, -separatorHeightM / 2 - barrelPartHeight / 2, 0],
2240
- castShadow: true,
2241
- children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2242
- args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2243
- })
2244
- }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2245
- material: hingeAccentMaterial,
2246
- position: [0, -separatorHeightM / 2 - barrelPartHeight - capHeightM / 2, 0],
2247
- castShadow: true,
2248
- children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2249
- args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2250
- })
2251
- }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2252
- material: hingeAccentMaterial,
2253
- position: [0, 0, 0],
2254
- castShadow: true,
2255
- children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2256
- args: [hingeRadiusM, hingeRadiusM, separatorHeightM, 32]
2257
- })
2258
- })]
2259
- }, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsx(GlassHinge, {
2260
- position: [0, y, doorOffsetZ + 0.0001],
2261
- pivot: pivot,
2262
- frameSideWidth: sidesFrameWidthM,
2263
- doorDepthM: doorDepthM,
2264
- material: hingeBodyMaterial,
2265
- gasketMaterial: gasketMaterial
2266
- }, "glass-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs("group", {
2267
- position: [-hingeSideX, 0, doorOffsetZ],
2268
- children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2269
- castShadow: true,
2270
- receiveShadow: true,
2271
- children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2272
- useGroups: true,
2273
- children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2274
- name: "door-base",
2275
- material: doorMaterial,
2276
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2277
- args: [doorWidthM, mainDoorHeightM, doorDepthM]
2278
- })
2279
- }), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
2280
- visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2281
- width: doorWidthM,
2282
- height: totalOpeningHeightM,
2283
- stopWidth: doorStopWidthM,
2284
- stopDepth: doorStopDepthM,
2285
- stopPositionZ: doorStopPositionZ,
2286
- centerZ: doorCenterZ,
2287
- glassDepthOffset: GlassPanelDepthM / 2,
2288
- material: doorMaterial,
2289
- setName: "1"
2290
- }), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
2291
- visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2292
- width: doorWidthM,
2293
- height: totalOpeningHeightM,
2294
- stopWidth: secondDoorStopWidthM,
2295
- stopDepth: secondDoorStopDepthM,
2296
- stopPositionZ: secondDoorStopPositionZ,
2297
- centerZ: doorCenterZ,
2298
- glassDepthOffset: GlassPanelDepthM / 2,
2299
- material: doorMaterial,
2300
- setName: "2"
2301
- }), glassVisible && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2302
- children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2303
- position: [0, 0, frontGlassOffsetZ],
2304
- castShadow: true,
2305
- material: glassInfillMaterial,
2306
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2307
- args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2308
- })
2309
- }), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2310
- position: [0, 0, backGlassOffsetZ],
2311
- castShadow: true,
2312
- material: glassInfillMaterial,
2313
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2314
- args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2315
- })
2316
- }), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2317
- position: [0, -secondDoorStopWidthM / 2, backGlassOffsetZ],
2318
- castShadow: true,
2319
- material: glassInfillMaterial,
2320
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2321
- args: [doorWidthM - 2 * secondDoorStopWidthM, mainDoorHeightM - secondDoorStopWidthM, GlassPanelDepthM]
2322
- })
2323
- })]
2324
- }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2325
- material: placeholderMaterial,
2326
- position: [occulusPositionXM, occulusPositionYM, 0],
2327
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2328
- args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
2329
- })
2330
- })]
2331
- })
2332
- }), frontDoorPlane.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2333
- position: [0, 0, doorDepthM / 2 + 0.0005],
2334
- castShadow: true,
2335
- children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2336
- useGroups: true,
2337
- children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2338
- material: frontDoorPlaneMaterial,
2339
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2340
- args: [doorWidthM, mainDoorHeightM, 0.001]
2341
- })
2342
- }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2343
- position: [occulusPositionXM, occulusPositionYM, 0],
2262
+ }, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsx(GlassHinge, {
2263
+ position: [0, y, doorOffsetZ + 0.0001],
2264
+ pivot: pivot,
2265
+ frameSideWidth: sidesFrameWidthM,
2266
+ doorDepthM: doorDepthM,
2267
+ material: hingeBodyMaterial,
2268
+ gasketMaterial: gasketMaterial
2269
+ }, "glass-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs("group", {
2270
+ position: [-hingeSideX, 0, doorOffsetZ],
2271
+ children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2272
+ castShadow: true,
2273
+ receiveShadow: true,
2274
+ children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2275
+ useGroups: true,
2276
+ children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2277
+ name: "door-base",
2278
+ material: doorMaterial,
2279
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2280
+ args: [doorWidthM, mainDoorHeightM, doorDepthM]
2281
+ })
2282
+ }), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
2283
+ visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2284
+ width: doorWidthM,
2285
+ height: totalOpeningHeightM,
2286
+ stopWidth: doorStopWidthM,
2287
+ stopDepth: doorStopDepthM,
2288
+ stopPositionZ: doorStopPositionZ,
2289
+ centerZ: doorCenterZ,
2290
+ glassDepthOffset: GlassPanelDepthM / 2,
2291
+ material: doorMaterial,
2292
+ setName: "1"
2293
+ }), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
2294
+ visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2295
+ width: doorWidthM,
2296
+ height: totalOpeningHeightM,
2297
+ stopWidth: secondDoorStopWidthM,
2298
+ stopDepth: secondDoorStopDepthM,
2299
+ stopPositionZ: secondDoorStopPositionZ,
2300
+ centerZ: doorCenterZ,
2301
+ glassDepthOffset: GlassPanelDepthM / 2,
2302
+ material: doorMaterial,
2303
+ setName: "2"
2304
+ }), glassVisible && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2305
+ children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2306
+ position: [0, 0, frontGlassOffsetZ],
2307
+ castShadow: true,
2308
+ material: glassInfillMaterial,
2344
2309
  children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2345
- args: [occulusWidthM, occulusHeightM, 0.002]
2310
+ args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2346
2311
  })
2347
- })]
2348
- })
2349
- }), backDoorPlane.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2350
- position: [0, 0, -doorDepthM / 2 - 0.0005],
2351
- castShadow: true,
2352
- children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2353
- useGroups: true,
2354
- children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2355
- material: backDoorPlaneMaterial,
2312
+ }), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2313
+ position: [0, 0, backGlassOffsetZ],
2314
+ castShadow: true,
2315
+ material: glassInfillMaterial,
2356
2316
  children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2357
- args: [doorWidthM, mainDoorHeightM, 0.0001]
2317
+ args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2358
2318
  })
2359
- }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2360
- position: [occulusPositionXM, occulusPositionYM, 0],
2319
+ }), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2320
+ position: [0, -secondDoorStopWidthM / 2, backGlassOffsetZ],
2321
+ castShadow: true,
2322
+ material: glassInfillMaterial,
2361
2323
  children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2362
- args: [occulusWidthM, occulusHeightM, 0.002]
2324
+ args: [doorWidthM - 2 * secondDoorStopWidthM, mainDoorHeightM - secondDoorStopWidthM, GlassPanelDepthM]
2363
2325
  })
2364
2326
  })]
2365
- })
2366
- }), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2367
- position: [occulusPositionXM, occulusPositionYM, 0],
2368
- castShadow: true,
2369
- material: occulusInfillMaterial,
2370
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2371
- args: [occulusWidthM, occulusHeightM, occulusInfillDepthM]
2372
- })
2373
- }), /*#__PURE__*/jsxRuntime.jsx(DoorHandle, {
2374
- bodyType: bodyType,
2375
- handleX: handleX,
2376
- handleHeightM: handleHeightM,
2377
- doorDepthM: doorDepthM,
2378
- doorPivot: pivot
2379
- })]
2327
+ }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2328
+ material: placeholderMaterial,
2329
+ position: [occulusPositionXM, occulusPositionYM, 0],
2330
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2331
+ args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
2332
+ })
2333
+ })]
2334
+ })
2335
+ }), frontDoorPlane.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2336
+ position: [0, 0, doorDepthM / 2 + 0.0005],
2337
+ castShadow: true,
2338
+ children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2339
+ useGroups: true,
2340
+ children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2341
+ material: frontDoorPlaneMaterial,
2342
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2343
+ args: [doorWidthM, mainDoorHeightM, 0.001]
2344
+ })
2345
+ }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2346
+ position: [occulusPositionXM, occulusPositionYM, 0],
2347
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2348
+ args: [occulusWidthM, occulusHeightM, 0.002]
2349
+ })
2350
+ })]
2351
+ })
2352
+ }), backDoorPlane.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2353
+ position: [0, 0, -doorDepthM / 2 - 0.0005],
2354
+ castShadow: true,
2355
+ children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2356
+ useGroups: true,
2357
+ children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2358
+ material: backDoorPlaneMaterial,
2359
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2360
+ args: [doorWidthM, mainDoorHeightM, 0.0001]
2361
+ })
2362
+ }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2363
+ position: [occulusPositionXM, occulusPositionYM, 0],
2364
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2365
+ args: [occulusWidthM, occulusHeightM, 0.002]
2366
+ })
2367
+ })]
2368
+ })
2369
+ }), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2370
+ position: [occulusPositionXM, occulusPositionYM, 0],
2371
+ castShadow: true,
2372
+ material: occulusInfillMaterial,
2373
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2374
+ args: [occulusWidthM, occulusHeightM, occulusInfillDepthM]
2375
+ })
2376
+ }), /*#__PURE__*/jsxRuntime.jsx(DoorHandle, {
2377
+ bodyType: bodyType,
2378
+ handleX: handleX,
2379
+ handleHeightM: handleHeightM,
2380
+ doorDepthM: doorDepthM,
2381
+ doorPivot: pivot
2380
2382
  })]
2381
2383
  })]
2382
- })
2384
+ })]
2383
2385
  });
2384
2386
  }
2385
2387