door_models 5.1.2 → 5.1.3

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
@@ -1547,7 +1547,7 @@ function DoorModels(_ref7) {
1547
1547
  const totalFrameHeightM = totalOpeningHeightM + topFrameWidthM;
1548
1548
 
1549
1549
  // --- Centering Logic ---
1550
- const yCenteringOffset = -(topFrameWidthM + exteriorFanlightHeightM) / 2;
1550
+ const yCenteringOffset = -topFrameWidthM / 2;
1551
1551
  const sideFrameCenterY = topFrameWidthM / 2;
1552
1552
  const interiorFanlightYPosition = totalOpeningHeightM / 2 - interiorFanlightHeightM / 2;
1553
1553
  const topFrameCenterY = totalOpeningHeightM / 2 + topFrameWidthM / 2;
@@ -1575,7 +1575,7 @@ function DoorModels(_ref7) {
1575
1575
 
1576
1576
  // --- HINGE VISIBILITY LOGIC ---
1577
1577
  const isGlassDoor = React.useMemo(() => ["SG8", "SG10", "SG12"].includes(bodyType), [bodyType]);
1578
- (doorHeight - initialDoorHeight.current) / 2 / 1000;
1578
+ const pivotNewPosition = (doorHeight - initialDoorHeight.current) / 2 / 1000;
1579
1579
 
1580
1580
  // Calculate evenly spaced hinge positions
1581
1581
  React.useMemo(() => {
@@ -1641,9 +1641,13 @@ function DoorModels(_ref7) {
1641
1641
  })
1642
1642
  });
1643
1643
  }
1644
- return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
1645
- children: /*#__PURE__*/jsxRuntime.jsxs("group", {
1646
- "position-y": yCenteringOffset,
1644
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1645
+ children: [/*#__PURE__*/jsxRuntime.jsx("axesHelper", {
1646
+ args: [3]
1647
+ }), /*#__PURE__*/jsxRuntime.jsx("gridHelper", {
1648
+ args: [10, 10]
1649
+ }), /*#__PURE__*/jsxRuntime.jsxs("group", {
1650
+ "position-y": yCenteringOffset + pivotNewPosition,
1647
1651
  children: [frontCoverPanel.visible && /*#__PURE__*/jsxRuntime.jsxs("group", {
1648
1652
  "position-z": frontArchitraveZ,
1649
1653
  children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
@@ -1919,7 +1923,7 @@ function DoorModels(_ref7) {
1919
1923
  pivot: instance.pivot,
1920
1924
  xOffset: instance.x
1921
1925
  }, instance.key))]
1922
- })
1926
+ })]
1923
1927
  });
1924
1928
  }
1925
1929
  function DoorLeaf(_ref8) {
@@ -2202,178 +2206,180 @@ function DoorLeaf(_ref8) {
2202
2206
  }
2203
2207
  return true;
2204
2208
  }, [isFrameVisible, frameType, isGlassDoor]);
2205
- return /*#__PURE__*/jsxRuntime.jsxs("group", {
2206
- "position-x": xOffset,
2207
- children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
2208
- position: [hingeSideX, doorYPosition + y, hingeZ],
2209
- children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2210
- material: hingeBodyMaterial,
2211
- position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
2212
- castShadow: true,
2213
- children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2214
- args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2215
- })
2216
- }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2217
- material: hingeAccentMaterial,
2218
- position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
2219
- castShadow: true,
2220
- children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2221
- args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2222
- })
2223
- })]
2224
- }, "frame-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs(three.a.group, {
2225
- position: [hingeSideX, doorYPosition, hingeZ],
2226
- rotation: rotation.to((x, y, z) => [x, y, z]),
2227
- onClick: handleClick,
2228
- onPointerOver: () => document.body.style.cursor = "pointer",
2229
- onPointerOut: () => document.body.style.cursor = "auto",
2209
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
2210
+ children: /*#__PURE__*/jsxRuntime.jsxs("group", {
2211
+ "position-x": xOffset,
2230
2212
  children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
2231
- position: [0, y, 0],
2213
+ position: [hingeSideX, doorYPosition + y, hingeZ],
2232
2214
  children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2233
2215
  material: hingeBodyMaterial,
2234
- position: [0, -separatorHeightM / 2 - barrelPartHeight / 2, 0],
2216
+ position: [0, separatorHeightM / 2 + barrelPartHeight / 2, 0],
2235
2217
  castShadow: true,
2236
2218
  children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2237
2219
  args: [hingeRadiusM, hingeRadiusM, barrelPartHeight, 32]
2238
2220
  })
