UNPKG

awv3

Version:
1,667 lines (1,666 loc) 1.75 MB
{ "type": "Program", "start": 0, "end": 17127, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 500, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 126, "end": 152, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 133, "end": 138, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 12 } }, "local": { "type": "Identifier", "start": 133, "end": 138, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 12 } }, "name": "THREE", "leadingComments": null }, "leadingComments": null } ], "importKind": "value", "source": { "type": "Literal", "start": 144, "end": 151, "loc": { "start": { "line": 5, "column": 18 }, "end": { "line": 5, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" }, "leadingComments": [ { "type": "CommentLine", "value": " TODO", "start": 0, "end": 7, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 7 } }, "range": [ 0, 7 ] }, { "type": "CommentLine", "value": " 1. doesn't need to be coupled to canvas AT ALL", "start": 8, "end": 57, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 49 } }, "range": [ 8, 57 ] }, { "type": "CommentLine", "value": " 2. Canvas events should be renamed to broardcasts to make sense", "start": 58, "end": 124, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 66 } }, "range": [ 58, 124 ] } ] }, { "type": "ImportDeclaration", "start": 153, "end": 179, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "specifiers": [], "source": { "type": "Literal", "start": 160, "end": 178, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 25 } }, "value": "isomorphic-fetch", "rawValue": "isomorphic-fetch", "raw": "'isomorphic-fetch'" } }, { "type": "ImportDeclaration", "start": 180, "end": 209, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 29 } }, "specifiers": [], "source": { "type": "Literal", "start": 187, "end": 208, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 28 } }, "value": "requestidlecallback", "rawValue": "requestidlecallback", "raw": "'requestidlecallback'" } }, { "type": "ImportDeclaration", "start": 210, "end": 249, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 39 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 217, "end": 227, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 17 } }, "local": { "type": "Identifier", "start": 222, "end": 227, "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 17 } }, "name": "Error" } } ], "importKind": "value", "source": { "type": "Literal", "start": 233, "end": 248, "loc": { "start": { "line": 8, "column": 23 }, "end": { "line": 8, "column": 38 } }, "value": "../core/error", "rawValue": "../core/error", "raw": "'../core/error'" } }, { "type": "ImportDeclaration", "start": 250, "end": 302, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 52 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 259, "end": 263, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 13 } }, "imported": { "type": "Identifier", "start": 259, "end": 263, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 13 } }, "name": "guid" }, "local": { "type": "Identifier", "start": 259, "end": 263, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 13 } }, "name": "guid" } }, { "type": "ImportSpecifier", "start": 265, "end": 276, "loc": { "start": { "line": 9, "column": 15 }, "end": { "line": 9, "column": 26 } }, "imported": { "type": "Identifier", "start": 265, "end": 276, "loc": { "start": { "line": 9, "column": 15 }, "end": { "line": 9, "column": 26 } }, "name": "Performance" }, "local": { "type": "Identifier", "start": 265, "end": 276, "loc": { "start": { "line": 9, "column": 15 }, "end": { "line": 9, "column": 26 } }, "name": "Performance" } } ], "importKind": "value", "source": { "type": "Literal", "start": 284, "end": 301, "loc": { "start": { "line": 9, "column": 34 }, "end": { "line": 9, "column": 51 } }, "value": "../core/helpers", "rawValue": "../core/helpers", "raw": "'../core/helpers'" } }, { "type": "ImportDeclaration", "start": 303, "end": 349, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 46 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 310, "end": 323, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 20 } }, "local": { "type": "Identifier", "start": 310, "end": 323, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 20 } }, "name": "WorkerFactory" } } ], "importKind": "value", "source": { "type": "Literal", "start": 329, "end": 348, "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 45 } }, "value": "../worker/factory", "rawValue": "../worker/factory", "raw": "'../worker/factory'" } }, { "type": "ImportDeclaration", "start": 350, "end": 389, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 357, "end": 364, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 14 } }, "local": { "type": "Identifier", "start": 357, "end": 364, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 14 } }, "name": "Object3" } } ], "importKind": "value", "source": { "type": "Literal", "start": 370, "end": 388, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 38 } }, "value": "../three/object3", "rawValue": "../three/object3", "raw": "'../three/object3'" } }, { "type": "ImportDeclaration", "start": 390, "end": 441, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 51 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 397, "end": 414, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 24 } }, "local": { "type": "Identifier", "start": 397, "end": 414, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 24 } }, "name": "MeshPhongMaterial" } } ], "importKind": "value", "source": { "type": "Literal", "start": 420, "end": 440, "loc": { "start": { "line": 12, "column": 30 }, "end": { "line": 12, "column": 50 } }, "value": "../materials/phong", "rawValue": "../materials/phong", "raw": "'../materials/phong'" }, "trailingComments": [ { "type": "CommentLine", "value": " options.pool = THREE.Object3D", "start": 443, "end": 475, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 32 } }, "range": [ 443, 475 ] }, { "type": "CommentLine", "value": " options.factory = function()", "start": 476, "end": 507, "loc": { "start": { "line": 15, "column": 0 }, "end": { "line": 15, "column": 31 } }, "range": [ 476, 507 ] }, { "type": "CommentLine", "value": " options.", "start": 508, "end": 519, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 11 } }, "range": [ 508, 519 ] }, { "type": "CommentLine", "value": " when a pool exists operations can be fulfilled without needing a complex factory", "start": 520, "end": 603, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 83 } }, "range": [ 520, 603 ] }, { "type": "CommentLine", "value": " this applies to assemblies, or even connected classcad transmissions", "start": 604, "end": 675, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 71 } }, "range": [ 604, 675 ] }, { "type": "CommentLine", "value": " operations should always be awaited, the geometry parser should return promises as well", "start": 676, "end": 766, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 19, "column": 90 } }, "range": [ 676, 766 ] }, { "type": "CommentLine", "value": " structural elements should be visible and uncompressed, only geometry should go to the worker", "start": 767, "end": 863, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 20, "column": 96 } }, "range": [ 767, 863 ] }, { "type": "CommentLine", "value": " if the structure is laid out clear it can be processed in sequence", "start": 864, "end": 933, "loc": { "start": { "line": 21, "column": 0 }, "end": { "line": 21, "column": 69 } }, "range": [ 864, 933 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 935, "end": 3097, "loc": { "start": { "line": 23, "column": 0 }, "end": { "line": 76, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 950, "end": 3097, "loc": { "start": { "line": 23, "column": 15 }, "end": { "line": 76, "column": 1 } }, "id": { "type": "Identifier", "start": 956, "end": 962, "loc": { "start": { "line": 23, "column": 21 }, "end": { "line": 23, "column": 27 } }, "name": "Parser", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 963, "end": 3097, "loc": { "start": { "line": 23, "column": 28 }, "end": { "line": 76, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 969, "end": 1005, "loc": { "start": { "line": 24, "column": 4 }, "end": { "line": 26, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 969, "end": 980, "loc": { "start": { "line": 24, "column": 4 }, "end": { "line": 24, "column": 15 } }, "name": "constructor" }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 980, "end": 1005, "loc": { "start": { "line": 24, "column": 15 }, "end": { "line": 26, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 983, "end": 1005, "loc": { "start": { "line": 24, "column": 18 }, "end": { "line": 26, "column": 5 } }, "body": [], "leadingComments": [ { "type": "CommentLine", "value": " ...", "start": 993, "end": 999, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 14 } }, "range": [ 993, 999 ] } ], "innerComments": [ { "type": "CommentLine", "value": " ...", "start": 993, "end": 999, "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 14 } }, "range": [ 993, 999 ] } ] } } }, { "type": "MethodDefinition", "start": 1011, "end": 2413, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 59, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 1017, "end": 1023, "loc": { "start": { "line": 28, "column": 10 }, "end": { "line": 28, "column": 16 } }, "name": "stream" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 1023, "end": 2413, "loc": { "start": { "line": 28, "column": 16 }, "end": { "line": 59, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": true, "params": [ { "type": "AssignmentPattern", "start": 1024, "end": 1056, "loc": { "start": { "line": 28, "column": 17 }, "end": { "line": 28, "column": 49 } }, "operator": "=", "left": { "type": "Identifier", "start": 1024, "end": 1027, "loc": { "start": { "line": 28, "column": 17 }, "end": { "line": 28, "column": 20 } }, "name": "url" }, "right": { "type": "CallExpression", "start": 1030, "end": 1056, "loc": { "start": { "line": 28, "column": 23 }, "end": { "line": 28, "column": 49 } }, "callee": { "type": "MemberExpression", "start": 1030, "end": 1039, "loc": { "start": { "line": 28, "column": 23 }, "end": { "line": 28, "column": 32 } }, "object": { "type": "Identifier", "start": 1030, "end": 1035, "loc": { "start": { "line": 28, "column": 23 }, "end": { "line": 28, "column": 28 } }, "name": "Error" }, "property": { "type": "Identifier", "start": 1036, "end": 1039, "loc": { "start": { "line": 28, "column": 29 }, "end": { "line": 28, "column": 32 } }, "name": "log" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 1040, "end": 1055, "loc": { "start": { "line": 28, "column": 33 }, "end": { "line": 28, "column": 48 } }, "value": "Url undefined", "rawValue": "Url undefined", "raw": "\"Url undefined\"" } ] } }, { "type": "AssignmentPattern", "start": 1058, "end": 1070, "loc": { "start": { "line": 28, "column": 51 }, "end": { "line": 28, "column": 63 } }, "operator": "=", "left": { "type": "Identifier", "start": 1058, "end": 1065, "loc": { "start": { "line": 28, "column": 51 }, "end": { "line": 28, "column": 58 } }, "name": "options" }, "right": { "type": "ObjectExpression", "start": 1068, "end": 1070, "loc": { "start": { "line": 28, "column": 61 }, "end": { "line": 28, "column": 63 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 1072, "end": 2413, "loc": { "start": { "line": 28, "column": 65 }, "end": { "line": 59, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 1117, "end": 1165, "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 31, "column": 56 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1121, "end": 1164, "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 55 } }, "id": { "type": "Identifier", "start": 1121, "end": 1129, "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 20 } }, "name": "requests", "leadingComments": null }, "init": { "type": "ConditionalExpression", "start": 1132, "end": 1164, "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 55 } }, "test": { "type": "CallExpression", "start": 1132, "end": 1150, "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 41 } }, "callee": { "type": "MemberExpression", "start": 1132, "end": 1145, "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 36 } }, "object": { "type": "Identifier", "start": 1132, "end": 1137, "loc": { "start": { "line": 31, "column": 23 }, "end": { "line": 31, "column": 28 } }, "name": "Array" }, "property": { "type": "Identifier", "start": 1138, "end": 1145, "loc": { "start": { "line": 31, "column": 29 }, "end": { "line": 31, "column": 36 } }, "name": "isArray" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 1146, "end": 1149, "loc": { "start": { "line": 31, "column": 37 }, "end": { "line": 31, "column": 40 } }, "name": "url" } ] }, "consequent": { "type": "Identifier", "start": 1153, "end": 1156, "loc": { "start": { "line": 31, "column": 44 }, "end": { "line": 31, "column": 47 } }, "name": "url" }, "alternate": { "type": "ArrayExpression", "start": 1159, "end": 1164, "loc": { "start": { "line": 31, "column": 50 }, "end": { "line": 31, "column": 55 } }, "elements": [ { "type": "Identifier", "start": 1160, "end": 1163, "loc": { "start": { "line": 31, "column": 51 }, "end": { "line": 31, "column": 54 } }, "name": "url" } ] } }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "CommentLine", "value": " Always assume an array", "start": 1083, "end": 1108, "loc": { "start": { "line": 30, "column": 8 }, "end": { "line": 30, "column": 33 } }, "range": [ 1083, 1108 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " Map request-array into an array of promises and await them through Promises.all", "start": 1175, "end": 1257, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 90 } }, "range": [ 1175, 1257 ] } ] }, { "type": "VariableDeclaration", "start": 1266, "end": 2084, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 51, "column": 12 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1270, "end": 2083, "loc": { "start": { "line": 34, "column": 12 }, "end": { "line": 51, "column": 11 } }, "id": { "type": "Identifier", "start": 1270, "end": 1277, "loc": { "start": { "line": 34, "column": 12 }, "end": { "line": 34, "column": 19 } }, "name": "results", "leadingComments": null }, "init": { "type": "AwaitExpression", "start": 1280, "end": 2083, "loc": { "start": { "line": 34, "column": 22 }, "end": { "line": 51, "column": 11 } }, "all": false, "argument": { "type": "CallExpression", "start": 1286, "end": 2083, "loc": { "start": { "line": 34, "column": 28 }, "end": { "line": 51, "column": 11 } }, "callee": { "type": "MemberExpression", "start": 1286, "end": 1297, "loc": { "start": { "line": 34, "column": 28 }, "end": { "line": 34, "column": 39 } }, "object": { "type": "Identifier", "start": 1286, "end": 1293, "loc": { "start": { "line": 34, "column": 28 }, "end": { "line": 34, "column": 35 } }, "name": "Promise" }, "property": { "type": "Identifier", "start": 1294, "end": 1297, "loc": { "start": { "line": 34, "column": 36 }, "end": { "line": 34, "column": 39 } }, "name": "all" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 1298, "end": 2082, "loc": { "start": { "line": 34, "column": 40 }, "end": { "line": 51, "column": 10 } }, "callee": { "type": "MemberExpression", "start": 1298, "end": 1310, "loc": { "start": { "line": 34, "column": 40 }, "end": { "line": 34, "column": 52 } }, "object": { "type": "Identifier", "start": 1298, "end": 1306, "loc": { "start": { "line": 34, "column": 40 }, "end": { "line": 34, "column": 48 } }, "name": "requests" }, "property": { "type": "Identifier", "start": 1307, "end": 1310, "loc": { "start": { "line": 34, "column": 49 }, "end": { "line": 34, "column": 52 } }, "name": "map" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 1311, "end": 2081, "loc": { "start": { "line": 34, "column": 53 }, "end": { "line": 51, "column": 9 } }, "id": null, "generator": false, "expression": false, "async": true, "params": [ { "type": "Identifier", "start": 1317, "end": 1321, "loc": { "start": { "line": 34, "column": 59 }, "end": { "line": 34, "column": 63 } }, "name": "item" } ], "body": { "type": "BlockStatement", "start": 1325, "end": 2081, "loc": { "start": { "line": 34, "column": 67 }, "end": { "line": 51, "column": 9 } }, "body": [ { "type": "VariableDeclaration", "start": 1565, "end": 1602, "loc": { "start": { "line": 40,