@tscircuit/3d-viewer 0.0.519 → 0.0.520
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.js +13 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28483,7 +28483,7 @@ import * as THREE16 from "three";
|
|
|
28483
28483
|
// package.json
|
|
28484
28484
|
var package_default = {
|
|
28485
28485
|
name: "@tscircuit/3d-viewer",
|
|
28486
|
-
version: "0.0.
|
|
28486
|
+
version: "0.0.519",
|
|
28487
28487
|
main: "./dist/index.js",
|
|
28488
28488
|
module: "./dist/index.js",
|
|
28489
28489
|
type: "module",
|
|
@@ -35314,7 +35314,7 @@ var BoardMeshes = ({
|
|
|
35314
35314
|
}) => {
|
|
35315
35315
|
const { rootObject } = useThree();
|
|
35316
35316
|
const { visibility } = useLayerVisibility();
|
|
35317
|
-
const
|
|
35317
|
+
const disposeMesh = (mesh) => {
|
|
35318
35318
|
mesh.geometry.dispose();
|
|
35319
35319
|
const materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material];
|
|
35320
35320
|
for (const material of materials) {
|
|
@@ -35356,23 +35356,29 @@ var BoardMeshes = ({
|
|
|
35356
35356
|
rootObject.add(mesh);
|
|
35357
35357
|
}
|
|
35358
35358
|
});
|
|
35359
|
-
textureMeshes.forEach((mesh) => {
|
|
35360
|
-
rootObject.add(mesh);
|
|
35361
|
-
});
|
|
35362
35359
|
return () => {
|
|
35363
35360
|
geometryMeshes.forEach((mesh) => {
|
|
35364
35361
|
if (mesh.parent === rootObject) {
|
|
35365
35362
|
rootObject.remove(mesh);
|
|
35366
35363
|
}
|
|
35364
|
+
disposeMesh(mesh);
|
|
35367
35365
|
});
|
|
35366
|
+
};
|
|
35367
|
+
}, [rootObject, geometryMeshes, visibility]);
|
|
35368
|
+
useEffect25(() => {
|
|
35369
|
+
if (!rootObject) return;
|
|
35370
|
+
textureMeshes.forEach((mesh) => {
|
|
35371
|
+
rootObject.add(mesh);
|
|
35372
|
+
});
|
|
35373
|
+
return () => {
|
|
35368
35374
|
textureMeshes.forEach((mesh) => {
|
|
35369
35375
|
if (mesh.parent === rootObject) {
|
|
35370
35376
|
rootObject.remove(mesh);
|
|
35371
35377
|
}
|
|
35372
|
-
|
|
35378
|
+
disposeMesh(mesh);
|
|
35373
35379
|
});
|
|
35374
35380
|
};
|
|
35375
|
-
}, [rootObject,
|
|
35381
|
+
}, [rootObject, textureMeshes]);
|
|
35376
35382
|
return null;
|
|
35377
35383
|
};
|
|
35378
35384
|
var MANIFOLD_CDN_BASE_URL = "https://cdn.jsdelivr.net/npm/manifold-3d@3.2.1";
|