feat: integrate Draco compression for 3D models in backoffice

- Added support for uploading and compressing GLB models using Draco in the backoffice.
- Implemented commands for importing and re-compressing 3D models.
- Updated model resource to handle 3D model uploads and validations.
- Introduced a new script for compressing GLB files with Draco.
- Modified Vite configuration to remove GLB files from the build output.
- Updated package dependencies to include GLTF-transform libraries for handling 3D models.
- Added tests to ensure proper functionality of 3D model handling and compression.
This commit is contained in:
2026-11-01 10:35:50 +01:00
parent 24f9e59654
commit 1208187a17
32 changed files with 895 additions and 52 deletions
+6 -2
View File
@@ -53,6 +53,9 @@ class CatalogoApiTest extends TestCase
// Senza listino il bilico non compare nel configuratore.
Modello::where('codice', '!=', 'bilico')->each(fn (Modello $m) => ListinoPrezzo::create(['modello_id' => $m->id, 'larghezza' => 1000, 'altezza' => 1000, 'prezzo' => 100]));
Sistema::create(['codice' => 'legno', 'nome' => 'Legno', 'attivo' => false]);
$this->conModelli3d();
// Senza modello 3D la finestra a 2 ante non compare nel configuratore.
Modello::where('codice', 'finestra_2_ante')->update(['modello_3d_draco' => null]);
$response = $this->getJson('/api/sistemi')->assertOk();
@@ -60,12 +63,13 @@ class CatalogoApiTest extends TestCase
$response->assertJsonPath('0.codice', 'pvc');
$modelli = collect($response->json('0.modelli'));
$this->assertSame(25, $modelli->count());
$this->assertSame(24, $modelli->count());
$this->assertNotContains('bilico', $modelli->pluck('id'));
$this->assertNotContains('finestra_2_ante', $modelli->pluck('id'));
$this->assertSame('finestra_1_anta', $modelli->first()['id']);
$this->assertNotContains('scorrevole_hst_4_ante', $modelli->pluck('id'));
$this->assertStringEndsWith('/storage/modelli/icone/pvc/finestra_1_anta.jpg', $modelli->first()['icona']);
$this->assertSame('finestra_1_anta.glb', $modelli->first()['modello']);
$this->assertStringEndsWith('/api/media/modelli-3d/draco/test.glb', $modelli->first()['modello_url']);
}
public function test_configurazione_di_un_modello_senza_listino_restituisce_404(): void