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
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Modello 3D caricato dal backoffice: l'originale non compresso (disco privato, conservato per
* sviluppi futuri) e la copia compressa con Draco servita al configuratore (disco public).
*/
return new class extends Migration
{
public function up(): void
{
Schema::table('modelli', function (Blueprint $table) {
$table->string('modello_3d')->nullable()->after('file_modello');
$table->string('modello_3d_draco')->nullable()->after('modello_3d');
$table->string('modello_3d_nome')->nullable()->after('modello_3d_draco');
$table->unsignedBigInteger('modello_3d_dimensione')->nullable()->after('modello_3d_nome');
$table->unsignedBigInteger('modello_3d_draco_dimensione')->nullable()->after('modello_3d_dimensione');
$table->timestamp('modello_3d_aggiornato_at')->nullable()->after('modello_3d_draco_dimensione');
});
}
public function down(): void
{
Schema::table('modelli', function (Blueprint $table) {
$table->dropColumn([
'modello_3d', 'modello_3d_draco', 'modello_3d_nome',
'modello_3d_dimensione', 'modello_3d_draco_dimensione', 'modello_3d_aggiornato_at',
]);
});
}
};