This commit is contained in:
gpt-engineer-app[bot]
2026-02-27 02:36:49 +00:00
parent 09d6b381a4
commit 11f16eff5a
5 changed files with 137 additions and 9 deletions
+3 -3
View File
@@ -3,15 +3,15 @@ import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js';
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js';
import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';
type SupportedExt = 'glb' | 'obj' | 'stl';
type SupportedExt = 'glb' | 'obj' | 'stl' | 'ifc';
export function getSupportedExtension(fileName: string): SupportedExt | null {
const ext = fileName.split('.').pop()?.toLowerCase();
if (ext === 'glb' || ext === 'obj' || ext === 'stl') return ext;
if (ext === 'glb' || ext === 'obj' || ext === 'stl' || ext === 'ifc') return ext;
return null;
}
export const ACCEPTED_EXTENSIONS = '.glb,.obj,.stl';
export const ACCEPTED_EXTENSIONS = '.glb,.obj,.stl,.ifc';
/**
* Convert an OBJ or STL file (ArrayBuffer) into a GLB Blob.