2239
2221
  }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2240
2222
  material: hingeAccentMaterial,
2241
- position: [0, -separatorHeightM / 2 - barrelPartHeight - capHeightM / 2, 0],
2223
+ position: [0, separatorHeightM / 2 + barrelPartHeight + capHeightM / 2, 0],
2242
2224
  castShadow: true,
2243
2225
  children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2244
2226
  args: [hingeRadiusM, hingeRadiusM, capHeightM, 32]
2245
2227
  })
2246
- }), /*#__PURE__*/jsxRuntime.jsx("mesh", {
2247
- material: hingeAccentMaterial,
2248
- position: [0, 0, 0],
2249
- castShadow: true,
2250
- children: /*#__PURE__*/jsxRuntime.jsx("cylinderGeometry", {
2251
- args: [hingeRadiusM, hingeRadiusM, separatorHeightM, 32]
2252
- })
2253
2228
  })]
2254
- }, "door-hinge-".concat(index))), isGlassDoor && isFrameVisible && glassHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsx(GlassHinge, {
2255
- position: [0, y, doorOffsetZ + 0.0001],
2256
- pivot: pivot,
2257
- frameSideWidth: sidesFrameWidthM,
2258
- doorDepthM: doorDepthM,
2259
- material: hingeBodyMaterial,
2260
- gasketMaterial: gasketMaterial
2261
- }, "glass-hinge-".concat(index))), /*#__PURE__*/jsxRuntime.jsxs("group", {
2262
- position: [-hingeSideX, 0, doorOffsetZ],
2263
- children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2264
- castShadow: true,
2265
- receiveShadow: true,
2266
- children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2267
- useGroups: true,
2268
- children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2269
- name: "door-base",
2270
- material: doorMaterial,
2271
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2272
- args: [doorWidthM, mainDoorHeightM, doorDepthM]
2273
- })
2274
- }), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
2275
- visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2276
- width: doorWidthM,
2277
- height: totalOpeningHeightM,
2278
- stopWidth: doorStopWidthM,
2279
- stopDepth: doorStopDepthM,
2280
- stopPositionZ: doorStopPositionZ,
2281
- centerZ: doorCenterZ,
2282
- glassDepthOffset: GlassPanelDepthM / 2,
2283
- material: doorMaterial,
2284
- setName: "1"
2285
- }), /*#__PURE__*/jsxRuntime.jsx(DoorStopCuts, {
2286
- visible: frameType === "WDGF_WDG100" || frameType === "WF_100" || frameType === "WF_FLI",
2287
- width: doorWidthM,
2288
- height: totalOpeningHeightM,
2289
- stopWidth: secondDoorStopWidthM,
2290
- stopDepth: secondDoorStopDepthM,
2291
- stopPositionZ: secondDoorStopPositionZ,
2292
- centerZ: doorCenterZ,
2293
- glassDepthOffset: GlassPanelDepthM / 2,
2294
- material: doorMaterial,
2295
- setName: "2"
2296
- }), glassVisible && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2297
- children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
2298
- position: [0, 0, frontGlassOffsetZ],
2299
- castShadow: true,
2300
- material: glassInfillMaterial,
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,
2301
2276
  children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2302
- args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2277
+ args: [doorWidthM, mainDoorHeightM, doorDepthM]
2303
2278
  })
