adds example PLY model

This commit is contained in:
buttle 2021-06-13 14:34:58 +02:00
parent 3afcc0af56
commit 081063647d
3 changed files with 15 additions and 1 deletions

Binary file not shown.

View File

@ -26,7 +26,7 @@ BASE_DIR = os.path.abspath(
'../') '../')
) )
OBJECT_DIR = os.path.join(BASE_DIR, 'objects') OBJECT_DIR = os.path.join(BASE_DIR, 'objects')
OBJECT_TYPES = ['gltf', 'glb', 'obj', 'fbx', 'stl', 'dae', 'json'] OBJECT_TYPES = ['gltf', 'glb', 'obj', 'fbx', 'stl', 'dae', 'json', 'ply']
def get_directory_content(dir_path): def get_directory_content(dir_path):
content = [] content = []
@ -112,6 +112,11 @@ def get_object(file_path, result={}):
object_path = str(file_path).replace(OBJECT_DIR, "") object_path = str(file_path).replace(OBJECT_DIR, "")
result['urls'].append(f"/objects{object_path}") result['urls'].append(f"/objects{object_path}")
return result return result
if extension == 'ply':
result['type'] = "ply"
object_path = str(file_path).replace(OBJECT_DIR, "")
result['urls'].append(f"/objects{object_path}")
return result
return None return None

View File

@ -66,6 +66,15 @@
> >
</model-three> </model-three>
%end %end
%if object['type'] == "ply":
<model-ply
:backgroundAlpha="0"
@on-load="onLoad"
:rotation="rotation"
src="{{ object['urls'][0] }}"
>
</model-ply>
%end
</div> </div>
</div> </div>