| 668 | // Load preview model |
| 669 | async function loadPreviewModel(filePath, loadToken) { |
| 670 | const ext = getPreviewExtension(filePath); |
| 671 | const fileType = document.getElementById('preview-file-type'); |
| 672 | |
| 673 | fileType.textContent = `Type: ${ext.toUpperCase()}`; |
| 674 | console.log('Loading model type:', ext); |
| 675 | |
| 676 | if (ext !== 'stl' && ext !== '3mf') { |
| 677 | throw new Error('Preview not available for this file type. Only STL and 3MF models can be previewed in 3D.'); |
| 678 | } |
| 679 | |
| 680 | const object = await createPreviewObjectFromPath(filePath, loadToken); |
| 681 | previewModel = object; |