2304
- }), frameType !== "WDGF_WDG100" && frameType !== "WF_100" && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2305
- position: [0, 0, backGlassOffsetZ],
2306
- castShadow: true,
2307
- material: glassInfillMaterial,
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],
2308
2327
  children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2309
- args: [doorWidthM, mainDoorHeightM, GlassPanelDepthM]
2328
+ args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
2310
2329
  })
2311
- }), (frameType === "WDGF_WDG100" || frameType === "WF_100") && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2312
- position: [0, -secondDoorStopWidthM / 2, backGlassOffsetZ],
2313
- castShadow: true,
2314
- material: glassInfillMaterial,
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,
2315
2339
  children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2316
- args: [doorWidthM - 2 * secondDoorStopWidthM, mainDoorHeightM - secondDoorStopWidthM, GlassPanelDepthM]
2340
+ args: [doorWidthM, mainDoorHeightM, 0.001]
2341
+ })
2342
+ }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2343
+ position: [occulusPositionXM, occulusPositionYM, 0],
2344
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2345
+ args: [occulusWidthM, occulusHeightM, 0.002]
2317
2346
  })
2318
2347
  })]
2319
- }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2320
- material: placeholderMaterial,
2321
- position: [occulusPositionXM, occulusPositionYM, 0],
2322
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2323
- args: [occulusWidthM, occulusHeightM, doorDepthM + 0.01]
2324
- })
2325
- })]
2326
- })
2327
- }), frontDoorPlane.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2328
- position: [0, 0, doorDepthM / 2 + 0.0005],
2329
- castShadow: true,
2330
- children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2331
- useGroups: true,
2332
- children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2333
- material: frontDoorPlaneMaterial,
2334
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2335
- args: [doorWidthM, mainDoorHeightM, 0.001]
2336
- })
2337
- }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2338
- position: [occulusPositionXM, occulusPositionYM, 0],
2339
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2340
- args: [occulusWidthM, occulusHeightM, 0.002]
2341
- })
2342
- })]
2343
- })
2344
- }), backDoorPlane.visible && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2345
- position: [0, 0, -doorDepthM / 2 - 0.0005],
2346
- castShadow: true,
2347
- children: /*#__PURE__*/jsxRuntime.jsxs(csg.Geometry, {
2348
- useGroups: true,
2349
- children: [/*#__PURE__*/jsxRuntime.jsx(csg.Base, {
2350
- material: backDoorPlaneMaterial,
2351
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2352
- args: [doorWidthM, mainDoorHeightM, 0.0001]
2353
- })
2354
- }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2355
- position: [occulusPositionXM, occulusPositionYM, 0],
2356
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2357
- args: [occulusWidthM, occulusHeightM, 0.002]
2358
- })
2359
- })]
2360
- })
2361
- }), occulus.visible && occulus.infillVisible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx("mesh", {
2362
- position: [occulusPositionXM, occulusPositionYM, 0],
2363
- castShadow: true,
2364
- material: occulusInfillMaterial,
2365
- children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2366
- args: [occulusWidthM, occulusHeightM, occulusInfillDepthM]
2367
- })
2368
- }), /*#__PURE__*/jsxRuntime.jsx(DoorHandle, {
2369
- bodyType: bodyType,
2370
- handleX: handleX,
2371
- handleHeightM: handleHeightM,
2372
- doorDepthM: doorDepthM,
2373
- doorPivot: pivot
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,
2356
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2357
+ args: [doorWidthM, mainDoorHeightM, 0.0001]
2358
+ })
2359
+ }), occulus.visible && occulusWidthM > 0 && occulusHeightM > 0 && /*#__PURE__*/jsxRuntime.jsx(csg.Subtraction, {
2360
+ position: [occulusPositionXM, occulusPositionYM, 0],
2361
+ children: /*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
2362
+ args: [occulusWidthM, occulusHeightM, 0.002]
2363
+ })
2364
+ })]
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
+ })]
2374
2380
  })]
2375
2381
  })]
2376
- })]
2382
+ })
2377
2383
  });
2378
2384
  }
2379
2385