diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 315f807..8b09619 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -95,6 +95,23 @@ const Index = () => { } }, [setModel]); + const handleLoadDemoCotovelo = useCallback(async () => { + setLoadingDemoCotovelo(true); + try { + const response = await fetch('/models/B126-COTOVELO.ifc'); + const buffer = await response.arrayBuffer(); + const result = await convertIFCtoGLB(buffer, 'B126-COTOVELO.ifc'); + const url = URL.createObjectURL(result.blob); + setModel({ fileName: result.fileName, fileSize: result.fileSize, url }); + toast.success('Modelo demo "B126 Cotovelo" (IFC) carregado!'); + } catch (err) { + console.error(err); + toast.error('Falha ao converter modelo demo Cotovelo'); + } finally { + setLoadingDemoCotovelo(false); + } + }, [setModel]); + const handleEnterViewer = () => { if (!model) { toast.error('Importe um modelo GLB primeiro');