From 98424830b4a535b7788bd116be342ebc012a93b6 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 21 Sep 2022 16:28:39 +0200 Subject: Handle obj files --- pages/models/_id.vue | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'pages') diff --git a/pages/models/_id.vue b/pages/models/_id.vue index b5c3e2e..f1007de 100644 --- a/pages/models/_id.vue +++ b/pages/models/_id.vue @@ -12,11 +12,16 @@ :src="baseAPI + '' + model.uploads[selectedUpload].filepath" ) model-stl( - v-else + v-else-if="isStl(model.uploads[selectedUpload].filepath)" :rotate="rotate" :src="baseAPI + '' + model.uploads[selectedUpload].filepath" :backgroundColor="'#111827'" ) + model-obj( + v-else-if="isObj(model.uploads[selectedUpload].filepath)" + :src="baseAPI + '' + model.uploads[selectedUpload].filepath" + :backgroundColor="'#111827'" + ) .w-full.mt-8(class="md:w-1/5 md:mt-0" v-if="model") .grid.grid-cols-3.gap-4.h-full.overflow-y-auto.grid-mini(class="md:grid-cols-2") .border-2.border-gray-300.bg-gray-300.w-24.h-24.rounded-xl.grid.items-center.justify-items-center.overflow-hidden.cursor-pointer( @@ -30,12 +35,17 @@ :src="baseAPI + '' + upload.filepath" ) model-stl( - v-else + v-else-if="isStl(model.uploads[selectedUpload].filepath)" :rotate="rotate" :src="baseAPI + '' + upload.filepath" :backgroundColor="'#D1D5DB'" :controlsOptions="{'enablePan': false, 'enableZoom': false, 'enableRotate': false}" ) + model-obj( + v-else-if="isObj(model.uploads[selectedUpload].filepath)" + :src="baseAPI + '' + upload.filepath" + :backgroundColor="'#D1D5DB'" + ) section.mt-5 .grid.grid-cols-6.gap-5.mb-5 @@ -97,7 +107,7 @@