awv3
Version:
AWV client CAD framework
1,707 lines (1,706 loc) • 1.76 MB
JSON
{
"type": "Program",
"start": 0,
"end": 17337,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 501,
"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'"
}
},
{
"type": "ImportDeclaration",
"start": 442,
"end": 482,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 13,
"column": 40
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 449,
"end": 457,
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 13,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 449,
"end": 457,
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 13,
"column": 15
}
},
"name": "Defaults"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 463,
"end": 481,
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 39
}
},
"value": "../core/defaults",
"rawValue": "../core/defaults",
"raw": "'../core/defaults'"
},
"trailingComments": [
{
"type": "CommentLine",
"value": " options.pool = THREE.Object3D",
"start": 484,
"end": 516,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 15,
"column": 32
}
},
"range": [
484,
516
]
},
{
"type": "CommentLine",
"value": " options.factory = function()",
"start": 517,
"end": 548,
"loc": {
"start": {
"line": 16,
"column": 0
},
"end": {
"line": 16,
"column": 31
}
},
"range": [
517,
548
]
},
{
"type": "CommentLine",
"value": " options.",
"start": 549,
"end": 560,
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 17,
"column": 11
}
},
"range": [
549,
560
]
},
{
"type": "CommentLine",
"value": " when a pool exists operations can be fulfilled without needing a complex factory",
"start": 561,
"end": 644,
"loc": {
"start": {
"line": 18,
"column": 0
},
"end": {
"line": 18,
"column": 83
}
},
"range": [
561,
644
]
},
{
"type": "CommentLine",
"value": " this applies to assemblies, or even connected classcad transmissions",
"start": 645,
"end": 716,
"loc": {
"start": {
"line": 19,
"column": 0
},
"end": {
"line": 19,
"column": 71
}
},
"range": [
645,
716
]
},
{
"type": "CommentLine",
"value": " operations should always be awaited, the geometry parser should return promises as well",
"start": 717,
"end": 807,
"loc": {
"start": {
"line": 20,
"column": 0
},
"end": {
"line": 20,
"column": 90
}
},
"range": [
717,
807
]
},
{
"type": "CommentLine",
"value": " structural elements should be visible and uncompressed, only geometry should go to the worker",
"start": 808,
"end": 904,
"loc": {
"start": {
"line": 21,
"column": 0
},
"end": {
"line": 21,
"column": 96
}
},
"range": [
808,
904
]
},
{
"type": "CommentLine",
"value": " if the structure is laid out clear it can be processed in sequence",
"start": 905,
"end": 974,
"loc": {
"start": {
"line": 22,
"column": 0
},
"end": {
"line": 22,
"column": 69
}
},
"range": [
905,
974
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 976,
"end": 3138,
"loc": {
"start": {
"line": 24,
"column": 0
},
"end": {
"line": 77,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 991,
"end": 3138,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 77,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 997,
"end": 1003,
"loc": {
"start": {
"line": 24,
"column": 21
},
"end": {
"line": 24,
"column": 27
}
},
"name": "Parser",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 1004,
"end": 3138,
"loc": {
"start": {
"line": 24,
"column": 28
},
"end": {
"line": 77,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 1010,
"end": 1046,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 27,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 1010,
"end": 1021,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 1021,
"end": 1046,
"loc": {
"start": {
"line": 25,
"column": 15
},
"end": {
"line": 27,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 1024,
"end": 1046,
"loc": {
"start": {
"line": 25,
"column": 18
},
"end": {
"line": 27,
"column": 5
}
},
"body": [],
"leadingComments": [
{
"type": "CommentLine",
"value": " ...",
"start": 1034,
"end": 1040,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 14
}
},
"range": [
1034,
1040
]
}
],
"innerComments": [
{
"type": "CommentLine",
"value": " ...",
"start": 1034,
"end": 1040,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 14
}
},
"range": [
1034,
1040
]
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 1052,
"end": 2454,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 60,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 1058,
"end": 1064,
"loc": {
"start": {
"line": 29,
"column": 10
},
"end": {
"line": 29,
"column": 16
}
},
"name": "stream"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 1064,
"end": 2454,
"loc": {
"start": {
"line": 29,
"column": 16
},
"end": {
"line": 60,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": true,
"params": [
{
"type": "AssignmentPattern",
"start": 1065,
"end": 1097,
"loc": {
"start": {
"line": 29,
"column": 17
},
"end": {
"line": 29,
"column": 49
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 1065,
"end": 1068,
"loc": {
"start": {
"line": 29,
"column": 17
},
"end": {
"line": 29,
"column": 20
}
},
"name": "url"
},
"right": {
"type": "CallExpression",
"start": 1071,
"end": 1097,
"loc": {
"start": {
"line": 29,
"column": 23
},
"end": {
"line": 29,
"column": 49
}
},
"callee": {
"type": "MemberExpression",
"start": 1071,
"end": 1080,
"loc": {
"start": {
"line": 29,
"column": 23
},
"end": {
"line": 29,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 1071,
"end": 1076,
"loc": {
"start": {
"line": 29,
"column": 23
},
"end": {
"line": 29,
"column": 28
}
},
"name": "Error"
},
"property": {
"type": "Identifier",
"start": 1077,
"end": 1080,
"loc": {
"start": {
"line": 29,
"column": 29
},
"end": {
"line": 29,
"column": 32
}
},
"name": "log"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 1081,
"end": 1096,
"loc": {
"start": {
"line": 29,
"column": 33
},
"end": {
"line": 29,
"column": 48
}
},
"value": "Url undefined",
"rawValue": "Url undefined",
"raw": "\"Url undefined\""
}
]
}
},
{
"type": "AssignmentPattern",
"start": 1099,
"end": 1111,
"loc": {
"start": {
"line": 29,
"column": 51
},
"end": {
"line": 29,
"column": 63
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 1099,
"end": 1106,
"loc": {
"start": {
"line": 29,
"column": 51
},
"end": {
"line": 29,
"column": 58
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 1109,
"end": 1111,
"loc": {
"start": {
"line": 29,
"column": 61
},
"end": {
"line": 29,
"column": 63
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 1113,
"end": 2454,
"loc": {
"start": {
"line": 29,
"column": 65
},
"end": {
"line": 60,
"column": 5
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 1158,
"end": 1206,
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 32,
"column": 56
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 1162,
"end": 1205,
"loc": {
"start": {
"line": 32,
"column": 12
},
"end": {
"line": 32,
"column": 55
}
},
"id": {
"type": "Identifier",
"start": 1162,
"end": 1170,
"loc": {
"start": {
"line": 32,
"column": 12
},
"end": {
"line": 32,
"column": 20
}
},
"name": "requests",
"leadingComments": null
},
"init": {
"type": "ConditionalExpression",
"start": 1173,
"end": 1205,
"loc": {
"start": {
"line": 32,
"column": 23
},
"end": {
"line": 32,
"column": 55
}
},
"test": {
"type": "CallExpression",
"start": 1173,
"end": 1191,
"loc": {
"start": {
"line": 32,
"column": 23
},
"end": {
"line": 32,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 1173,
"end": 1186,
"loc": {
"start": {
"line": 32,
"column": 23
},
"end": {
"line": 32,
"column": 36
}
},
"object": {
"type": "Identifier",
"start": 1173,
"end": 1178,
"loc": {
"start": {
"line": 32,
"column": 23
},
"end": {
"line": 32,
"column": 28
}
},
"name": "Array"
},
"property": {
"type": "Identifier",
"start": 1179,
"end": 1186,
"loc": {
"start": {
"line": 32,
"column": 29
},
"end": {
"line": 32,
"column": 36
}
},
"name": "isArray"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 1187,
"end": 1190,
"loc": {
"start": {
"line": 32,
"column": 37
},
"end": {
"line": 32,
"column": 40
}
},
"name": "url"
}
]
},
"consequent": {
"type": "Identifier",
"start": 1194,
"end": 1197,
"loc": {
"start": {
"line": 32,
"column": 44
},
"end": {
"line": 32,
"column": 47
}
},
"name": "url"
},
"alternate": {
"type": "ArrayExpression",
"start": 1200,
"end": 1205,
"loc": {
"start": {
"line": 32,
"column": 50
},
"end": {
"line": 32,
"column": 55
}
},
"elements": [
{
"type": "Identifier",
"start": 1201,
"end": 1204,
"loc": {
"start": {
"line": 32,
"column": 51
},
"end": {
"line": 32,
"column": 54
}
},
"name": "url"
}
]
}
},
"leadingComments": null
}
],
"kind": "let",
"leadingComments": [
{
"type": "CommentLine",
"value": " Always assume an array",
"start": 1124,
"end": 1149,
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 31,
"column": 33
}
},
"range": [
1124,
1149
]
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " Map request-array into an array of promises and await them through Promises.all",
"start": 1216,
"end": 1298,
"loc": {
"start": {
"line": 34,
"column": 8
},
"end": {
"line": 34,
"column": 90
}
},
"range": [
1216,
1298
]
}
]
},
{
"type": "VariableDeclaration",
"start": 1307,
"end": 2125,
"loc": {
"start": {
"line": 35,
"column": 8
},
"end": {
"line": 52,
"column": 12
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 1311,
"end": 2124,
"loc": {
"start": {
"line": 35,
"column": 12
},
"end": {
"line": 52,
"column": 11
}
},
"id": {
"type": "Identifier",
"start": 1311,
"end": 1318,
"loc": {
"start": {
"line": 35,
"column": 12
},
"end": {
"line": 35,
"column": 19
}
},
"name": "results",
"leadingComments": null
},
"init": {
"type": "AwaitExpression",
"start": 1321,
"end": 2124,
"loc": {
"start": {
"line": 35,
"column": 22
},
"end": {
"line": 52,
"column": 11
}
},
"all": false,
"argument": {
"type": "CallExpression",
"start": 1327,
"end": 2124,
"loc": {
"start": {
"line": 35,
"column": 28
},
"end": {
"line": 52,
"column": 11
}
},
"callee": {
"type": "MemberExpression",
"start": 1327,
"end": 1338,
"loc": {
"start": {
"line": 35,
"column": 28
},
"end": {
"line": 35,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 1327,
"end": 1334,
"loc": {
"start": {
"line": 35,
"column": 28
},
"end": {
"line": 35,
"column": 35
}
},
"name": "Promise"
},
"property": {
"type": "Identifier",
"start": 1335,
"end": 1338,
"loc": {
"start": {
"line": 35,
"column": 36
},
"end": {
"line": 35,
"column": 39
}
},
"name": "all"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 1339,
"end": 2123,
"loc": {
"start": {
"line": 35,
"column": 40
},
"end": {
"line": 52,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 1339,
"end": 1351,
"loc": {
"start": {
"line": 35,
"column": 40
},
"end": {
"line": 35,
"column": 52
}
},
"object": {
"type": "Identifier",
"start": 1339,
"end": 1347,
"loc": {
"start": {
"line": 35,
"column": 40
},
"end": {
"line": 35,
"column": 48
}
},
"name": "requests"
},
"property": {
"type": "Identifier",
"start": 1348,
"end": 1351,
"loc": {
"start": {
"line": 35,
"column": 49
},
"end": {
"line": 35,
"column": 52
}
},
"name": "map"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 1352,
"end": 2122,
"loc": {
"start": {
"line": 35,
"column": 53
},
"end": {
"line": 52,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": true,
"params": [
{
"type": "Identifier",
"start": 1358,
"end": 1362,
"loc": {
"start": {
"line": 35,
"column": 59
},
"end": {
"line": 35,
"column": 63