From dce576f9685e8280a3f023c0835085921a58e3c1 Mon Sep 17 00:00:00 2001 From: Osama Khalid Date: Sun, 18 Jan 2026 23:06:52 -0500 Subject: [PATCH] feat: Implement STL Repair tool with WASM support and improved UI Added STL Repair tool using @goodtools/meshrepair. Key features: - WASM-based mesh repair - 3D viewer with dual pane (original vs repaired) - Camera synchronization between viewers - Improved UI with hidden dropzone on load and clear button - Progress feedback and success indicators --- package-lock.json | 667 +++++++++++++++++++++++++++++++++- package.json | 7 +- src/components/Sidebar.tsx | 1 + src/config/routes.config.ts | 1 + src/config/tools.config.tsx | 21 ++ src/lib/categories.ts | 3 +- src/tools/STLRepair.tsx | 698 ++++++++++++++++++++++++++++++++++++ src/types/tool.types.ts | 1 + vite.config.ts | 2 + 9 files changed, 1386 insertions(+), 15 deletions(-) create mode 100644 src/tools/STLRepair.tsx diff --git a/package-lock.json b/package-lock.json index 38b3d01..f38675b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,16 @@ { "name": "good.tools", - "version": "1.19.3", + "version": "1.22.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "good.tools", - "version": "1.19.3", + "version": "1.22.0", "dependencies": { "@algolia/autocomplete-core": "^1.19.4", "@goodtools/jdserialize": "^1.0.0", + "@goodtools/meshrepair": "^0.1.1", "@goodtools/protobuf-decoder": "^1.0.0", "@goodtools/wiregasm": "^1.9.0", "@headlessui/react": "^1.7.7", @@ -21,6 +22,8 @@ "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-slot": "^1.2.4", "@radix-ui/react-switch": "^1.2.6", + "@react-three/drei": "^9.92.7", + "@react-three/fiber": "^8.15.12", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/typography": "^0.5.8", "@tanstack/react-query": "^5.62.16", @@ -47,6 +50,7 @@ "tailwind-merge": "^3.4.0", "tailwindcss": "^3.2.4", "tailwindcss-animate": "^1.0.7", + "three": "^0.172.0", "web-vitals": "^2.1.4", "xml-formatter": "^3.6.7", "zustand": "^4.1.5" @@ -66,6 +70,7 @@ "@types/pako": "^2.0.3", "@types/react": "^18.2.79", "@types/react-dom": "^18.2.25", + "@types/three": "^0.172.0", "@vitejs/plugin-react": "^4.3.4", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.8", @@ -1639,6 +1644,12 @@ "integrity": "sha512-ChIAijSxYrNh6/KDNInDjrmjBjGrO/z3bv3lodMA1rfjBi83MpsEu2+5YPbidTMErUjXe2CP1b45T/qjHNrqXA==", "license": "MIT" }, + "node_modules/@goodtools/meshrepair": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@goodtools/meshrepair/-/meshrepair-0.1.1.tgz", + "integrity": "sha512-HhFHvpdUyVinRvA/TA8tZmR9WeIPx/hQ96nYEuKiEzBQhI1LS39Itowl5V7//Lrvj9/Lz3i/uxa384+WBLIcuA==", + "license": "GPL-3.0" + }, "node_modules/@goodtools/protobuf-decoder": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@goodtools/protobuf-decoder/-/protobuf-decoder-1.0.0.tgz", @@ -1775,6 +1786,12 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mediapipe/tasks-vision": { + "version": "0.10.17", + "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.17.tgz", + "integrity": "sha512-CZWV/q6TTe8ta61cZXjfnnHsfWIdFhms03M9T7Cnd5y2mdpylJM0rF1qRq+wsQVRMLz1OYPVEBU9ph2Bx8cxrg==", + "license": "Apache-2.0" + }, "node_modules/@monaco-editor/loader": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.7.0.tgz", @@ -1798,6 +1815,18 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/@monogrid/gainmap-js": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@monogrid/gainmap-js/-/gainmap-js-3.4.0.tgz", + "integrity": "sha512-2Z0FATFHaoYJ8b+Y4y4Hgfn3FRFwuU5zRrk+9dFWp4uGAdHGqVEdP7HP+gLA3X469KXHmfupJaUbKo1b/aDKIg==", + "license": "MIT", + "dependencies": { + "promise-worker-transferable": "^1.0.4" + }, + "peerDependencies": { + "three": ">= 0.159.0" + } + }, "node_modules/@motionone/animation": { "version": "10.18.0", "resolved": "https://registry.npmjs.org/@motionone/animation/-/animation-10.18.0.tgz", @@ -2947,6 +2976,224 @@ "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==", "license": "MIT" }, + "node_modules/@react-spring/animated": { + "version": "9.7.5", + "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.7.5.tgz", + "integrity": "sha512-Tqrwz7pIlsSDITzxoLS3n/v/YCUHQdOIKtOJf4yL6kYVSDTSmVK1LI1Q3M/uu2Sx4X3pIWF3xLUhlsA6SPNTNg==", + "license": "MIT", + "dependencies": { + "@react-spring/shared": "~9.7.5", + "@react-spring/types": "~9.7.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/core": { + "version": "9.7.5", + "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.7.5.tgz", + "integrity": "sha512-rmEqcxRcu7dWh7MnCcMXLvrf6/SDlSokLaLTxiPlAYi11nN3B5oiCUAblO72o+9z/87j2uzxa2Inm8UbLjXA+w==", + "license": "MIT", + "dependencies": { + "@react-spring/animated": "~9.7.5", + "@react-spring/shared": "~9.7.5", + "@react-spring/types": "~9.7.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-spring/donate" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/rafz": { + "version": "9.7.5", + "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.7.5.tgz", + "integrity": "sha512-5ZenDQMC48wjUzPAm1EtwQ5Ot3bLIAwwqP2w2owG5KoNdNHpEJV263nGhCeKKmuA3vG2zLLOdu3or6kuDjA6Aw==", + "license": "MIT" + }, + "node_modules/@react-spring/shared": { + "version": "9.7.5", + "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.7.5.tgz", + "integrity": "sha512-wdtoJrhUeeyD/PP/zo+np2s1Z820Ohr/BbuVYv+3dVLW7WctoiN7std8rISoYoHpUXtbkpesSKuPIw/6U1w1Pw==", + "license": "MIT", + "dependencies": { + "@react-spring/rafz": "~9.7.5", + "@react-spring/types": "~9.7.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/three": { + "version": "9.7.5", + "resolved": "https://registry.npmjs.org/@react-spring/three/-/three-9.7.5.tgz", + "integrity": "sha512-RxIsCoQfUqOS3POmhVHa1wdWS0wyHAUway73uRLp3GAL5U2iYVNdnzQsep6M2NZ994BlW8TcKuMtQHUqOsy6WA==", + "license": "MIT", + "dependencies": { + "@react-spring/animated": "~9.7.5", + "@react-spring/core": "~9.7.5", + "@react-spring/shared": "~9.7.5", + "@react-spring/types": "~9.7.5" + }, + "peerDependencies": { + "@react-three/fiber": ">=6.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "three": ">=0.126" + } + }, + "node_modules/@react-spring/types": { + "version": "9.7.5", + "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.7.5.tgz", + "integrity": "sha512-HVj7LrZ4ReHWBimBvu2SKND3cDVUPWKLqRTmWe/fNY6o1owGOX0cAHbdPDTMelgBlVbrTKrre6lFkhqGZErK/g==", + "license": "MIT" + }, + "node_modules/@react-three/drei": { + "version": "9.122.0", + "resolved": "https://registry.npmjs.org/@react-three/drei/-/drei-9.122.0.tgz", + "integrity": "sha512-SEO/F/rBCTjlLez7WAlpys+iGe9hty4rNgjZvgkQeXFSiwqD4Hbk/wNHMAbdd8vprO2Aj81mihv4dF5bC7D0CA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@mediapipe/tasks-vision": "0.10.17", + "@monogrid/gainmap-js": "^3.0.6", + "@react-spring/three": "~9.7.5", + "@use-gesture/react": "^10.3.1", + "camera-controls": "^2.9.0", + "cross-env": "^7.0.3", + "detect-gpu": "^5.0.56", + "glsl-noise": "^0.0.0", + "hls.js": "^1.5.17", + "maath": "^0.10.8", + "meshline": "^3.3.1", + "react-composer": "^5.0.3", + "stats-gl": "^2.2.8", + "stats.js": "^0.17.0", + "suspend-react": "^0.1.3", + "three-mesh-bvh": "^0.7.8", + "three-stdlib": "^2.35.6", + "troika-three-text": "^0.52.0", + "tunnel-rat": "^0.1.2", + "utility-types": "^3.11.0", + "zustand": "^5.0.1" + }, + "peerDependencies": { + "@react-three/fiber": "^8", + "react": "^18", + "react-dom": "^18", + "three": ">=0.137" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/@react-three/drei/node_modules/zustand": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.10.tgz", + "integrity": "sha512-U1AiltS1O9hSy3rul+Ub82ut2fqIAefiSuwECWt6jlMVUGejvf+5omLcRBSzqbRagSM3hQZbtzdeRc6QVScXTg==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "immer": ">=9.0.6", + "react": ">=18.0.0", + "use-sync-external-store": ">=1.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + }, + "use-sync-external-store": { + "optional": true + } + } + }, + "node_modules/@react-three/fiber": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@react-three/fiber/-/fiber-8.18.0.tgz", + "integrity": "sha512-FYZZqD0UUHUswKz3LQl2Z7H24AhD14XGTsIRw3SJaXUxyfVMi+1yiZGmqTcPt/CkPpdU7rrxqcyQ1zJE5DjvIQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.17.8", + "@types/react-reconciler": "^0.26.7", + "@types/webxr": "*", + "base64-js": "^1.5.1", + "buffer": "^6.0.3", + "its-fine": "^1.0.6", + "react-reconciler": "^0.27.0", + "react-use-measure": "^2.1.7", + "scheduler": "^0.21.0", + "suspend-react": "^0.1.3", + "zustand": "^3.7.1" + }, + "peerDependencies": { + "expo": ">=43.0", + "expo-asset": ">=8.4", + "expo-file-system": ">=11.0", + "expo-gl": ">=11.0", + "react": ">=18 <19", + "react-dom": ">=18 <19", + "react-native": ">=0.64", + "three": ">=0.133" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + }, + "expo-asset": { + "optional": true + }, + "expo-file-system": { + "optional": true + }, + "expo-gl": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/@react-three/fiber/node_modules/scheduler": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", + "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/@react-three/fiber/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "license": "MIT", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, "node_modules/@remix-run/router": { "version": "1.23.2", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.2.tgz", @@ -4374,6 +4621,12 @@ "@testing-library/dom": ">=7.21.4" } }, + "node_modules/@tweenjs/tween.js": { + "version": "23.1.3", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-23.1.3.tgz", + "integrity": "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==", + "license": "MIT" + }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -4445,6 +4698,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/draco3d": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@types/draco3d/-/draco3d-1.4.10.tgz", + "integrity": "sha512-AX22jp8Y7wwaBgAixaSvkoG4M/+PlAcm3Qs4OW8yT9DM4xUpWKeFhLueTAyZF39pviAdcDdeJoACapiAceqNcw==", + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -4519,6 +4778,12 @@ "license": "MIT", "peer": true }, + "node_modules/@types/offscreencanvas": { + "version": "2019.7.3", + "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz", + "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==", + "license": "MIT" + }, "node_modules/@types/pako": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz", @@ -4530,14 +4795,12 @@ "version": "15.7.15", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", - "devOptional": true, "license": "MIT" }, "node_modules/@types/react": { "version": "18.3.27", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.27.tgz", "integrity": "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==", - "devOptional": true, "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -4554,6 +4817,15 @@ "@types/react": "^18.0.0" } }, + "node_modules/@types/react-reconciler": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.26.7.tgz", + "integrity": "sha512-mBDYl8x+oyPX/VBb3E638N0B7xG+SPk/EAMcVPeexqus/5aTpTphQi0curhhshOqRrc9t6OPoJfEUkbymse/lQ==", + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/sax": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", @@ -4564,6 +4836,26 @@ "@types/node": "*" } }, + "node_modules/@types/stats.js": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz", + "integrity": "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==", + "license": "MIT" + }, + "node_modules/@types/three": { + "version": "0.172.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.172.0.tgz", + "integrity": "sha512-LrUtP3FEG26Zg5WiF0nbg8VoXiKokBLTcqM2iLvM9vzcfEiYmmBAPGdBgV0OYx9fvWlY3R/3ERTZcD9X5sc0NA==", + "license": "MIT", + "dependencies": { + "@tweenjs/tween.js": "~23.1.3", + "@types/stats.js": "*", + "@types/webxr": "*", + "@webgpu/types": "*", + "fflate": "~0.8.2", + "meshoptimizer": "~0.18.1" + } + }, "node_modules/@types/tough-cookie": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", @@ -4579,6 +4871,12 @@ "optional": true, "peer": true }, + "node_modules/@types/webxr": { + "version": "0.5.24", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.24.tgz", + "integrity": "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==", + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.53.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.0.tgz", @@ -4848,6 +5146,24 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@use-gesture/core": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@use-gesture/core/-/core-10.3.1.tgz", + "integrity": "sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw==", + "license": "MIT" + }, + "node_modules/@use-gesture/react": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@use-gesture/react/-/react-10.3.1.tgz", + "integrity": "sha512-Yy19y6O2GJq8f7CHf7L0nxL8bf4PZCPaVOCgJrusOeFHY1LvHgYXnmnXg6N5iwAnbgbZCDjo60SiM6IPJi9C5g==", + "license": "MIT", + "dependencies": { + "@use-gesture/core": "10.3.1" + }, + "peerDependencies": { + "react": ">= 16.8.0" + } + }, "node_modules/@vitejs/plugin-react": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", @@ -4953,6 +5269,12 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@webgpu/types": { + "version": "0.1.69", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.69.tgz", + "integrity": "sha512-RPmm6kgRbI8e98zSD3RVACvnuktIja5+yLgDAkTmxLr90BEwdTXRQWNLF3ETTTyH/8mKhznZuN5AveXYFEsMGQ==", + "license": "BSD-3-Clause" + }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", @@ -5432,7 +5754,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", - "dev": true, "license": "MIT", "dependencies": { "require-from-string": "^2.0.2" @@ -5779,6 +6100,15 @@ "node": ">= 6" } }, + "node_modules/camera-controls": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/camera-controls/-/camera-controls-2.10.1.tgz", + "integrity": "sha512-KnaKdcvkBJ1Irbrzl8XD6WtZltkRjp869Jx8c0ujs9K+9WD+1D7ryBsCiVqJYUqt6i/HR5FxT7RLASieUD+Q5w==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.126.1" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001764", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz", @@ -6391,11 +6721,28 @@ "dev": true, "license": "MIT" }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -6527,7 +6874,6 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "devOptional": true, "license": "MIT" }, "node_modules/data-urls": { @@ -6697,6 +7043,15 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/detect-gpu": { + "version": "5.0.70", + "resolved": "https://registry.npmjs.org/detect-gpu/-/detect-gpu-5.0.70.tgz", + "integrity": "sha512-bqerEP1Ese6nt3rFkwPnGbsUF9a4q+gMmpTVVOEzoCyeCc+y7/RvJnQZJx1JwhgQI5Ntg0Kgat8Uu7XpBqnz1w==", + "license": "MIT", + "dependencies": { + "webgl-constants": "^1.1.1" + } + }, "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -6805,6 +7160,12 @@ "node": ">=8" } }, + "node_modules/draco3d": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.7.tgz", + "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==", + "license": "Apache-2.0" + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -7999,6 +8360,12 @@ "reusify": "^1.0.4" } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -8473,6 +8840,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/glsl-noise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/glsl-noise/-/glsl-noise-0.0.0.tgz", + "integrity": "sha512-b/ZCF6amfAUb7dJM/MxRs7AetQEahYzJ8PtgfrmEdtw6uyGOr+ZSGtgjFm6mfsBkxJ4d2W7kg+Nlqzqvn3Bc0w==", + "license": "MIT" + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -8668,6 +9041,12 @@ "node": "*" } }, + "node_modules/hls.js": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.6.15.tgz", + "integrity": "sha512-E3a5VwgXimGHwpRGV+WxRTKeSp2DW5DI5MWv34ulL3t5UNmyJWCQ1KmLEHbYzcfThfXG8amBL+fCYPneGHC4VA==", + "license": "Apache-2.0" + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -8782,6 +9161,12 @@ "node": ">= 4" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "license": "MIT" + }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", @@ -9252,6 +9637,12 @@ "dev": true, "license": "MIT" }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "license": "MIT" + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -9435,7 +9826,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, "license": "ISC" }, "node_modules/isomorphic-timers-promises": { @@ -9484,6 +9874,27 @@ "node": ">= 0.4" } }, + "node_modules/its-fine": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-1.2.5.tgz", + "integrity": "sha512-fXtDA0X0t0eBYAGLVM5YsgJGsJ5jEmqZEPrGbzdf5awjv0xE7nqv3TVnvtUF060Tkes15DbDAKW/I48vsb6SyA==", + "license": "MIT", + "dependencies": { + "@types/react-reconciler": "^0.28.0" + }, + "peerDependencies": { + "react": ">=18.0" + } + }, + "node_modules/its-fine/node_modules/@types/react-reconciler": { + "version": "0.28.9", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.28.9.tgz", + "integrity": "sha512-HHM3nxyUZ3zAylX8ZEyrDNd2XZOnQ0D5XfunJF5FLQnZbHHYq4UWvW1QfelQNXv1ICNkwYhfxjwfnqivYB6bFg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*" + } + }, "node_modules/java-properties": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", @@ -9701,6 +10112,15 @@ "node": ">= 0.8.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/lilconfig": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", @@ -9882,6 +10302,16 @@ "lz-string": "bin/bin.js" } }, + "node_modules/maath": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/maath/-/maath-0.10.8.tgz", + "integrity": "sha512-tRvbDF0Pgqz+9XUa4jjfgAQ8/aPKmQdWXilFu2tMy4GWj4NOsx99HlULO4IeREfbO3a0sA145DZYyvXPkybm0g==", + "license": "MIT", + "peerDependencies": { + "@types/three": ">=0.134.0", + "three": ">=0.134.0" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -10006,6 +10436,21 @@ "node": ">= 8" } }, + "node_modules/meshline": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/meshline/-/meshline-3.3.1.tgz", + "integrity": "sha512-/TQj+JdZkeSUOl5Mk2J7eLcYTLiQm2IDzmlSvYm7ov15anEcDJ92GHqqazxTSreeNgfnYu24kiEvvv0WlbCdFQ==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.137" + } + }, + "node_modules/meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==", + "license": "MIT" + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -13088,7 +13533,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -13459,6 +13903,12 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "license": "MIT" }, + "node_modules/potpack": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", + "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==", + "license": "ISC" + }, "node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -13579,6 +14029,16 @@ "dev": true, "license": "MIT" }, + "node_modules/promise-worker-transferable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/promise-worker-transferable/-/promise-worker-transferable-1.0.4.tgz", + "integrity": "sha512-bN+0ehEnrXfxV2ZQvU2PetO0n4gqBD4ulq3MI1WOPLgr7/Mg9yRQkX5+0v1vagr74ZTsl7XtzlaYDo2EuCeYJw==", + "license": "Apache-2.0", + "dependencies": { + "is-promise": "^2.1.0", + "lie": "^3.0.2" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -13722,6 +14182,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-composer": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/react-composer/-/react-composer-5.0.3.tgz", + "integrity": "sha512-1uWd07EME6XZvMfapwZmc7NgCZqDemcvicRi3wMJzXsQLvZ3L7fTHVyPy1bZdnWXM4iPjYuNE+uJ41MLKeTtnA==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.6.0" + }, + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -13773,6 +14245,31 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/react-reconciler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.27.0.tgz", + "integrity": "sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.21.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "react": "^18.0.0" + } + }, + "node_modules/react-reconciler/node_modules/scheduler": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", + "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/react-refresh": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", @@ -13884,6 +14381,21 @@ } } }, + "node_modules/react-use-measure": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/react-use-measure/-/react-use-measure-2.1.7.tgz", + "integrity": "sha512-KrvcAo13I/60HpwGO5jpW7E9DfusKyLPLvuHlUyP5zqnmAPhNc6qTRjUQrdTADl0lpPpDVU2/Gg51UlOGHXbdg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.13", + "react-dom": ">=16.13" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -14161,7 +14673,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -14949,7 +15460,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -14962,7 +15472,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -15303,6 +15812,32 @@ "escodegen": "^1.8.1" } }, + "node_modules/stats-gl": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/stats-gl/-/stats-gl-2.4.2.tgz", + "integrity": "sha512-g5O9B0hm9CvnM36+v7SFl39T7hmAlv541tU81ME8YeSb3i1CIP5/QdDeSB3A0la0bKNHpxpwxOVRo2wFTYEosQ==", + "license": "MIT", + "dependencies": { + "@types/three": "*", + "three": "^0.170.0" + }, + "peerDependencies": { + "@types/three": "*", + "three": "*" + } + }, + "node_modules/stats-gl/node_modules/three": { + "version": "0.170.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.170.0.tgz", + "integrity": "sha512-FQK+LEpYc0fBD+J8g6oSEyyNzjp+Q7Ks1C568WWaoMRLW+TkNNWmenWeGgJjV105Gd+p/2ql1ZcjYvNiPZBhuQ==", + "license": "MIT" + }, + "node_modules/stats.js": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/stats.js/-/stats.js-0.17.0.tgz", + "integrity": "sha512-hNKz8phvYLPEcRkeG1rsGmV5ChMjKDAWU7/OJJdDErPBNChQXxCo3WZurGpnWc6gZhAzEPFad1aVgyOANH1sMw==", + "license": "MIT" + }, "node_modules/std-env": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", @@ -15686,6 +16221,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/suspend-react": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/suspend-react/-/suspend-react-0.1.3.tgz", + "integrity": "sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ==", + "license": "MIT", + "peerDependencies": { + "react": ">=17.0" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -15872,6 +16416,45 @@ "node": ">=0.8" } }, + "node_modules/three": { + "version": "0.172.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.172.0.tgz", + "integrity": "sha512-6HMgMlzU97MsV7D/tY8Va38b83kz8YJX+BefKjspMNAv0Vx6dxMogHOrnRl/sbMIs3BPUKijPqDqJ/+UwJbIow==", + "license": "MIT" + }, + "node_modules/three-mesh-bvh": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/three-mesh-bvh/-/three-mesh-bvh-0.7.8.tgz", + "integrity": "sha512-BGEZTOIC14U0XIRw3tO4jY7IjP7n7v24nv9JXS1CyeVRWOCkcOMhRnmENUjuV39gktAw4Ofhr0OvIAiTspQrrw==", + "deprecated": "Deprecated due to three.js version incompatibility. Please use v0.8.0, instead.", + "license": "MIT", + "peerDependencies": { + "three": ">= 0.151.0" + } + }, + "node_modules/three-stdlib": { + "version": "2.36.1", + "resolved": "https://registry.npmjs.org/three-stdlib/-/three-stdlib-2.36.1.tgz", + "integrity": "sha512-XyGQrFmNQ5O/IoKm556ftwKsBg11TIb301MB5dWNicziQBEs2g3gtOYIf7pFiLa0zI2gUwhtCjv9fmjnxKZ1Cg==", + "license": "MIT", + "dependencies": { + "@types/draco3d": "^1.4.0", + "@types/offscreencanvas": "^2019.6.4", + "@types/webxr": "^0.5.2", + "draco3d": "^1.4.1", + "fflate": "^0.6.9", + "potpack": "^1.0.1" + }, + "peerDependencies": { + "three": ">=0.128.0" + } + }, + "node_modules/three-stdlib/node_modules/fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==", + "license": "MIT" + }, "node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -16126,6 +16709,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/troika-three-text": { + "version": "0.52.4", + "resolved": "https://registry.npmjs.org/troika-three-text/-/troika-three-text-0.52.4.tgz", + "integrity": "sha512-V50EwcYGruV5rUZ9F4aNsrytGdKcXKALjEtQXIOBfhVoZU9VAqZNIoGQ3TMiooVqFAbR1w15T+f+8gkzoFzawg==", + "license": "MIT", + "dependencies": { + "bidi-js": "^1.0.2", + "troika-three-utils": "^0.52.4", + "troika-worker-utils": "^0.52.0", + "webgl-sdf-generator": "1.1.1" + }, + "peerDependencies": { + "three": ">=0.125.0" + } + }, + "node_modules/troika-three-utils": { + "version": "0.52.4", + "resolved": "https://registry.npmjs.org/troika-three-utils/-/troika-three-utils-0.52.4.tgz", + "integrity": "sha512-NORAStSVa/BDiG52Mfudk4j1FG4jC4ILutB3foPnfGbOeIs9+G5vZLa0pnmnaftZUGm4UwSoqEpWdqvC7zms3A==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.125.0" + } + }, + "node_modules/troika-worker-utils": { + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/troika-worker-utils/-/troika-worker-utils-0.52.0.tgz", + "integrity": "sha512-W1CpvTHykaPH5brv5VHLfQo9D1OYuo0cSBEUQFFT/nBUzM8iD6Lq2/tgG/f1OelbAS1WtaTPQzE5uM49egnngw==", + "license": "MIT" + }, "node_modules/ts-api-utils": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", @@ -16169,6 +16782,15 @@ "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } }, + "node_modules/tunnel-rat": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tunnel-rat/-/tunnel-rat-0.1.2.tgz", + "integrity": "sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ==", + "license": "MIT", + "dependencies": { + "zustand": "^4.3.2" + } + }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -16578,6 +17200,15 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/utility-types": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", + "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -17355,6 +17986,17 @@ "license": "Apache-2.0", "peer": true }, + "node_modules/webgl-constants": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webgl-constants/-/webgl-constants-1.1.1.tgz", + "integrity": "sha512-LkBXKjU5r9vAW7Gcu3T5u+5cvSvh5WwINdr0C+9jpzVB41cjQAP5ePArDtk/WHYdVj0GefCgM73BA7FlIiNtdg==" + }, + "node_modules/webgl-sdf-generator": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webgl-sdf-generator/-/webgl-sdf-generator-1.1.1.tgz", + "integrity": "sha512-9Z0JcMTFxeE+b2x1LJTdnaT8rT8aEp7MVxkNwoycNmJWwPdzoXzMh0BjJSh/AEFP+KPYZUli814h8bJZFIZ2jA==", + "license": "MIT" + }, "node_modules/webidl-conversions": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.1.tgz", @@ -17393,7 +18035,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" diff --git a/package.json b/package.json index c0cba3d..7158256 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,10 @@ "dependencies": { "@algolia/autocomplete-core": "^1.19.4", "@goodtools/jdserialize": "^1.0.0", + "@goodtools/meshrepair": "^0.1.1", "@goodtools/protobuf-decoder": "^1.0.0", + "@react-three/drei": "^9.92.7", + "@react-three/fiber": "^8.15.12", "@goodtools/wiregasm": "^1.9.0", "@headlessui/react": "^1.7.7", "@heroicons/react": "^2.0.13", @@ -47,6 +50,7 @@ "tailwind-merge": "^3.4.0", "tailwindcss": "^3.2.4", "tailwindcss-animate": "^1.0.7", + "three": "^0.172.0", "web-vitals": "^2.1.4", "xml-formatter": "^3.6.7", "zustand": "^4.1.5" @@ -92,6 +96,7 @@ "@types/pako": "^2.0.3", "@types/react": "^18.2.79", "@types/react-dom": "^18.2.25", + "@types/three": "^0.172.0", "@vitejs/plugin-react": "^4.3.4", "eslint": "^9.39.2", "eslint-config-prettier": "^10.1.8", @@ -107,4 +112,4 @@ "vite-plugin-node-polyfills": "^0.25.0", "vitest": "^4.0.17" } -} +} \ No newline at end of file diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index ff693d7..89dcb63 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -104,6 +104,7 @@ export function Sidebar() { [CATEGORIES.ENCODING]: [], [CATEGORIES.SECURITY]: [], [CATEGORIES.NETWORK]: [], + [CATEGORIES['3D']]: [], } const toolsToShow = searchQuery diff --git a/src/config/routes.config.ts b/src/config/routes.config.ts index e4c250a..bded078 100644 --- a/src/config/routes.config.ts +++ b/src/config/routes.config.ts @@ -19,6 +19,7 @@ export const ROUTES = { 'json-formatter': '/json', 'json-escape': '/json-escape', 'xml-formatter': '/xml', + 'stl-repair': '/stl-repair', } as const export type ToolKey = keyof typeof ROUTES diff --git a/src/config/tools.config.tsx b/src/config/tools.config.tsx index ba5f0ba..2fd3c77 100644 --- a/src/config/tools.config.tsx +++ b/src/config/tools.config.tsx @@ -15,6 +15,7 @@ import { Braces, Code2, Quote, + Box, } from 'lucide-react' import { ROUTES } from './routes.config' import { CATEGORIES, type Tool } from '@/types/tool.types' @@ -200,6 +201,26 @@ export const tools: Tool[] = [ return
This tool uses a large (~18 MB) WASM binary for packet dissection in your browser.
}, }, + { + title: 'STL Repair', + href: ROUTES['stl-repair'], + description: 'Repair and fix STL mesh files for 3D printing - fill holes, fix normals, remove duplicates', + icon: Box, + categories: [CATEGORIES['3D']], + searchTags: ['stl', 'mesh', 'repair', '3d', 'print', 'fix', 'holes', 'normals', 'manifold', 'cad'], + component: React.lazy(() => import('@/tools/STLRepair')), + online: false, + dependencies: [ + { + name: '@goodtools/meshrepair', + url: 'https://www.npmjs.com/package/@goodtools/meshrepair', + }, + { + name: 'three.js', + url: 'https://threejs.org', + }, + ], + }, { title: 'Whats My IP', href: ROUTES['whats-my-ip'], diff --git a/src/lib/categories.ts b/src/lib/categories.ts index c40c32c..f266f6f 100644 --- a/src/lib/categories.ts +++ b/src/lib/categories.ts @@ -1,4 +1,4 @@ -import { Layers, Code, Binary, Shield, Globe, type LucideIcon } from 'lucide-react' +import { Layers, Code, Binary, Shield, Globe, Box, type LucideIcon } from 'lucide-react' import { CATEGORIES, type CategoryName, type Tool, type ToolCategory } from '@/types/tool.types' // Re-export for convenience @@ -13,6 +13,7 @@ export const categories: ToolCategory[] = [ { name: CATEGORIES.ENCODING, icon: Binary }, { name: CATEGORIES.SECURITY, icon: Shield }, { name: CATEGORIES.NETWORK, icon: Globe }, + { name: CATEGORIES['3D'], icon: Box }, ] /** diff --git a/src/tools/STLRepair.tsx b/src/tools/STLRepair.tsx new file mode 100644 index 0000000..a5c239a --- /dev/null +++ b/src/tools/STLRepair.tsx @@ -0,0 +1,698 @@ +import { useState, useRef, useCallback, useEffect } from 'react' +import { Canvas, useThree, useFrame } from '@react-three/fiber' +import { OrbitControls } from '@react-three/drei' +import * as THREE from 'three' +import { STLLoader } from 'three/addons/loaders/STLLoader.js' +import { MeshRepair, PRESETS, type RepairOptions, type RepairResult } from '@goodtools/meshrepair' +// @ts-expect-error - No type declarations for WASM loader subpath export +import loadMeshRepair from '@goodtools/meshrepair/dist/meshrepair.js' +// Import WASM file as URL asset (like wiregasm pattern) +import wasmPath from '@goodtools/meshrepair/dist/meshrepair.wasm?url' +import { Button } from '@/components/Button' +import { XCircleIcon, ArrowDownTrayIcon, TrashIcon, DocumentTextIcon } from '@heroicons/react/24/outline' + +// Preset type +type PresetName = 'minimal' | 'print-ready' | 'aggressive' | 'custom' + +// Shared camera state for syncing viewers +interface CameraState { + position: THREE.Vector3 + target: THREE.Vector3 +} + +// Component to sync camera state to external ref +function CameraSync({ + cameraStateRef, + isLeader, +}: { + cameraStateRef: React.MutableRefObject + isLeader: boolean +}) { + const { camera } = useThree() + const controlsRef = useRef<{ target: THREE.Vector3; update: () => void } | null>(null) + + useFrame(() => { + if (isLeader && controlsRef.current) { + // Leader: copy camera state to shared ref + cameraStateRef.current.position.copy(camera.position) + cameraStateRef.current.target.copy(controlsRef.current.target) + } else if (!isLeader && controlsRef.current) { + // Follower: copy shared ref to camera state + camera.position.copy(cameraStateRef.current.position) + controlsRef.current.target.copy(cameraStateRef.current.target) + // Force controls to update + controlsRef.current.update() + } + }) + + return ( + } + enableDamping={false} + enabled={isLeader} + makeDefault={isLeader} + /> + ) +} + +// STL Mesh display component - manually centers using provided offset for consistent alignment +function STLMesh({ + geometry, + centerOffset, +}: { + geometry: THREE.BufferGeometry | null + centerOffset: THREE.Vector3 | null +}) { + if (!geometry) return null + + // If we have a center offset, use it; otherwise compute from this geometry + const offset = + centerOffset ?? + (() => { + geometry.computeBoundingBox() + const center = new THREE.Vector3() + geometry.boundingBox?.getCenter(center) + return center.negate() + })() + + return ( + + + + + + ) +} + +// 3D Viewer component +function Viewer({ + geometry, + label, + cameraStateRef, + isLeader, + centerOffset, + loading, +}: { + geometry: THREE.BufferGeometry | null + label: string + cameraStateRef: React.MutableRefObject + isLeader: boolean + centerOffset: THREE.Vector3 | null + loading?: boolean +}) { + return ( +
+
+ {label} +
+
+ {loading ? ( +
+ + Processing Mesh... +
+ ) : geometry ? ( + + + + + + + + ) : ( +
+ No model loaded +
+ )} +
+
+ ) +} + +// Statistics display +function Stats({ label, geometry }: { label: string; geometry: THREE.BufferGeometry | null }) { + if (!geometry) return null + + const position = geometry.getAttribute('position') + const vertexCount = position ? position.count : 0 + const faceCount = Math.floor(vertexCount / 3) + + return ( +
+ {label}: {faceCount.toLocaleString()} faces, {vertexCount.toLocaleString()}{' '} + vertices +
+ ) +} + +// Repair result display +function RepairStats({ result }: { result: RepairResult | null }) { + if (!result) return null + + const stats = [ + { label: 'Duplicate vertices removed', value: result.duplicateVerticesRemoved }, + { label: 'Duplicate faces removed', value: result.duplicateFacesRemoved }, + { label: 'Unreferenced vertices removed', value: result.unreferencedVerticesRemoved }, + { label: 'Degenerate faces removed', value: result.degenerateFacesRemoved }, + { label: 'Non-manifold faces removed', value: result.nonManifoldFacesRemoved }, + { label: 'Non-manifold vertices removed', value: result.nonManifoldVerticesRemoved }, + { label: 'Holes filled', value: result.holesFilled }, + ].filter((s) => s.value > 0) + + if (stats.length === 0) { + return ( +
+

