awv3
Version:
⚡ AWV3 embedded CAD
1,315 lines (1,314 loc) • 1.06 MB
JSON
{
"type": "File",
"start": 0,
"end": 5540,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 145,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 5540,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 145,
"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": 35,
"end": 1043,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 32,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 44,
"end": 63,
"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": 64,
"end": 70,
"loc": {
"start": {
"line": 3,
"column": 29
},
"end": {
"line": 3,
"column": 35
},
"identifierName": "sketch"
},
"name": "sketch"
},
{
"type": "Identifier",
"start": 72,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 37
},
"end": {
"line": 3,
"column": 45
},
"identifierName": "newPoint"
},
"name": "newPoint"
},
{
"type": "Identifier",
"start": 82,
"end": 93,
"loc": {
"start": {
"line": 3,
"column": 47
},
"end": {
"line": 3,
"column": 58
},
"identifierName": "maxDistance"
},
"name": "maxDistance"
},
{
"type": "Identifier",
"start": 95,
"end": 107,
"loc": {
"start": {
"line": 3,
"column": 60
},
"end": {
"line": 3,
"column": 72
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
}
],
"body": {
"type": "BlockStatement",
"start": 109,
"end": 1043,
"loc": {
"start": {
"line": 3,
"column": 74
},
"end": {
"line": 32,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 116,
"end": 213,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 7,
"column": 10
}
},
"test": {
"type": "UnaryExpression",
"start": 120,
"end": 133,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 21
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 121,
"end": 133,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "ExpressionStatement",
"start": 144,
"end": 213,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 7,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 144,
"end": 212,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 7,
"column": 9
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 144,
"end": 156,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 20
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
},
"right": {
"type": "FunctionExpression",
"start": 159,
"end": 212,
"loc": {
"start": {
"line": 5,
"column": 23
},
"end": {
"line": 7,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 168,
"end": 171,
"loc": {
"start": {
"line": 5,
"column": 32
},
"end": {
"line": 5,
"column": 35
},
"identifierName": "obj"
},
"name": "obj"
}
],
"body": {
"type": "BlockStatement",
"start": 173,
"end": 212,
"loc": {
"start": {
"line": 5,
"column": 37
},
"end": {
"line": 7,
"column": 9
}
},
"body": [
{
"type": "ReturnStatement",
"start": 188,
"end": 201,
"loc": {
"start": {
"line": 6,
"column": 12
},
"end": {
"line": 6,
"column": 25
}
},
"argument": {
"type": "BooleanLiteral",
"start": 195,
"end": 200,
"loc": {
"start": {
"line": 6,
"column": 19
},
"end": {
"line": 6,
"column": 24
}
},
"value": false
}
}
],
"directives": []
}
}
}
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 221,
"end": 248,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 31
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 225,
"end": 247,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 225,
"end": 233,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 16
},
"identifierName": "distance"
},
"name": "distance"
},
"init": {
"type": "Identifier",
"start": 236,
"end": 247,
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 30
},
"identifierName": "maxDistance"
},
"name": "maxDistance"
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 254,
"end": 290,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 40
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 258,
"end": 289,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 39
}
},
"id": {
"type": "Identifier",
"start": 258,
"end": 270,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 20
},
"identifierName": "closestPoint"
},
"name": "closestPoint"
},
"init": {
"type": "CallExpression",
"start": 273,
"end": 289,
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 39
}
},
"callee": {
"type": "MemberExpression",
"start": 273,
"end": 287,
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 273,
"end": 281,
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 31
},
"identifierName": "newPoint"
},
"name": "newPoint"
},
"property": {
"type": "Identifier",
"start": 282,
"end": 287,
"loc": {
"start": {
"line": 10,
"column": 32
},
"end": {
"line": 10,
"column": 37
},
"identifierName": "clone"
},
"name": "clone"
},
"computed": false
},
"arguments": []
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 296,
"end": 318,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 26
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 300,
"end": 317,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 25
}
},
"id": {
"type": "Identifier",
"start": 300,
"end": 309,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 17
},
"identifierName": "isSnapped"
},
"name": "isSnapped"
},
"init": {
"type": "BooleanLiteral",
"start": 312,
"end": 317,
"loc": {
"start": {
"line": 11,
"column": 20
},
"end": {
"line": 11,
"column": 25
}
},
"value": false
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 324,
"end": 886,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 25,
"column": 7
}
},
"expression": {
"type": "CallExpression",
"start": 324,
"end": 885,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 25,
"column": 6
}
},
"callee": {
"type": "MemberExpression",
"start": 324,
"end": 359,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 39
}
},
"object": {
"type": "CallExpression",
"start": 324,
"end": 351,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 31
}
},
"callee": {
"type": "MemberExpression",
"start": 324,
"end": 349,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 324,
"end": 330,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 10
},
"identifierName": "sketch"
},
"name": "sketch"
},
"property": {
"type": "Identifier",
"start": 331,
"end": 349,
"loc": {
"start": {
"line": 12,
"column": 11
},
"end": {
"line": 12,
"column": 29
},
"identifierName": "getObjectsOnSketch"
},
"name": "getObjectsOnSketch"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 352,
"end": 359,
"loc": {
"start": {
"line": 12,
"column": 32
},
"end": {
"line": 12,
"column": 39
},
"identifierName": "forEach"
},
"name": "forEach"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 360,
"end": 884,
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 25,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 360,
"end": 363,
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 12,
"column": 43
},
"identifierName": "obj"
},
"name": "obj"
}
],
"body": {
"type": "BlockStatement",
"start": 367,
"end": 884,
"loc": {
"start": {
"line": 12,
"column": 47
},
"end": {
"line": 25,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 378,
"end": 877,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 24,
"column": 11
}
},
"expression": {
"type": "CallExpression",
"start": 378,
"end": 876,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 24,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 378,
"end": 407,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 378,
"end": 384,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 14
},
"identifierName": "Sketch"
},
"name": "Sketch"
},
"property": {
"type": "Identifier",
"start": 385,
"end": 407,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 13,
"column": 37
},
"identifierName": "ForObjectsWithChildren"
},
"name": "ForObjectsWithChildren"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 408,
"end": 411,
"loc": {
"start": {
"line": 13,
"column": 38
},
"end": {
"line": 13,
"column": 41
},
"identifierName": "obj"
},
"name": "obj"
},
{
"type": "FunctionExpression",
"start": 413,
"end": 875,
"loc": {
"start": {
"line": 13,
"column": 43
},
"end": {
"line": 24,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 422,
"end": 427,
"loc": {
"start": {
"line": 13,
"column": 52
},
"end": {
"line": 13,
"column": 57
},
"identifierName": "child"
},
"name": "child"
}
],
"body": {
"type": "BlockStatement",
"start": 429,
"end": 875,
"loc": {
"start": {
"line": 13,
"column": 59
},
"end": {
"line": 24,
"column": 9
}
},
"body": [
{
"type": "IfStatement",
"start": 444,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 44
}
},
"test": {
"type": "CallExpression",
"start": 448,
"end": 467,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 35
}
},
"callee": {
"type": "Identifier",
"start": 448,
"end": 460,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 28
},
"identifierName": "ignoreFilter"
},
"name": "ignoreFilter"
},
"arguments": [
{
"type": "Identifier",
"start": 461,
"end": 466,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 34
},
"identifierName": "child"
},
"name": "child"
}
]
},
"consequent": {
"type": "ReturnStatement",
"start": 469,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 37
},
"end": {
"line": 14,
"column": 44
}
},
"argument": null
},
"alternate": null
},
{
"type": "IfStatement",
"start": 490,
"end": 864,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 23,
"column": 13
}
},
"test": {
"type": "BinaryExpression",
"start": 494,
"end": 516,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 38
}
},
"left": {
"type": "Identifier",
"start": 494,
"end": 499,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 21
},
"identifierName": "child"
},
"name": "child"
},
"operator": "instanceof",
"right": {
"type": "Identifier",
"start": 511,
"end": 516,
"loc": {
"start": {
"line": 15,
"column": 33
},
"end": {
"line": 15,
"column": 38
},
"identifierName": "Point"
},
"name": "Point"
}
},
"consequent": {
"type": "BlockStatement",
"start": 518,
"end": 864,
"loc": {
"start": {
"line": 15,
"column": 40
},
"end": {
"line": 23,
"column": 13
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 537,
"end": 555,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 16,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 541,
"end": 554,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 541,
"end": 546,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 25
},
"identifierName": "point"
},
"name": "point"
},
"init": {
"type": "Identifier",
"start": 549,
"end": 554,
"loc": {
"start": {
"line": 16,
"column": 28
},
"end": {
"line": 16,
"column": 33
},
"identifierName": "child"
},
"name": "child"
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 573,
"end": 631,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 17,
"column": 74
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 577,
"end": 630,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 73
}
},
"id": {
"type": "Identifier",
"start": 577,
"end": 592,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 35
},
"identifierName": "currentDistance"
},
"name": "currentDistance"
},
"init": {
"type": "CallExpression",
"start": 595,
"end": 630,
"loc": {
"start": {
"line": 17,
"column": 38
},
"end": {
"line": 17,
"column": 73
}
},
"callee": {
"type": "MemberExpression",
"start": 595,
"end": 620,
"loc": {
"start": {
"line": 17,
"column": 38
},
"end": {
"line": 17,
"column": 63
}
},
"object": {
"type": "MemberExpression",
"start": 595,
"end": 609,
"loc": {
"start": {
"line": 17,
"column": 38
},
"end": {
"line": 17,
"column": 52
}
},
"object": {
"type": "Identifier",
"start": 595,
"end": 600,
"loc": {
"start": {
"line": 17,
"column": 38
},
"end": {
"line": 17,
"column": 43
},
"identifierName": "point"