File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
6565import { STLLoader } from ' three/examples/jsm/loaders/STLLoader'
6666import { FBXLoader } from ' three/examples/jsm/loaders/FBXLoader'
6767import { OBJLoader } from ' three/examples/jsm/loaders/OBJLoader'
68+ import { PLYLoader } from ' three/examples/jsm/loaders/PLYLoader'
6869import { OrbitControls } from ' three/examples/jsm/controls/OrbitControls'
6970import {
7071 AppLoadingSpinner ,
@@ -216,7 +217,8 @@ const LoaderMap = {
216217 glb: GLTFLoader ,
217218 stl: STLLoader ,
218219 fbx: FBXLoader ,
219- obj: OBJLoader
220+ obj: OBJLoader ,
221+ ply: PLYLoader
220222}
221223
222224const materialParams = {
@@ -250,7 +252,7 @@ async function renderModel(extension: string) {
250252 }
251253
252254 const box = new Box3 ()
253- if (! model .hasOwnProperty (' scene' ) && extension === ' stl' ) {
255+ if (! model .hasOwnProperty (' scene' ) && [ ' stl' , ' ply ' ]. includes ( extension ) ) {
254256 const mesh = new Mesh (model , defaultMaterial ())
255257 scene .add (mesh )
256258 box .setFromBufferAttribute (model .attributes .position )
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ export const mimeTypes = {
22 fbx : 'application/octet-stream' ,
33 stl : 'application/vnd.ms-pki.stl' ,
44 obj : 'application/x-tgif' ,
5- glb : 'model/gltf-binary'
5+ glb : 'model/gltf-binary' ,
6+ ply : 'application/octet-stream'
67 // gltf: 'model/gltf+json'
78}
89
You can’t perform that action at this time.
0 commit comments