Browse Source

support more ply type names

Alexander Rose 6 years ago
parent
commit
8bab72ea84
2 changed files with 14 additions and 5 deletions
  1. 4 4
      src/mol-io/reader/ply/parser.ts
  2. 10 1
      src/mol-io/reader/ply/schema.ts

+ 4 - 4
src/mol-io/reader/ply/parser.ts

@@ -139,11 +139,11 @@ function parseElements(state: State) {
 
 function getColumnSchema(type: PlyType): Column.Schema {
     switch (type) {
-        case 'char': case 'uchar':
-        case 'short': case 'ushort':
-        case 'int': case 'uint':
+        case 'char': case 'uchar': case 'int8': case 'uint8':
+        case 'short': case 'ushort': case 'int16': case 'uint16':
+        case 'int': case 'uint': case 'int32': case 'uint32':
             return Column.Schema.int
-        case 'float': case 'double':
+        case 'float': case 'double': case 'float32': case 'float64':
             return Column.Schema.float
     }
 }

+ 10 - 1
src/mol-io/reader/ply/schema.ts

@@ -17,7 +17,16 @@ export const PlyTypeByteLength = {
     'int': 4,
     'uint': 4,
     'float': 4,
-    'double': 8
+    'double': 8,
+
+    'int8': 1,
+    'uint8': 1,
+    'int16': 2,
+    'uint16': 2,
+    'int32': 4,
+    'uint32': 4,
+    'float32': 4,
+    'float64': 8
 }
 export type PlyType = keyof typeof PlyTypeByteLength
 export const PlyTypes = new Set(Object.keys(PlyTypeByteLength))