door_models 5.0.0 → 5.0.2

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
@@ -1197,7 +1197,7 @@ function DoorModels(_ref6) {
1197
1197
  const frameDepthM = frameDepth / 1000;
1198
1198
  const topFrameWidthM = topThkValue / 1000;
1199
1199
  const sidesFrameWidthM = sidesThkValue / 1000;
1200
- const exteriorFanlightHeightM = exteriorFanlightHeightValue / 1000;
1200
+ const exteriorFanlightHeightM = exteriorFanlight.visible ? exteriorFanlightHeightValue / 1000 : 0;
1201
1201
  const exteriorFanlightDepthM = exteriorFanlightDepthValue / 1000;
1202
1202
  const occulusX1M = occulusX1 / 1000;
1203
1203
  const occulusX2M = occulusX2 / 1000;
@@ -1289,6 +1289,9 @@ function DoorModels(_ref6) {
1289
1289
  const handleClick = () => setIsOpen(!isOpen);
1290
1290
  const totalFrameWidth = doorWidthM + sidesFrameWidthM * 2;
1291
1291
  const totalFrameHeightM = totalOpeningHeightM + topFrameWidthM;
1292
+
1293
+ // --- Centering Logic ---
1294
+ const yCenteringOffset = -(topFrameWidthM + exteriorFanlightHeightM) / 2;
1292
1295
  const sideFrameCenterY = topFrameWidthM / 2;
1293
1296
  const interiorFanlightYPosition = totalOpeningHeightM / 2 - interiorFanlightHeightM / 2;
1294
1297
  const doorYPosition = -totalOpeningHeightM / 2 + mainDoorHeightM / 2;
@@ -1368,6 +1371,7 @@ function DoorModels(_ref6) {
1368
1371
  }, [isFrameVisible, frameType, isGlassDoor]);
1369
1372
  if (is2D) {
1370
1373
  return /*#__PURE__*/jsxRuntime.jsx("group", {
1374
+ "position-y": yCenteringOffset + 0.2,
1371
1375
  children: /*#__PURE__*/jsxRuntime.jsxs("mesh", {
1372
1376
  children: [/*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
1373
1377
  args: [totalWidth / 1000, 0.1, frameDepth / 1000]
@@ -1378,7 +1382,8 @@ function DoorModels(_ref6) {
1378
1382
  })
1379
1383
  });
1380
1384
  }
1381
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1385
+ return /*#__PURE__*/jsxRuntime.jsxs("group", {
1386
+ "position-y": yCenteringOffset,
1382
1387
  children: [frontCoverPanel.visible && /*#__PURE__*/jsxRuntime.jsxs("group", {
1383
1388
  "position-z": frontArchitraveZ,
1384
1389
  children: [/*#__PURE__*/jsxRuntime.jsx("mesh", {
@@ -1787,7 +1792,7 @@ function DoorModels(_ref6) {
1787
1792
  }), isPlaneVisible && /*#__PURE__*/jsxRuntime.jsxs("mesh", {
1788
1793
  receiveShadow: true,
1789
1794
  rotation: [-Math.PI / 2, 0, 0],
1790
- position: [0, -totalOpeningHeightM / 2 - 0.01, 0],
1795
+ position: [0, -totalOpeningHeightM / 2 - yCenteringOffset - 0.01, 0],
1791
1796
  children: [/*#__PURE__*/jsxRuntime.jsx("planeGeometry", {
1792
1797
  args: [10, 10]
1793
1798
  }), /*#__PURE__*/jsxRuntime.jsx("meshStandardMaterial", {