awv3
Version:
AWV client CAD framework
1,347 lines • 583 kB
JSON
{
"type": "Program",
"start": 0,
"end": 6101,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 164,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 18,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
}
},
{
"type": "ImportDeclaration",
"start": 28,
"end": 45,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 17
}
},
"specifiers": [],
"source": {
"type": "Literal",
"start": 35,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 16
}
},
"value": "perfnow",
"rawValue": "perfnow",
"raw": "'perfnow'"
}
},
{
"type": "ImportDeclaration",
"start": 47,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 43
}
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"start": 54,
"end": 66,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 19
}
},
"local": {
"type": "Identifier",
"start": 59,
"end": 66,
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 19
}
},
"name": "Helpers"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 72,
"end": 89,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 42
}
},
"value": "../core/helpers",
"rawValue": "../core/helpers",
"raw": "'../core/helpers'"
}
},
{
"type": "ImportDeclaration",
"start": 92,
"end": 131,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 39
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 99,
"end": 104,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 99,
"end": 104,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 12
}
},
"name": "Tween"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 110,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 4,
"column": 38
}
},
"value": "../animation/tween",
"rawValue": "../animation/tween",
"raw": "'../animation/tween'"
}
},
{
"type": "ExportDefaultDeclaration",
"start": 135,
"end": 6099,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 163,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 150,
"end": 6099,
"loc": {
"start": {
"line": 6,
"column": 15
},
"end": {
"line": 163,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 156,
"end": 164,
"loc": {
"start": {
"line": 6,
"column": 21
},
"end": {
"line": 6,
"column": 29
}
},
"name": "Renderer"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 165,
"end": 6099,
"loc": {
"start": {
"line": 6,
"column": 30
},
"end": {
"line": 163,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 172,
"end": 5221,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 131,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 172,
"end": 183,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 183,
"end": 5221,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 131,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start": 184,
"end": 244,
"loc": {
"start": {
"line": 7,
"column": 16
},
"end": {
"line": 7,
"column": 76
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 184,
"end": 190,
"loc": {
"start": {
"line": 7,
"column": 16
},
"end": {
"line": 7,
"column": 22
}
},
"name": "canvas"
},
"right": {
"type": "CallExpression",
"start": 193,
"end": 244,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 76
}
},
"callee": {
"type": "MemberExpression",
"start": 193,
"end": 202,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 193,
"end": 198,
"loc": {
"start": {
"line": 7,
"column": 25
},
"end": {
"line": 7,
"column": 30
}
},
"name": "Error"
},
"property": {
"type": "Identifier",
"start": 199,
"end": 202,
"loc": {
"start": {
"line": 7,
"column": 31
},
"end": {
"line": 7,
"column": 34
}
},
"name": "log"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 203,
"end": 243,
"loc": {
"start": {
"line": 7,
"column": 35
},
"end": {
"line": 7,
"column": 75
}
},
"value": "Factory was initialized without canvas",
"rawValue": "Factory was initialized without canvas",
"raw": "'Factory was initialized without canvas'"
}
]
}
},
{
"type": "AssignmentPattern",
"start": 246,
"end": 258,
"loc": {
"start": {
"line": 7,
"column": 78
},
"end": {
"line": 7,
"column": 90
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 246,
"end": 253,
"loc": {
"start": {
"line": 7,
"column": 78
},
"end": {
"line": 7,
"column": 85
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 256,
"end": 258,
"loc": {
"start": {
"line": 7,
"column": 88
},
"end": {
"line": 7,
"column": 90
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 260,
"end": 5221,
"loc": {
"start": {
"line": 7,
"column": 92
},
"end": {
"line": 131,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 273,
"end": 1223,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 29,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 273,
"end": 1222,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 29,
"column": 9
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 273,
"end": 280,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 15
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 283,
"end": 1222,
"loc": {
"start": {
"line": 9,
"column": 18
},
"end": {
"line": 29,
"column": 9
}
},
"properties": [
{
"type": "Property",
"start": 298,
"end": 352,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 66
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 298,
"end": 308,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 22
}
},
"name": "resolution"
},
"value": {
"type": "LogicalExpression",
"start": 310,
"end": 352,
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 10,
"column": 66
}
},
"left": {
"type": "CallExpression",
"start": 310,
"end": 347,
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 10,
"column": 61
}
},
"callee": {
"type": "Identifier",
"start": 310,
"end": 320,
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 10,
"column": 34
}
},
"name": "parseFloat"
},
"arguments": [
{
"type": "CallExpression",
"start": 321,
"end": 346,
"loc": {
"start": {
"line": 10,
"column": 35
},
"end": {
"line": 10,
"column": 60
}
},
"callee": {
"type": "MemberExpression",
"start": 321,
"end": 332,
"loc": {
"start": {
"line": 10,
"column": 35
},
"end": {
"line": 10,
"column": 46
}
},
"object": {
"type": "Identifier",
"start": 321,
"end": 328,
"loc": {
"start": {
"line": 10,
"column": 35
},
"end": {
"line": 10,
"column": 42
}
},
"name": "Helpers"
},
"property": {
"type": "Identifier",
"start": 329,
"end": 332,
"loc": {
"start": {
"line": 10,
"column": 43
},
"end": {
"line": 10,
"column": 46
}
},
"name": "url"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 333,
"end": 345,
"loc": {
"start": {
"line": 10,
"column": 47
},
"end": {
"line": 10,
"column": 59
}
},
"value": "resolution",
"rawValue": "resolution",
"raw": "'resolution'"
}
]
}
]
},
"operator": "||",
"right": {
"type": "Literal",
"start": 351,
"end": 352,
"loc": {
"start": {
"line": 10,
"column": 65
},
"end": {
"line": 10,
"column": 66
}
},
"value": 1,
"rawValue": 1,
"raw": "1"
}
},
"kind": "init"
},
{
"type": "Property",
"start": 367,
"end": 411,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 56
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 367,
"end": 376,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 21
}
},
"name": "pixelated"
},
"value": {
"type": "LogicalExpression",
"start": 378,
"end": 411,
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 56
}
},
"left": {
"type": "CallExpression",
"start": 378,
"end": 402,
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 47
}
},
"callee": {
"type": "MemberExpression",
"start": 378,
"end": 389,
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 378,
"end": 385,
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 30
}
},
"name": "Helpers"
},
"property": {
"type": "Identifier",
"start": 386,
"end": 389,
"loc": {
"start": {
"line": 11,
"column": 31
},
"end": {
"line": 11,
"column": 34
}
},
"name": "url"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 390,
"end": 401,
"loc": {
"start": {
"line": 11,
"column": 35
},
"end": {
"line": 11,
"column": 46
}
},
"value": "pixelated",
"rawValue": "pixelated",
"raw": "'pixelated'"
}
]
},
"operator": "||",
"right": {
"type": "Literal",
"start": 406,
"end": 411,
"loc": {
"start": {
"line": 11,
"column": 51
},
"end": {
"line": 11,
"column": 56
}
},
"value": false,
"rawValue": false,
"raw": "false"
}
},
"kind": "init"
},
{
"type": "Property",
"start": 426,
"end": 456,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 42
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 426,
"end": 436,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 22
}
},
"name": "clearColor"
},
"value": {
"type": "NewExpression",
"start": 438,
"end": 456,
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 42
}
},
"callee": {
"type": "MemberExpression",
"start": 442,
"end": 453,
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 442,
"end": 447,
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 33
}
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 448,
"end": 453,
"loc": {
"start": {
"line": 12,
"column": 34
},
"end": {
"line": 12,
"column": 39
}
},
"name": "Color"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 454,
"end": 455,
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 12,
"column": 41
}
},
"value": 0,
"rawValue": 0,
"raw": "0"
}
]
},
"kind": "init"
},
{
"type": "Property",
"start": 471,
"end": 485,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 471,
"end": 476,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 17
}
},
"name": "place"
},
"value": {
"type": "Literal",
"start": 478,
"end": 485,
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 13,
"column": 26
}
},
"value": "first",
"rawValue": "first",
"raw": "'first'"
},
"kind": "init"
},
{
"type": "Property",
"start": 500,
"end": 522,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 34
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 500,
"end": 516,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 28
}
},
"name": "startImmediately"
},
"value": {
"type": "Literal",
"start": 518,
"end": 522,
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 34
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"kind": "init"
},
{
"type": "Property",
"start": 537,
"end": 555,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 30
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 537,
"end": 546,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 21
}
},
"name": "precision"
},
"value": {
"type": "Literal",
"start": 548,
"end": 555,
"loc": {
"start": {
"line": 15,
"column": 23
},
"end": {
"line": 15,
"column": 30
}
},
"value": "highp",
"rawValue": "highp",
"raw": "'highp'"
},
"kind": "init"
},
{
"type": "Property",
"start": 570,
"end": 594,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 36
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 570,
"end": 588,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 30
}
},
"name": "premultipliedAlpha"
},
"value": {
"type": "Literal",
"start": 590,
"end": 594,
"loc": {
"start": {
"line": 16,
"column": 32
},
"end": {
"line": 16,
"column": 36
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"kind": "init"
},
{
"type": "Property",
"start": 609,
"end": 622,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 609,
"end": 616,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 19
}
},
"name": "stencil"
},
"value": {
"type": "Literal",
"start": 618,
"end": 622,
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 25
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"kind": "init"
},
{
"type": "Property",
"start": 637,
"end": 648,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 23
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 637,
"end": 642,
"loc": {
"start": {
"line": 18,
"c