UNPKG

awv3

Version:
1,408 lines (1,407 loc) 832 kB
{ "type": "File", "start": 0, "end": 4035, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 121, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 4035, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 121, "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": "ExportDefaultDeclaration", "start": 33, "end": 4034, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 120, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 48, "end": 4034, "loc": { "start": { "line": 3, "column": 15 }, "end": { "line": 120, "column": 1 } }, "id": { "type": "Identifier", "start": 54, "end": 61, "loc": { "start": { "line": 3, "column": 21 }, "end": { "line": 3, "column": 28 }, "identifierName": "Snapper" }, "name": "Snapper" }, "superClass": null, "body": { "type": "ClassBody", "start": 62, "end": 4034, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 120, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 68, "end": 383, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 13, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 68, "end": 79, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 80, "end": 87, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 23 }, "identifierName": "options" }, "name": "options" } ], "body": { "type": "BlockStatement", "start": 89, "end": 383, "loc": { "start": { "line": 4, "column": 25 }, "end": { "line": 13, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 99, "end": 128, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 37 } }, "expression": { "type": "AssignmentExpression", "start": 99, "end": 127, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 36 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 99, "end": 110, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 19 } }, "object": { "type": "ThisExpression", "start": 99, "end": 103, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 12 } } }, "property": { "type": "Identifier", "start": 104, "end": 110, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 19 }, "identifierName": "sketch" }, "name": "sketch" }, "computed": false }, "right": { "type": "MemberExpression", "start": 113, "end": 127, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 36 } }, "object": { "type": "Identifier", "start": 113, "end": 120, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 29 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 121, "end": 127, "loc": { "start": { "line": 5, "column": 30 }, "end": { "line": 5, "column": 36 }, "identifierName": "sketch" }, "name": "sketch" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 137, "end": 170, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 41 } }, "expression": { "type": "AssignmentExpression", "start": 137, "end": 169, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 40 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 137, "end": 150, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 21 } }, "object": { "type": "ThisExpression", "start": 137, "end": 141, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 12 } } }, "property": { "type": "Identifier", "start": 142, "end": 150, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 21 }, "identifierName": "gridStep" }, "name": "gridStep" }, "computed": false }, "right": { "type": "MemberExpression", "start": 153, "end": 169, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 40 } }, "object": { "type": "Identifier", "start": 153, "end": 160, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 31 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 161, "end": 169, "loc": { "start": { "line": 6, "column": 32 }, "end": { "line": 6, "column": 40 }, "identifierName": "gridStep" }, "name": "gridStep" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 179, "end": 218, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 47 } }, "expression": { "type": "AssignmentExpression", "start": 179, "end": 217, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 46 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 179, "end": 195, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 24 } }, "object": { "type": "ThisExpression", "start": 179, "end": 183, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 12 } } }, "property": { "type": "Identifier", "start": 184, "end": 195, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 24 }, "identifierName": "pointRadius" }, "name": "pointRadius" }, "computed": false }, "right": { "type": "MemberExpression", "start": 198, "end": 217, "loc": { "start": { "line": 7, "column": 27 }, "end": { "line": 7, "column": 46 } }, "object": { "type": "Identifier", "start": 198, "end": 205, "loc": { "start": { "line": 7, "column": 27 }, "end": { "line": 7, "column": 34 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 206, "end": 217, "loc": { "start": { "line": 7, "column": 35 }, "end": { "line": 7, "column": 46 }, "identifierName": "pointRadius" }, "name": "pointRadius" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 227, "end": 248, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 227, "end": 247, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 227, "end": 242, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 23 } }, "object": { "type": "ThisExpression", "start": 227, "end": 231, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 12 } } }, "property": { "type": "Identifier", "start": 232, "end": 242, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 23 }, "identifierName": "ignoredIds" }, "name": "ignoredIds" }, "computed": false }, "right": { "type": "ArrayExpression", "start": 245, "end": 247, "loc": { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 28 } }, "elements": [] } } }, { "type": "ExpressionStatement", "start": 257, "end": 285, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 36 } }, "expression": { "type": "AssignmentExpression", "start": 257, "end": 284, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 35 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 257, "end": 272, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 23 } }, "object": { "type": "ThisExpression", "start": 257, "end": 261, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 12 } } }, "property": { "type": "Identifier", "start": 262, "end": 272, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 23 }, "identifierName": "keyOffsets" }, "name": "keyOffsets" }, "computed": false }, "right": { "type": "Identifier", "start": 275, "end": 284, "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 35 }, "identifierName": "undefined" }, "name": "undefined" } } }, { "type": "ExpressionStatement", "start": 295, "end": 338, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 51 } }, "expression": { "type": "AssignmentExpression", "start": 295, "end": 337, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 50 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 295, "end": 315, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 28 } }, "object": { "type": "ThisExpression", "start": 295, "end": 299, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } } }, "property": { "type": "Identifier", "start": 300, "end": 315, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 28 }, "identifierName": "maxSnapDistance" }, "name": "maxSnapDistance" }, "computed": false }, "right": { "type": "BinaryExpression", "start": 318, "end": 337, "loc": { "start": { "line": 11, "column": 31 }, "end": { "line": 11, "column": 50 } }, "left": { "type": "MemberExpression", "start": 318, "end": 331, "loc": { "start": { "line": 11, "column": 31 }, "end": { "line": 11, "column": 44 } }, "object": { "type": "ThisExpression", "start": 318, "end": 322, "loc": { "start": { "line": 11, "column": 31 }, "end": { "line": 11, "column": 35 } } }, "property": { "type": "Identifier", "start": 323, "end": 331, "loc": { "start": { "line": 11, "column": 36 }, "end": { "line": 11, "column": 44 }, "identifierName": "gridStep" }, "name": "gridStep" }, "computed": false }, "operator": "/", "right": { "type": "NumericLiteral", "start": 334, "end": 337, "loc": { "start": { "line": 11, "column": 47 }, "end": { "line": 11, "column": 50 } }, "extra": { "rawValue": 5, "raw": "5.0" }, "value": 5 } } } }, { "type": "ExpressionStatement", "start": 347, "end": 377, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 38 } }, "expression": { "type": "AssignmentExpression", "start": 347, "end": 376, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 37 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 347, "end": 364, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 25 } }, "object": { "type": "ThisExpression", "start": 347, "end": 351, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, "property": { "type": "Identifier", "start": 352, "end": 364, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 25 }, "identifierName": "sketchPoints" }, "name": "sketchPoints" }, "computed": false }, "right": { "type": "Identifier", "start": 367, "end": 376, "loc": { "start": { "line": 12, "column": 28 }, "end": { "line": 12, "column": 37 }, "identifierName": "undefined" }, "name": "undefined" } } } ], "directives": [], "trailingComments": null }, "trailingComments": [ { "type": "CommentLine", "value": "note: subobjects (like endpoints of line) are also marked", "start": 389, "end": 448, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 63 } } } ] }, { "type": "ClassMethod", "start": 453, "end": 660, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 22, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 453, "end": 465, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 16 }, "identifierName": "ignoreObject" }, "name": "ignoreObject", "leadingComments": null }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 466, "end": 472, "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 23 }, "identifierName": "ccrefs" }, "name": "ccrefs" } ], "body": { "type": "BlockStatement", "start": 474, "end": 660, "loc": { "start": { "line": 16, "column": 25 }, "end": { "line": 22, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 484, "end": 511, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 35 } }, "expression": { "type": "AssignmentExpression", "start": 484, "end": 510, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 34 } }, "operator": "=", "left": { "type": "Identifier", "start": 484, "end": 490, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 14 }, "identifierName": "ccrefs" }, "name": "ccrefs" }, "right": { "type": "CallExpression", "start": 493, "end": 510, "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 34 } }, "callee": { "type": "MemberExpression", "start": 493, "end": 502, "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 26 } }, "object": { "type": "ArrayExpression", "start": 493, "end": 495, "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 19 } }, "elements": [] }, "property": { "type": "Identifier", "start": 496, "end": 502, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 26 }, "identifierName": "concat" }, "name": "concat" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 503, "end": 509, "loc": { "start": { "line": 17, "column": 27 }, "end": { "line": 17, "column": 33 }, "identifierName": "ccrefs" }, "name": "ccrefs" } ] } } }, { "type": "ForOfStatement", "start": 520, "end": 654, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 21, "column": 13 } }, "left": { "type": "VariableDeclaration", "start": 525, "end": 534, "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 18, "column": 22 } }, "declarations": [ { "type": "VariableDeclarator", "start": 529, "end": 534, "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 22 } }, "id": { "type": "Identifier", "start": 529, "end": 534, "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 22 }, "identifierName": "ccref" }, "name": "ccref" }, "init": null } ], "kind": "let" }, "right": { "type": "Identifier", "start": 538, "end": 544, "loc": { "start": { "line": 18, "column": 26 }, "end": { "line": 18, "column": 32 }, "identifierName": "ccrefs" }, "name": "ccrefs" }, "body": { "type": "ForOfStatement", "start": 558, "end": 654, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 21, "column": 13 } }, "left": { "type": "VariableDeclaration", "start": 563, "end": 570, "loc": { "start": { "line": 19, "column": 17 }, "end": { "line": 19, "column": 24 } }, "declarations": [