awv3
Version:
AWV client CAD framework
1,754 lines • 1.42 MB
JSON
{
"type": "Program",
"start": 0,
"end": 15362,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 434,
"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": "delay"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 18,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 25
}
},
"value": "delay",
"rawValue": "delay",
"raw": "'delay'"
}
},
{
"type": "ImportDeclaration",
"start": 27,
"end": 53,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 34,
"end": 39,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 34,
"end": 39,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 45,
"end": 52,
"loc": {
"start": {
"line": 2,
"column": 18
},
"end": {
"line": 2,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
}
},
{
"type": "ImportDeclaration",
"start": 54,
"end": 91,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 37
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 61,
"end": 69,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 61,
"end": 69,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 15
}
},
"name": "Object3D"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 75,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 21
},
"end": {
"line": 3,
"column": 36
}
},
"value": "three/object3",
"rawValue": "three/object3",
"raw": "'three/object3'"
}
},
{
"type": "ImportDeclaration",
"start": 92,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 37
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 99,
"end": 105,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 99,
"end": 105,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 13
}
},
"name": "Sketch"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 111,
"end": 128,
"loc": {
"start": {
"line": 4,
"column": 19
},
"end": {
"line": 4,
"column": 36
}
},
"value": "sketcher/sketch",
"rawValue": "sketcher/sketch",
"raw": "'sketcher/sketch'"
}
},
{
"type": "ImportDeclaration",
"start": 130,
"end": 171,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 41
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 137,
"end": 145,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 137,
"end": 145,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
}
},
"name": "Sketcher"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 151,
"end": 170,
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 5,
"column": 40
}
},
"value": "sketcher/sketcher",
"rawValue": "sketcher/sketcher",
"raw": "'sketcher/sketcher'"
}
},
{
"type": "ImportDeclaration",
"start": 172,
"end": 274,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 8,
"column": 30
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 185,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 24
}
},
"imported": {
"type": "Identifier",
"start": 185,
"end": 190,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 9
}
},
"name": "Point"
},
"local": {
"type": "Identifier",
"start": 194,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 24
}
},
"name": "SketchPoint"
}
},
{
"type": "ImportSpecifier",
"start": 207,
"end": 225,
"loc": {
"start": {
"line": 7,
"column": 26
},
"end": {
"line": 7,
"column": 44
}
},
"imported": {
"type": "Identifier",
"start": 207,
"end": 211,
"loc": {
"start": {
"line": 7,
"column": 26
},
"end": {
"line": 7,
"column": 30
}
},
"name": "Line"
},
"local": {
"type": "Identifier",
"start": 215,
"end": 225,
"loc": {
"start": {
"line": 7,
"column": 34
},
"end": {
"line": 7,
"column": 44
}
},
"name": "SketchLine"
}
},
{
"type": "ImportSpecifier",
"start": 227,
"end": 243,
"loc": {
"start": {
"line": 7,
"column": 46
},
"end": {
"line": 7,
"column": 62
}
},
"imported": {
"type": "Identifier",
"start": 227,
"end": 230,
"loc": {
"start": {
"line": 7,
"column": 46
},
"end": {
"line": 7,
"column": 49
}
},
"name": "Arc"
},
"local": {
"type": "Identifier",
"start": 234,
"end": 243,
"loc": {
"start": {
"line": 7,
"column": 53
},
"end": {
"line": 7,
"column": 62
}
},
"name": "SketchArc"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 251,
"end": 273,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 29
}
},
"value": "sketcher/geomobjects",
"rawValue": "sketcher/geomobjects",
"raw": "'sketcher/geomobjects'"
}
},
{
"type": "ImportDeclaration",
"start": 275,
"end": 321,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 11,
"column": 28
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 288,
"end": 292,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 8
}
},
"imported": {
"type": "Identifier",
"start": 288,
"end": 292,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 8
}
},
"name": "Part"
},
"local": {
"type": "Identifier",
"start": 288,
"end": 292,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 8
}
},
"name": "Part"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 300,
"end": 320,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 27
}
},
"value": "sketcher/cchelpers",
"rawValue": "sketcher/cchelpers",
"raw": "'sketcher/cchelpers'"
}
},
{
"type": "FunctionDeclaration",
"start": 324,
"end": 406,
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 17,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 333,
"end": 338,
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 14
}
},
"name": "check"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 339,
"end": 343,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 19
}
},
"name": "cond"
},
{
"type": "Identifier",
"start": 345,
"end": 352,
"loc": {
"start": {
"line": 14,
"column": 21
},
"end": {
"line": 14,
"column": 28
}
},
"name": "message"
}
],
"body": {
"type": "BlockStatement",
"start": 354,
"end": 406,
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 17,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 360,
"end": 404,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 16,
"column": 33
}
},
"test": {
"type": "UnaryExpression",
"start": 364,
"end": 369,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 13
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 365,
"end": 369,
"loc": {
"start": {
"line": 15,
"column": 9
},
"end": {
"line": 15,
"column": 13
}
},
"name": "cond"
}
},
"consequent": {
"type": "ThrowStatement",
"start": 379,
"end": 404,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 33
}
},
"argument": {
"type": "NewExpression",
"start": 385,
"end": 403,
"loc": {
"start": {
"line": 16,
"column": 14
},
"end": {
"line": 16,
"column": 32
}
},
"callee": {
"type": "Identifier",
"start": 389,
"end": 394,
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 16,
"column": 23
}
},
"name": "Error"
},
"arguments": [
{
"type": "Identifier",
"start": 395,
"end": 402,
"loc": {
"start": {
"line": 16,
"column": 24
},
"end": {
"line": 16,
"column": 31
}
},
"name": "message"
}
]
}
},
"alternate": null
}
]
}
},
{
"type": "ClassDeclaration",
"start": 408,
"end": 1807,
"loc": {
"start": {
"line": 19,
"column": 0
},
"end": {
"line": 62,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 414,
"end": 430,
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 22
}
},
"name": "AddRemoveTracker"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 431,
"end": 1807,
"loc": {
"start": {
"line": 19,
"column": 23
},
"end": {
"line": 62,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 437,
"end": 632,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 26,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 437,
"end": 448,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 448,
"end": 632,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 26,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 449,
"end": 455,
"loc": {
"start": {
"line": 20,
"column": 16
},
"end": {
"line": 20,
"column": 22
}
},
"name": "sketch"
}
],
"body": {
"type": "BlockStatement",
"start": 457,
"end": 632,
"loc": {
"start": {
"line": 20,
"column": 24
},
"end": {
"line": 26,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 467,
"end": 488,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 467,
"end": 487,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 467,
"end": 478,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 467,
"end": 471,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 472,
"end": 478,
"loc": {
"start": {
"line": 21,
"column": 13
},
"end": {
"line": 21,
"column": 19
}
},
"name": "sketch"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 481,
"end": 487,
"loc": {
"start": {
"line": 21,
"column": 22
},
"end": {
"line": 21,
"column": 28
}
},
"name": "sketch"
}
},
"trailingComments": [
{
"type": "CommentLine",
"value": "set of listeners installed",
"start": 497,
"end": 525,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 36
}
},
"range": [
497,
525
]
}
]
},
{
"type": "ExpressionStatement",
"start": 534,
"end": 554,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 28
}
},
"expression": {
"type": "AssignmentExpression",
"start": 534,
"end": 553,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 27
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 534,
"end": 548,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 22
}
},
"object": {
"type": "ThisExpression",
"start": 534,
"end": 538,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 539,
"end": 548,
"loc": {
"start": {
"line": 23,
"column": 13
},
"end": {
"line": 23,
"column": 22
}
},
"name": "listeners"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "ObjectExpression",
"start": 551,
"end": 553,
"loc": {
"start": {
"line": 23,
"column": 25
},
"end": {
"line": 23,
"column": 27
}
},
"properties": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": "set of listeners installed",
"start": 497,
"end": 525,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 36
}
},
"range": [
497,
525
]
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": "set of changes done since creation",
"start": 563,
"end": 599,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 44
}
},
"range": [
563,
599
]
}
]
},
{
"type": "ExpressionStatement",
"start": 608,
"end": 626,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 26
}
},
"expression": {
"type": "AssignmentExpression",
"start": 608,
"end": 625,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 25
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 608,
"end": 620,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 608,
"end": 612,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 613,
"end": 620,
"loc": {
"start": {
"line": 25,
"column": 13
},
"end": {
"line": 25,
"column": 20
}
},
"name": "changes"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "ObjectExpression",
"start": 623,
"end": 625,
"loc": {
"start": {
"line": 25,
"column": 23
},
"end": {
"line": 25,
"column": 25
}
},
"properties": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": "set of changes done since creation",
"start": 563,
"end": 599,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 44
}
},
"range": [
563,
599
]
}
]
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 638,
"end": 835,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 33,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 638,
"end": 649,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 15
}
},
"name": "markChanged"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 649,
"end": 835,
"loc": {
"start": {
"line": 28,
"column": 15
},
"end": {
"line": 33,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 650,
"end": 653,
"loc": {
"start": {
"line": 28,
"column": 16
},
"end": {
"line": 28,
"column": 19
}
},
"name": "obj"
},
{
"type": "Identifier",
"start": 655,
"end": 659,
"loc": {
"start": {
"line": 28,
"column": 21
},
"end": {
"line": 28,
"column": 25
}
},
"name": "sign"
}
],
"body": {
"type": "BlockStatement",
"start": 661,
"end": 835,
"loc": {
"start": {
"line": 28,
"column": 27
},
"end": {
"line": 33,
"column": 5
}
},
"body": [
{
"type": "IfStatement",
"start": 671,
"end": 762,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 30,
"column": 60
}
},
"test": {
"type": "UnaryExpression",
"start": 675,
"end": 700,
"loc": {
"start": {
"line": 29,
"column": 12
},
"end": {
"line": 29,
"column": 37
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "BinaryExpression",
"start": 677,
"end": 699,
"loc": {
"start": {
"line": 29,
"column": 14
},
"end": {
"line": 29,
"column": 36
}
},
"left": {
"type": "MemberExpression",
"start": 677,
"end": 683,
"loc": {
"start": {
"line": 29,
"column": 14
},
"end": {
"line": 29,
"column": 20
}
},
"object": {
"type": "Identifier",
"start": 677,
"end": 680,
"loc": {
"start": {
"line": 29,
"column": 14
},
"end": {
"line": 29,
"column": 17
}
},
"name": "obj"
},
"property": {
"type": "Identifier",
"start": 681,
"end": 683,
"loc": {
"start": {
"line": 29,
"column": 18
},
"end": {
"line": 29,
"column": 20
}
},
"name": "id"
},
"computed": false
},
"operator": "in",
"right": {
"type": "MemberExpression",
"start": 687,
"end": 699,
"loc": {
"start": {
"line": 29,
"column": 24
},
"end": {
"line": 29,
"column": 36
}
},
"object": {
"type": "ThisExpression",
"start": 687,
"end": 691,
"loc": {
"start": {
"line": 29,
"column": 24
},
"end": {
"line": 29,
"column": 28
}
}
},
"property": {
"type": "Identifier",
"start": 692,
"end": 699,
"loc": {
"start": {
"line": 29,
"column": 29
},
"end": {
"line": 29,
"column": 36
}
},
"name": "changes"
},
"computed": false
},
"parenthesizedExpression": true
}
},
"consequent": {
"type": "ExpressionStatement",
"start": 714,
"end": 762,
"loc": {
"start": {
"line": 30,
"column": 12
},
"end": {
"line": 30,
"column": 60
}
},
"expression": {
"type": "AssignmentExpression",
"start": 714,
"end": 761,
"loc": {
"start": {
"line": 30,
"column": 12
},
"end": {
"line": 30,
"column": 59
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 714,
"end": 734,
"loc": {
"start": {
"line": 30,
"column": 12
},
"end": {
"line": 30,
"column": 32
}
},
"object": {
"type": "MemberExpression",
"start": 714,
"end": 726,
"loc": {
"start": {
"line": 30,
"column": 12
},
"end": {
"line": 30,
"column": 24
}
},
"object": {
"type": "ThisExpression",
"start": 714,
"end": 718,
"loc": {
"start": {
"line": 30,
"column": 12
},
"end": {
"line": 30,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 719,
"end": 726,
"loc": {
"start": {
"line": 30,
"column": 17
},
"end": {
"line": 30,
"column": 24
}
},
"name": "changes"
},
"computed": false
},
"property": {
"type": "MemberExpression",
"start": 727,
"end": 733,
"loc": {
"start": {
"line": 30,
"column": 25
},
"end": {
"line": 30,
"column": 31
}
},
"object": {
"type": "Identifier",
"start": 727,
"end": 730,
"loc": {
"start": {
"line": 30,
"column": 25
},
"end": {
"line": 30,
"column": 28
}
},
"name": "obj"
},
"property": {
"type": "Identifier",
"start": 731,
"end": 733,
"loc": {
"start": {
"line": 30,
"column": 29
},
"end": {
"line": 30,
"column": 31
}
},
"name": "id"
},
"computed": false
},
"computed": true
},
"right": {
"type": "ObjectExpression",
"start": 737,
"end": 761,
"loc": {
"start": {
"line": 30,
"column": 35
},
"end": {
"line": 30,
"column": 59
}
},
"properties": [
{
"type": "Property",
"start": 738,
"end": 749,
"loc": {
"start": {
"line": 30,
"column": 36
},
"end": {
"line": 30,
"column": 47
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 738,
"end": 744,
"loc": {
"start": {
"line": 30,
"column": 36
},
"end": {
"line": 30,
"column": 42
}
},
"name": "object"
},
"value": {
"type": "Identifier",
"start": 746,
"end": 74