awv3
Version:
⚡ AWV3 embedded CAD
1,315 lines (1,314 loc) • 1.07 MB
JSON
{
"type": "File",
"start": 0,
"end": 5303,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 135,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 5303,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 135,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 31
}
},
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"start": 7,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 12,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 17
},
"identifierName": "THREE"
},
"name": "THREE"
}
}
],
"source": {
"type": "StringLiteral",
"start": 23,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 30
}
},
"extra": {
"rawValue": "three",
"raw": "'three'"
},
"value": "three"
}
},
{
"type": "FunctionDeclaration",
"start": 33,
"end": 1009,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 31,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 42,
"end": 61,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 28
},
"identifierName": "getClosestGeomPoint"
},
"name": "getClosestGeomPoint"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 62,
"end": 68,
"loc": {
"start": {
"line": 3,
"column": 29
},
"end": {
"line": 3,
"column": 35
},
"identifierName": "sketch"
},
"name": "sketch"
},
{
"type": "Identifier",
"start": 70,
"end": 78,
"loc": {
"start": {
"line": 3,
"column": 37
},
"end": {
"line": 3,
"column": 45
},
"identifierName": "newPoint"
},
"name": "newPoint"
},
{
"type": "Identifier",
"start": 80,
"end": 91,
"loc": {
"start": {
"line": 3,
"column": 47
},
"end": {
"line": 3,
"column": 58
},
"identifierName": "maxDistance"
},
"name": "maxDistance"
},
{
"type": "Identifier",
"start": 93,
"end": 105,
"loc": {
"start": {
"line": 3,
"column": 60
},
"end": {
"line": 3,
"column": 72
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
}
],
"body": {
"type": "BlockStatement",
"start": 107,
"end": 1009,
"loc": {
"start": {
"line": 3,
"column": 74
},
"end": {
"line": 31,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 113,
"end": 187,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 5,
"column": 55
}
},
"test": {
"type": "UnaryExpression",
"start": 117,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 21
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 118,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "ExpressionStatement",
"start": 140,
"end": 187,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 55
}
},
"expression": {
"type": "AssignmentExpression",
"start": 140,
"end": 186,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 54
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 140,
"end": 152,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 20
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
},
"right": {
"type": "FunctionExpression",
"start": 155,
"end": 186,
"loc": {
"start": {
"line": 5,
"column": 23
},
"end": {
"line": 5,
"column": 54
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 164,
"end": 167,
"loc": {
"start": {
"line": 5,
"column": 32
},
"end": {
"line": 5,
"column": 35
},
"identifierName": "obj"
},
"name": "obj"
}
],
"body": {
"type": "BlockStatement",
"start": 169,
"end": 186,
"loc": {
"start": {
"line": 5,
"column": 37
},
"end": {
"line": 5,
"column": 54
}
},
"body": [
{
"type": "ReturnStatement",
"start": 171,
"end": 184,
"loc": {
"start": {
"line": 5,
"column": 39
},
"end": {
"line": 5,
"column": 52
}
},
"argument": {
"type": "BooleanLiteral",
"start": 178,
"end": 183,
"loc": {
"start": {
"line": 5,
"column": 46
},
"end": {
"line": 5,
"column": 51
}
},
"value": false
}
}
],
"directives": []
}
}
}
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 193,
"end": 220,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 31
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 197,
"end": 219,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 197,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 16
},
"identifierName": "distance"
},
"name": "distance"
},
"init": {
"type": "Identifier",
"start": 208,
"end": 219,
"loc": {
"start": {
"line": 7,
"column": 19
},
"end": {
"line": 7,
"column": 30
},
"identifierName": "maxDistance"
},
"name": "maxDistance"
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 225,
"end": 261,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 40
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 229,
"end": 260,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 39
}
},
"id": {
"type": "Identifier",
"start": 229,
"end": 241,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 20
},
"identifierName": "closestPoint"
},
"name": "closestPoint"
},
"init": {
"type": "CallExpression",
"start": 244,
"end": 260,
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 8,
"column": 39
}
},
"callee": {
"type": "MemberExpression",
"start": 244,
"end": 258,
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 8,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 244,
"end": 252,
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 8,
"column": 31
},
"identifierName": "newPoint"
},
"name": "newPoint"
},
"property": {
"type": "Identifier",
"start": 253,
"end": 258,
"loc": {
"start": {
"line": 8,
"column": 32
},
"end": {
"line": 8,
"column": 37
},
"identifierName": "clone"
},
"name": "clone"
},
"computed": false
},
"arguments": []
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 266,
"end": 288,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 26
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 270,
"end": 287,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 25
}
},
"id": {
"type": "Identifier",
"start": 270,
"end": 279,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 17
},
"identifierName": "isSnapped"
},
"name": "isSnapped"
},
"init": {
"type": "BooleanLiteral",
"start": 282,
"end": 287,
"loc": {
"start": {
"line": 9,
"column": 20
},
"end": {
"line": 9,
"column": 25
}
},
"value": false
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 293,
"end": 859,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 24,
"column": 7
}
},
"expression": {
"type": "CallExpression",
"start": 293,
"end": 858,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 24,
"column": 6
}
},
"callee": {
"type": "MemberExpression",
"start": 293,
"end": 328,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 39
}
},
"object": {
"type": "CallExpression",
"start": 293,
"end": 320,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 31
}
},
"callee": {
"type": "MemberExpression",
"start": 293,
"end": 318,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 293,
"end": 299,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 10
},
"identifierName": "sketch"
},
"name": "sketch"
},
"property": {
"type": "Identifier",
"start": 300,
"end": 318,
"loc": {
"start": {
"line": 10,
"column": 11
},
"end": {
"line": 10,
"column": 29
},
"identifierName": "getObjectsOnSketch"
},
"name": "getObjectsOnSketch"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 321,
"end": 328,
"loc": {
"start": {
"line": 10,
"column": 32
},
"end": {
"line": 10,
"column": 39
},
"identifierName": "forEach"
},
"name": "forEach"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 329,
"end": 857,
"loc": {
"start": {
"line": 10,
"column": 40
},
"end": {
"line": 24,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 329,
"end": 332,
"loc": {
"start": {
"line": 10,
"column": 40
},
"end": {
"line": 10,
"column": 43
},
"identifierName": "obj"
},
"name": "obj"
}
],
"body": {
"type": "BlockStatement",
"start": 337,
"end": 857,
"loc": {
"start": {
"line": 10,
"column": 48
},
"end": {
"line": 24,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 347,
"end": 851,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 23,
"column": 11
}
},
"expression": {
"type": "CallExpression",
"start": 347,
"end": 850,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 23,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 347,
"end": 376,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 347,
"end": 353,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 14
},
"identifierName": "Sketch"
},
"name": "Sketch"
},
"property": {
"type": "Identifier",
"start": 354,
"end": 376,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 37
},
"identifierName": "ForObjectsWithChildren"
},
"name": "ForObjectsWithChildren"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 377,
"end": 380,
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 41
},
"identifierName": "obj"
},
"name": "obj"
},
{
"type": "FunctionExpression",
"start": 382,
"end": 849,
"loc": {
"start": {
"line": 11,
"column": 43
},
"end": {
"line": 23,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 391,
"end": 396,
"loc": {
"start": {
"line": 11,
"column": 52
},
"end": {
"line": 11,
"column": 57
},
"identifierName": "child"
},
"name": "child"
}
],
"body": {
"type": "BlockStatement",
"start": 398,
"end": 849,
"loc": {
"start": {
"line": 11,
"column": 59
},
"end": {
"line": 23,
"column": 9
}
},
"body": [
{
"type": "IfStatement",
"start": 412,
"end": 460,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 13,
"column": 23
}
},
"test": {
"type": "CallExpression",
"start": 416,
"end": 435,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 35
}
},
"callee": {
"type": "Identifier",
"start": 416,
"end": 428,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 28
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
},
"arguments": [
{
"type": "Identifier",
"start": 429,
"end": 434,
"loc": {
"start": {
"line": 12,
"column": 29
},
"end": {
"line": 12,
"column": 34
},
"identifierName": "child"
},
"name": "child"
}
]
},
"consequent": {
"type": "ReturnStatement",
"start": 453,
"end": 460,
"loc": {
"start": {
"line": 13,
"column": 16
},
"end": {
"line": 13,
"column": 23
}
},
"argument": null
},
"alternate": null
},
{
"type": "IfStatement",
"start": 473,
"end": 839,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 22,
"column": 13
}
},
"test": {
"type": "BinaryExpression",
"start": 477,
"end": 499,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 38
}
},
"left": {
"type": "Identifier",
"start": 477,
"end": 482,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 21
},
"identifierName": "child"
},
"name": "child"
},
"operator": "instanceof",
"right": {
"type": "Identifier",
"start": 494,
"end": 499,
"loc": {
"start": {
"line": 14,
"column": 33
},
"end": {
"line": 14,
"column": 38
},
"identifierName": "Point"
},
"name": "Point"
}
},
"consequent": {
"type": "BlockStatement",
"start": 501,
"end": 839,
"loc": {
"start": {
"line": 14,
"column": 40
},
"end": {
"line": 22,
"column": 13
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 519,
"end": 537,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 523,
"end": 536,
"loc": {
"start": {
"line": 15,
"column": 20
},
"end": {
"line": 15,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 523,
"end": 528,
"loc": {
"start": {
"line": 15,
"column": 20
},
"end": {
"line": 15,
"column": 25
},
"identifierName": "point"
},
"name": "point"
},
"init": {
"type": "Identifier",
"start": 531,
"end": 536,
"loc": {
"start": {
"line": 15,
"column": 28
},
"end": {
"line": 15,
"column": 33
},
"identifierName": "child"
},
"name": "child"
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 554,
"end": 612,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 16,
"column": 74
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 558,
"end": 611,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 73
}
},
"id": {
"type": "Identifier",
"start": 558,
"end": 573,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 35
},
"identifierName": "currentDistance"
},
"name": "currentDistance"
},
"init": {
"type": "CallExpression",
"start": 576,
"end": 611,
"loc": {
"start": {
"line": 16,
"column": 38
},
"end": {
"line": 16,
"column": 73
}
},
"callee": {
"type": "MemberExpression",
"start": 576,
"end": 601,
"loc": {
"start": {
"line": 16,
"column": 38
},
"end": {
"line": 16,
"column": 63
}
},
"object": {
"type": "MemberExpression",
"start": 576,
"end": 590,
"loc": {
"start": {
"line": 16,
"column": 38
},
"end": {
"line": 16,
"column": 52
}
},
"object": {
"type": "Identifier",
"start": 576,
"end": 581,
"loc": {
"start": {
"line": 16,
"column": 38
},
"end": {
"line": 16,
"column": 43
},
"identifierName": "point"