door_models 4.0.2 → 5.0.1

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.esm.js CHANGED
@@ -126,10 +126,10 @@ const ConfiguratorProvider = _ref => {
126
126
  const [occulus, setOcculus] = useState({
127
127
  visible: false,
128
128
  infillVisible: true,
129
- x1: 120,
130
- x2: 120,
131
- y1: 600,
132
- y2: 220,
129
+ x1: 150,
130
+ x2: 150,
131
+ y1: 150,
132
+ y2: 150,
133
133
  material: "infill_material",
134
134
  depth: 20
135
135
  });
@@ -1173,7 +1173,7 @@ function DoorModels(_ref6) {
1173
1173
  const frameDepthM = frameDepth / 1000;
1174
1174
  const topFrameWidthM = topThkValue / 1000;
1175
1175
  const sidesFrameWidthM = sidesThkValue / 1000;
1176
- const exteriorFanlightHeightM = exteriorFanlightHeightValue / 1000;
1176
+ const exteriorFanlightHeightM = exteriorFanlight.visible ? exteriorFanlightHeightValue / 1000 : 0;
1177
1177
  const exteriorFanlightDepthM = exteriorFanlightDepthValue / 1000;
1178
1178
  const occulusX1M = occulusX1 / 1000;
1179
1179
  const occulusX2M = occulusX2 / 1000;
@@ -1265,6 +1265,9 @@ function DoorModels(_ref6) {
1265
1265
  const handleClick = () => setIsOpen(!isOpen);
1266
1266
  const totalFrameWidth = doorWidthM + sidesFrameWidthM * 2;
1267
1267
  const totalFrameHeightM = totalOpeningHeightM + topFrameWidthM;
1268
+
1269
+ // --- Centering Logic ---
1270
+ const yCenteringOffset = -(topFrameWidthM + exteriorFanlightHeightM) / 2;
1268
1271
  const sideFrameCenterY = topFrameWidthM / 2;
1269
1272
  const interiorFanlightYPosition = totalOpeningHeightM / 2 - interiorFanlightHeightM / 2;
1270
1273
  const doorYPosition = -totalOpeningHeightM / 2 + mainDoorHeightM / 2;
@@ -1344,6 +1347,7 @@ function DoorModels(_ref6) {
1344
1347
  }, [isFrameVisible, frameType, isGlassDoor]);
1345
1348
  if (is2D) {
1346
1349
  return /*#__PURE__*/jsx("group", {
1350
+ "position-y": yCenteringOffset,
1347
1351
  children: /*#__PURE__*/jsxs("mesh", {
1348
1352
  children: [/*#__PURE__*/jsx("boxGeometry", {
1349
1353
  args: [totalWidth / 1000, 0.1, frameDepth / 1000]
@@ -1354,7 +1358,8 @@ function DoorModels(_ref6) {
1354
1358
  })
1355
1359
  });
1356
1360
  }
1357
- return /*#__PURE__*/jsxs(Fragment, {
1361
+ return /*#__PURE__*/jsxs("group", {
1362
+ "position-y": yCenteringOffset,
1358
1363
  children: [frontCoverPanel.visible && /*#__PURE__*/jsxs("group", {
1359
1364
  "position-z": frontArchitraveZ,
1360
1365
  children: [/*#__PURE__*/jsx("mesh", {
@@ -1763,7 +1768,7 @@ function DoorModels(_ref6) {
1763
1768
  }), isPlaneVisible && /*#__PURE__*/jsxs("mesh", {
1764
1769
  receiveShadow: true,
1765
1770
  rotation: [-Math.PI / 2, 0, 0],
1766
- position: [0, -totalOpeningHeightM / 2 - 0.01, 0],
1771
+ position: [0, -totalOpeningHeightM / 2 - yCenteringOffset - 0.01, 0],
1767
1772
  children: [/*#__PURE__*/jsx("planeGeometry", {
1768
1773
  args: [10, 10]
1769
1774
  }), /*#__PURE__*/jsx("meshStandardMaterial", {