awv3
Version:
AWV client CAD framework
1,697 lines (1,696 loc) • 607 kB
JSON
{
"type": "Program",
"start": 0,
"end": 7333,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 194,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 53
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 8,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 22
}
},
"imported": {
"type": "Identifier",
"start": 8,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 22
}
},
"name": "ClassCadObject"
},
"local": {
"type": "Identifier",
"start": 8,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 22
}
},
"name": "ClassCadObject"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 29,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 29
},
"end": {
"line": 1,
"column": 52
}
},
"value": "../sketcher/ccobjects",
"rawValue": "../sketcher/ccobjects",
"raw": "'../sketcher/ccobjects'"
}
},
{
"type": "ImportDeclaration",
"start": 55,
"end": 99,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 44
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 62,
"end": 70,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 62,
"end": 70,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 15
}
},
"name": "Sketcher"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 76,
"end": 98,
"loc": {
"start": {
"line": 2,
"column": 21
},
"end": {
"line": 2,
"column": 43
}
},
"value": "../sketcher/sketcher",
"rawValue": "../sketcher/sketcher",
"raw": "'../sketcher/sketcher'"
}
},
{
"type": "ImportDeclaration",
"start": 101,
"end": 170,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 69
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 109,
"end": 119,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 18
}
},
"imported": {
"type": "Identifier",
"start": 109,
"end": 119,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 18
}
},
"name": "Expression"
},
"local": {
"type": "Identifier",
"start": 109,
"end": 119,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 18
}
},
"name": "Expression"
}
},
{
"type": "ImportSpecifier",
"start": 121,
"end": 130,
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 29
}
},
"imported": {
"type": "Identifier",
"start": 121,
"end": 130,
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 29
}
},
"name": "Statement"
},
"local": {
"type": "Identifier",
"start": 121,
"end": 130,
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 29
}
},
"name": "Statement"
}
},
{
"type": "ImportSpecifier",
"start": 132,
"end": 139,
"loc": {
"start": {
"line": 3,
"column": 31
},
"end": {
"line": 3,
"column": 38
}
},
"imported": {
"type": "Identifier",
"start": 132,
"end": 139,
"loc": {
"start": {
"line": 3,
"column": 31
},
"end": {
"line": 3,
"column": 38
}
},
"name": "parseTo"
},
"local": {
"type": "Identifier",
"start": 132,
"end": 139,
"loc": {
"start": {
"line": 3,
"column": 31
},
"end": {
"line": 3,
"column": 38
}
},
"name": "parseTo"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 146,
"end": 169,
"loc": {
"start": {
"line": 3,
"column": 45
},
"end": {
"line": 3,
"column": 68
}
},
"value": "../sketcher/cchelpers",
"rawValue": "../sketcher/cchelpers",
"raw": "'../sketcher/cchelpers'"
}
},
{
"type": "ImportDeclaration",
"start": 172,
"end": 204,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 32
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 179,
"end": 183,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 179,
"end": 183,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 11
}
},
"name": "View"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 189,
"end": 203,
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 31
}
},
"value": "../core/view",
"rawValue": "../core/view",
"raw": "'../core/view'"
}
},
{
"type": "ImportDeclaration",
"start": 206,
"end": 232,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 213,
"end": 218,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 213,
"end": 218,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 224,
"end": 231,
"loc": {
"start": {
"line": 5,
"column": 18
},
"end": {
"line": 5,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
},
"trailingComments": [
{
"type": "CommentLine",
"value": "asynchronous and caching image loader",
"start": 236,
"end": 275,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 39
}
},
"range": [
236,
275
]
}
]
},
{
"type": "VariableDeclaration",
"start": 277,
"end": 302,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 25
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 281,
"end": 301,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 24
}
},
"id": {
"type": "Identifier",
"start": 281,
"end": 296,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 19
}
},
"name": "loadedImagesMap",
"leadingComments": null
},
"init": {
"type": "ObjectExpression",
"start": 299,
"end": 301,
"loc": {
"start": {
"line": 8,
"column": 22
},
"end": {
"line": 8,
"column": 24
}
},
"properties": []
},
"leadingComments": null
}
],
"kind": "var",
"leadingComments": [
{
"type": "CommentLine",
"value": "asynchronous and caching image loader",
"start": 236,
"end": 275,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 39
}
},
"range": [
236,
275
]
}
]
},
{
"type": "FunctionDeclaration",
"start": 304,
"end": 678,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 20,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 313,
"end": 322,
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 18
}
},
"name": "loadImage"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 323,
"end": 330,
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 26
}
},
"name": "imgPath"
}
],
"body": {
"type": "BlockStatement",
"start": 332,
"end": 678,
"loc": {
"start": {
"line": 9,
"column": 28
},
"end": {
"line": 20,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 339,
"end": 386,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 11,
"column": 32
}
},
"test": {
"type": "UnaryExpression",
"start": 343,
"end": 351,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 16
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 344,
"end": 351,
"loc": {
"start": {
"line": 10,
"column": 9
},
"end": {
"line": 10,
"column": 16
}
},
"name": "imgPath"
}
},
"consequent": {
"type": "ReturnStatement",
"start": 362,
"end": 386,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 32
}
},
"argument": {
"type": "CallExpression",
"start": 369,
"end": 385,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 31
}
},
"callee": {
"type": "MemberExpression",
"start": 369,
"end": 383,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 369,
"end": 376,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 22
}
},
"name": "Promise"
},
"property": {
"type": "Identifier",
"start": 377,
"end": 383,
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 29
}
},
"name": "reject"
},
"computed": false
},
"arguments": []
}
},
"alternate": null
},
{
"type": "IfStatement",
"start": 394,
"end": 637,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 18,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 398,
"end": 427,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 37
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "BinaryExpression",
"start": 400,
"end": 426,
"loc": {
"start": {
"line": 13,
"column": 10
},
"end": {
"line": 13,
"column": 36
}
},
"left": {
"type": "Identifier",
"start": 400,
"end": 407,
"loc": {
"start": {
"line": 13,
"column": 10
},
"end": {
"line": 13,
"column": 17
}
},
"name": "imgPath"
},
"operator": "in",
"right": {
"type": "Identifier",
"start": 411,
"end": 426,
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 36
}
},
"name": "loadedImagesMap"
},
"parenthesizedExpression": true
}
},
"consequent": {
"type": "BlockStatement",
"start": 429,
"end": 637,
"loc": {
"start": {
"line": 13,
"column": 39
},
"end": {
"line": 18,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 440,
"end": 630,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 17,
"column": 11
}
},
"expression": {
"type": "AssignmentExpression",
"start": 440,
"end": 629,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 17,
"column": 10
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 440,
"end": 464,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 440,
"end": 455,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 23
}
},
"name": "loadedImagesMap"
},
"property": {
"type": "Identifier",
"start": 456,
"end": 463,
"loc": {
"start": {
"line": 14,
"column": 24
},
"end": {
"line": 14,
"column": 31
}
},
"name": "imgPath"
},
"computed": true
},
"right": {
"type": "NewExpression",
"start": 467,
"end": 629,
"loc": {
"start": {
"line": 14,
"column": 35
},
"end": {
"line": 17,
"column": 10
}
},
"callee": {
"type": "Identifier",
"start": 471,
"end": 478,
"loc": {
"start": {
"line": 14,
"column": 39
},
"end": {
"line": 14,
"column": 46
}
},
"name": "Promise"
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 479,
"end": 628,
"loc": {
"start": {
"line": 14,
"column": 47
},
"end": {
"line": 17,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 480,
"end": 487,
"loc": {
"start": {
"line": 14,
"column": 48
},
"end": {
"line": 14,
"column": 55
}
},
"name": "resolve"
},
{
"type": "Identifier",
"start": 489,
"end": 495,
"loc": {
"start": {
"line": 14,
"column": 57
},
"end": {
"line": 14,
"column": 63
}
},
"name": "reject"
}
],
"body": {
"type": "BlockStatement",
"start": 500,
"end": 628,
"loc": {
"start": {
"line": 14,
"column": 68
},
"end": {
"line": 17,
"column": 9
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 515,
"end": 554,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 51
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 519,
"end": 553,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 50
}
},
"id": {
"type": "Identifier",
"start": 519,
"end": 525,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 22
}
},
"name": "loader"
},
"init": {
"type": "NewExpression",
"start": 528,
"end": 553,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 15,
"column": 50
}
},
"callee": {
"type": "MemberExpression",
"start": 532,
"end": 551,
"loc": {
"start": {
"line": 15,
"column": 29
},
"end": {
"line": 15,
"column": 48
}
},
"object": {
"type": "Identifier",
"start": 532,
"end": 537,
"loc": {
"start": {
"line": 15,
"column": 29
},
"end": {
"line": 15,
"column": 34
}
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 538,
"end": 551,
"loc": {
"start": {
"line": 15,
"column": 35
},
"end": {
"line": 15,
"column": 48
}
},
"name": "TextureLoader"
},
"computed": false
},
"arguments": []
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 568,
"end": 617,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 61
}
},
"expression": {
"type": "CallExpression",
"start": 568,
"end": 616,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 60
}
},
"callee": {
"type": "MemberExpression",
"start": 568,
"end": 579,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 23
}
},
"object": {
"type": "Identifier",
"start": 568,
"end": 574,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 18
}
},
"name": "loader"
},
"property": {
"type": "Identifier",
"start": 575,
"end": 579,
"loc": {
"start": {
"line": 16,
"column": 19
},
"end": {
"line": 16,
"column": 23
}
},
"name": "load"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 580,
"end": 587,
"loc": {
"start": {
"line": 16,
"column": 24
},
"end": {
"line": 16,
"column": 31
}
},
"name": "imgPath"
},
{
"type": "Identifier",
"start": 589,
"end": 596,
"loc": {
"start": {
"line": 16,
"column": 33
},
"end": {
"line": 16,
"column": 40
}
},
"name": "resolve"
},
{
"type": "Identifier",
"start": 598,
"end": 607,
"loc": {
"start": {
"line": 16,
"column": 42
},
"end": {
"line": 16,
"column": 51
}
},
"name": "undefined"
},
{
"type": "Identifier",
"start": 609,
"end": 615,
"loc": {
"start": {
"line": 16,
"column": 53
},
"end": {
"line": 16,
"column": 59
}
},
"name": "reject"
}
]
}
}
]
}
}
]
}
}
}
]
},
"alternate": null
},
{
"type": "ReturnStatement",
"start": 643,
"end": 675,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 36
}
},
"argument": {
"type": "MemberExpression",
"start": 650,
"end": 674,
"loc": {
"start": {
"line": 19,
"column": 11
},
"end": {
"line": 19,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 650,
"end": 665,
"loc": {
"start": {
"line": 19,
"column": 11
},
"end": {
"line": 19,
"column": 26
}
},
"name": "loadedImagesMap"
},
"property": {
"type": "Identifier",
"start": 666,
"end": 673,
"loc": {
"start": {
"line": 19,
"column": 27
},
"end": {
"line": 19,
"column": 34
}
},
"name": "imgPath"
},
"computed": true
}
}
],
"trailingComments": null
},
"trailingComments": [
{
"type": "Block",
"value": "\r\n * Constraint - a Javascript representation of LGS 2D constraint\r\n * optional attributes: expression: string, value: number, fixed: boolean\r\n ",
"start": 682,
"end": 830,
"loc": {
"start": {
"line": 22,
"column": 0
},
"end": {
"line": 25,
"column": 3
}
},
"range": [
682,
830
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 832,
"end": 5212,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 147,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 847,
"end": 5212,
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 147,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 853,
"end": 863,
"loc": {
"start": {
"line": 26,
"column": 21
},
"end": {
"line": 26,
"column": 31
}
},
"name": "Constraint",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 872,
"end": 886,
"loc": {
"start": {
"line": 26,
"column": 40
},
"end": {
"line": 26,
"column": 54
}
},
"name": "ClassCadObject"
},
"body": {
"type": "ClassBody",
"start": 887,
"end": 5212,
"loc": {
"start": {
"line": 26,
"column": 55
},
"end": {
"line": 147,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 894,
"end": 1661,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 45,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 894,
"end": 905,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 905,
"end": 1661,
"loc": {
"start": {
"line": 27,
"column": 15
},
"end": {
"line": 45,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 906,
"end": 911,
"loc": {
"start": {
"line": 27,
"column": 16
},
"end": {
"line": 27,
"column": 21
}
},
"name": "types"
},
{
"type": "Identifier",
"start": 913,
"end": 917,
"loc": {
"start": {
"line": 27,
"column": 23
},
"end": {
"line": 27,
"column": 27
}
},
"name": "args"
},
{
"type": "Identifier",
"start": 919,
"end": 929,
"loc": {
"start": {
"line": 27,
"column": 29
},
"end": {
"line": 27,
"column": 39
}
},
"name": "attributes"
}
],
"body": {
"type": "BlockStatement",
"start": 931,
"end": 1661,
"loc": {
"start": {
"line": 27,
"column": 41
},
"end": {
"line": 45,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 942,
"end": 950,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 942,
"end": 949,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 942,
"end": 947,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 13
}
}
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 960,
"end": 1020,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 68
}
},
"expression": {
"type": "CallExpression",
"start": 960,
"end": 1019,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 67
}
},
"callee": {
"type": "MemberExpression",
"start": 960,
"end": 997,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 45
}
},
"object": {
"type": "MemberExpression",
"start": 960,
"end": 992,
"loc": {
"start": {
"line": 29,