✓ Mesh is already clean! No repairs were needed.

+
+ ) + } + + return ( +
+
+
+ + + +
+

Repair Complete!

+
+

Repair Statistics

+
+ {stats.map((stat) => ( +
+ {stat.label}: + {stat.value} +
+ ))} +
+
+
+ Original: + + {result.originalFaces.toLocaleString()} faces, {result.originalVertices.toLocaleString()} vertices + +
+
+ Repaired: + + {result.finalFaces.toLocaleString()} faces, {result.finalVertices.toLocaleString()} vertices + +
+
+
+ ) +} + +function STLRepair() { + // File state + const [fileName, setFileName] = useState(null) + const [originalBuffer, setOriginalBuffer] = useState(null) + const [repairedBuffer, setRepairedBuffer] = useState(null) + + // Geometry state + const [originalGeometry, setOriginalGeometry] = useState(null) + const [repairedGeometry, setRepairedGeometry] = useState(null) + // Center offset computed from original geometry - used to align both viewers + const [centerOffset, setCenterOffset] = useState(null) + + // Repair state + const [meshRepair, setMeshRepair] = useState(null) + const [loading, setLoading] = useState(false) + const [repairing, setRepairing] = useState(false) + const [progress, setProgress] = useState<{ step: string; value: number } | null>(null) + const [error, setError] = useState(null) + const [repairResult, setRepairResult] = useState(null) + + // Options state + const [preset, setPreset] = useState('print-ready') + const [options, setOptions] = useState({ ...PRESETS['print-ready'] }) + + // Camera sync + const cameraStateRef = useRef({ + position: new THREE.Vector3(0, 0, 100), + target: new THREE.Vector3(0, 0, 0), + }) + + // File input ref + const fileInputRef = useRef(null) + + // Initialize MeshRepair + useEffect(() => { + let cancelled = false + + async function init() { + try { + setLoading(true) + const instance = await MeshRepair.init(loadMeshRepair as never, { + // Use locateFile to point to the correct WASM path (imported as URL asset) + locateFile: (path: string) => { + if (path.endsWith('.wasm')) { + return wasmPath + } + return path + }, + }) + if (!cancelled) { + setMeshRepair(instance) + setLoading(false) + } + } catch (err) { + if (!cancelled) { + setError(`Failed to initialize MeshRepair: ${err instanceof Error ? err.message : String(err)}`) + setLoading(false) + } + } + } + + void init() + + return () => { + cancelled = true + } + }, []) + + // Parse STL buffer to geometry + const parseSTL = useCallback((buffer: ArrayBuffer): THREE.BufferGeometry => { + const loader = new STLLoader() + return loader.parse(buffer) + }, []) + + const handleFile = useCallback( + (file: File) => { + setError(null) + setRepairResult(null) + setRepairedBuffer(null) + setRepairedGeometry(null) + setFileName(file.name) + + const reader = new FileReader() + reader.onload = (e) => { + try { + const buffer = new Uint8Array(e.target?.result as ArrayBuffer) + setOriginalBuffer(buffer) + const geometry = parseSTL(buffer.buffer) + setOriginalGeometry(geometry) + + // Compute center offset from original geometry for consistent alignment + geometry.computeBoundingBox() + const center = new THREE.Vector3() + geometry.boundingBox?.getCenter(center) + setCenterOffset(center.negate()) + } catch (err) { + setError(`Failed to parse STL: ${err instanceof Error ? err.message : String(err)}`) + } + } + reader.readAsArrayBuffer(file) + }, + [parseSTL], + ) + + // Handle drag and drop + const handleDrop = useCallback( + (e: React.DragEvent) => { + e.preventDefault() + const file = e.dataTransfer.files[0] + if (file && file.name.toLowerCase().endsWith('.stl')) { + handleFile(file) + } else { + setError('Please drop a valid STL file') + } + }, + [handleFile], + ) + + // Handle file input change + const handleFileChange = useCallback( + (e: React.ChangeEvent) => { + const file = e.target.files?.[0] + if (file) { + handleFile(file) + } + }, + [handleFile], + ) + + // Handle preset change + const handlePresetChange = useCallback((newPreset: PresetName) => { + setPreset(newPreset) + if (newPreset !== 'custom') { + setOptions({ ...PRESETS[newPreset] }) + } + }, []) + + // Handle option change + const handleOptionChange = useCallback((key: keyof RepairOptions, value: boolean | number) => { + setPreset('custom') + setOptions((prev) => ({ ...prev, [key]: value })) + }, []) + + // Repair the mesh + const repair = useCallback(() => { + if (!meshRepair || !originalBuffer || !fileName) return + + setRepairing(true) + setError(null) + setProgress({ step: 'Starting...', value: 0 }) + + // Wrap in setTimeout to allow UI to render the loading state before the blocking WASM call + setTimeout(() => { + try { + const { result, output } = meshRepair.repair(fileName, originalBuffer, options, (step, value) => { + // Note: Since repair is synchronous, these updates won't render until after repair completes + // unless the browser finds a chance to paint (unlikely during blocking WASM). + // But we track it anyway. + setProgress({ step, value }) + }) + + if (result.code !== 0) { + throw new Error(result.error || 'Repair failed') + } + + setRepairedBuffer(output) + setRepairResult(result) + + const geometry = parseSTL(output.buffer.slice(0) as ArrayBuffer) + setRepairedGeometry(geometry) + } catch (err) { + setError(`Repair failed: ${err instanceof Error ? err.message : String(err)}`) + } finally { + setRepairing(false) + setProgress(null) + } + }, 100) + }, [meshRepair, originalBuffer, fileName, options, parseSTL]) + + // Download repaired file + const download = useCallback(() => { + if (!repairedBuffer || !fileName) return + + const blob = new Blob([repairedBuffer.slice()], { type: 'application/octet-stream' }) + const url = URL.createObjectURL(blob) + const a = document.createElement('a') + a.href = url + a.download = fileName.replace(/\.stl$/i, '_repaired.stl') + a.click() + URL.revokeObjectURL(url) + }, [repairedBuffer, fileName]) + + // Clear everything + const clear = useCallback(() => { + setFileName(null) + setOriginalBuffer(null) + setRepairedBuffer(null) + setOriginalGeometry(null) + setRepairedGeometry(null) + setCenterOffset(null) + setRepairResult(null) + setError(null) + if (fileInputRef.current) { + fileInputRef.current.value = '' + } + }, []) + + return ( +
+ {/* File Upload */} + {/* Hidden input for file selection - always present */} + + + {!fileName && ( + /* File Upload */ +
fileInputRef.current?.click()} + onDrop={handleDrop} + onDragOver={(e) => e.preventDefault()} + > + {loading ? ( +
+ + + + +

Initializing MeshRepair...

+
+ ) : ( +
+ +

Drop an STL file here, or click to select

+
+ )} +
+ )} + + {/* Error Display */} + {error && ( +
+
+
+
+ )} + + {/* Repair Options */} + {originalBuffer && ( +
+
+

Repair Options

+
+ + + {fileName} + + + {(originalBuffer.length / 1024 / 1024).toFixed(2)} MB +
+
+ + {/* Preset selector */} +
+ {(['minimal', 'print-ready', 'aggressive', 'custom'] as const).map((p) => ( + + ))} +
+ + {/* Options grid */} +
+ + + + + + +
+ + {/* Max hole size */} + {options.fillHoles && ( +
+ + handleOptionChange('maxHoleSize', parseInt(e.target.value) || 100)} + min={1} + max={1000} + className='w-24 px-2 py-1 text-sm rounded border border-gray-300 dark:border-zinc-600 dark:bg-zinc-700' + /> +
+ )} + + {/* Binary output toggle */} + +
+ )} + + {/* Repair Button */} + {/* Repair Button and Actions */} + {originalBuffer && ( +
+
+ + + {progress && ( +
+
{progress.step}
+
+
+
+
+ )} + + {repairedBuffer && ( + + )} +
+ + +
+ )} + + {/* Dual Viewer */} + {originalGeometry && ( +
+
+ +
+ +
+
+ +
+ +
+
+ )} + + {/* Repair Statistics */} + +
+ ) +} + +export default STLRepair diff --git a/src/types/tool.types.ts b/src/types/tool.types.ts index b288ff2..071da55 100644 --- a/src/types/tool.types.ts +++ b/src/types/tool.types.ts @@ -9,6 +9,7 @@ export const CATEGORIES = { ENCODING: 'Encoding', SECURITY: 'Security', NETWORK: 'Network', + '3D': '3D & CAD', } as const export type CategoryName = (typeof CATEGORIES)[keyof typeof CATEGORIES] diff --git a/vite.config.ts b/vite.config.ts index 2fc8de9..b26069b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -71,6 +71,8 @@ export default defineConfig({ include: [ "@goodtools/wiregasm", "@goodtools/wiregasm/dist/wiregasm", + "@goodtools/meshrepair", + "@goodtools/meshrepair/dist/meshrepair.js", "pako", "buffer" ],