lod export

This commit is contained in:
Andreas Wilms
2026-03-09 14:18:49 +01:00
parent 9b5f2d0814
commit d4ccff6342
2 changed files with 89 additions and 28 deletions

View File

@@ -8,8 +8,6 @@ export default function XgridsWizard() {
const workerRef = useRef<Worker | null>(null);
useEffect(() => {
// 1. Point to the NEW location in the /app folder
// Next.js recognizes the 'new URL' pattern and bundles it as a separate worker
const worker = new Worker(
new URL("./workers/converter.worker.ts", import.meta.url),
);
@@ -18,11 +16,17 @@ export default function XgridsWizard() {
worker.onmessage = (e) => {
const { type, message, data } = e.data;
if (type === "LOG") setStatus(message);
if (type === "DONE") {
setIsProcessing(false);
setStatus("Conversion Complete!");
downloadFile(data.sog, `${data.fileName}.sog`);
// Removed: downloadFile(data.ply, ...) — worker doesn't produce a PLY
setStatus(
`Conversion Complete! Downloading ${data.files.length} files...`,
);
// Loop through all generated files and trigger downloads
data.files.forEach((file: { name: string; blob: Blob }) => {
downloadFile(file.blob, file.name);
});
}
};