UNPKG

awv3

Version:
1,647 lines (1,646 loc) 979 kB
{ "type": "Program", "start": 0, "end": 10072, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 254, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 57, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 57 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 8, "end": 13, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 13 } }, "imported": { "type": "Identifier", "start": 8, "end": 13, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 13 } }, "name": "Point" }, "local": { "type": "Identifier", "start": 8, "end": 13, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 13 } }, "name": "Point" } }, { "type": "ImportSpecifier", "start": 15, "end": 19, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 19 } }, "imported": { "type": "Identifier", "start": 15, "end": 19, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 19 } }, "name": "Line" }, "local": { "type": "Identifier", "start": 15, "end": 19, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 19 } }, "name": "Line" } }, { "type": "ImportSpecifier", "start": 21, "end": 24, "loc": { "start": { "line": 1, "column": 21 }, "end": { "line": 1, "column": 24 } }, "imported": { "type": "Identifier", "start": 21, "end": 24, "loc": { "start": { "line": 1, "column": 21 }, "end": { "line": 1, "column": 24 } }, "name": "Arc" }, "local": { "type": "Identifier", "start": 21, "end": 24, "loc": { "start": { "line": 1, "column": 21 }, "end": { "line": 1, "column": 24 } }, "name": "Arc" } } ], "importKind": "value", "source": { "type": "Literal", "start": 31, "end": 56, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 1, "column": 56 } }, "value": "../sketcher/geomobjects", "rawValue": "../sketcher/geomobjects", "raw": "'../sketcher/geomobjects'" } }, { "type": "ImportDeclaration", "start": 59, "end": 85, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 66, "end": 71, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "local": { "type": "Identifier", "start": 66, "end": 71, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 77, "end": 84, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ExpressionStatement", "start": 89, "end": 201, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 2 } }, "expression": { "type": "AssignmentExpression", "start": 89, "end": 200, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 1 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 89, "end": 102, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 13 } }, "object": { "type": "Identifier", "start": 89, "end": 94, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 5 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 95, "end": 102, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 13 } }, "name": "cross2d" }, "computed": false }, "right": { "type": "FunctionExpression", "start": 105, "end": 200, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 6, "column": 1 } }, "id": { "type": "Identifier", "start": 95, "end": 102, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 13 } }, "name": "cross2d" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 114, "end": 115, "loc": { "start": { "line": 4, "column": 25 }, "end": { "line": 4, "column": 26 } }, "name": "a" }, { "type": "Identifier", "start": 117, "end": 118, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 29 } }, "name": "b" } ], "body": { "type": "BlockStatement", "start": 120, "end": 200, "loc": { "start": { "line": 4, "column": 31 }, "end": { "line": 6, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 168, "end": 197, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 33 } }, "argument": { "type": "BinaryExpression", "start": 175, "end": 196, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 32 } }, "left": { "type": "BinaryExpression", "start": 175, "end": 184, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 20 } }, "left": { "type": "MemberExpression", "start": 175, "end": 178, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 14 } }, "object": { "type": "Identifier", "start": 175, "end": 176, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 12 } }, "name": "a", "leadingComments": null }, "property": { "type": "Identifier", "start": 177, "end": 178, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 14 } }, "name": "x" }, "computed": false, "leadingComments": null }, "operator": "*", "right": { "type": "MemberExpression", "start": 181, "end": 184, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 20 } }, "object": { "type": "Identifier", "start": 181, "end": 182, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 18 } }, "name": "b" }, "property": { "type": "Identifier", "start": 183, "end": 184, "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 20 } }, "name": "y" }, "computed": false }, "leadingComments": null }, "operator": "-", "right": { "type": "BinaryExpression", "start": 187, "end": 196, "loc": { "start": { "line": 5, "column": 23 }, "end": { "line": 5, "column": 32 } }, "left": { "type": "MemberExpression", "start": 187, "end": 190, "loc": { "start": { "line": 5, "column": 23 }, "end": { "line": 5, "column": 26 } }, "object": { "type": "Identifier", "start": 187, "end": 188, "loc": { "start": { "line": 5, "column": 23 }, "end": { "line": 5, "column": 24 } }, "name": "a" }, "property": { "type": "Identifier", "start": 189, "end": 190, "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 5, "column": 26 } }, "name": "y" }, "computed": false }, "operator": "*", "right": { "type": "MemberExpression", "start": 193, "end": 196, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 32 } }, "object": { "type": "Identifier", "start": 193, "end": 194, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 30 } }, "name": "b" }, "property": { "type": "Identifier", "start": 195, "end": 196, "loc": { "start": { "line": 5, "column": 31 }, "end": { "line": 5, "column": 32 } }, "name": "x" }, "computed": false } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": "TODO: properly install into THREE?...", "start": 123, "end": 162, "loc": { "start": { "line": 4, "column": 34 }, "end": { "line": 4, "column": 73 } }, "range": [ 123, 162 ] } ] } ] } } } }, { "type": "ExportNamedDeclaration", "start": 205, "end": 1048, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 25, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 212, "end": 1048, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 25, "column": 1 } }, "id": { "type": "Identifier", "start": 221, "end": 236, "loc": { "start": { "line": 8, "column": 16 }, "end": { "line": 8, "column": 31 } }, "name": "drawArcBy_S_T_E" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 237, "end": 245, "loc": { "start": { "line": 8, "column": 32 }, "end": { "line": 8, "column": 40 } }, "name": "startPos" }, { "type": "Identifier", "start": 247, "end": 259, "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 54 } }, "name": "startTangent" }, { "type": "Identifier", "start": 261, "end": 267, "loc": { "start": { "line": 8, "column": 56 }, "end": { "line": 8, "column": 62 } }, "name": "endPos" } ], "body": { "type": "BlockStatement", "start": 269, "end": 1048, "loc": { "start": { "line": 8, "column": 64 }, "end": { "line": 25, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 317, "end": 356, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 43 } }, "declarations": [ { "type": "VariableDeclarator", "start": 321, "end": 355, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 42 } }, "id": { "type": "Identifier", "start": 321, "end": 324, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 11 } }, "name": "dir", "leadingComments": null }, "init": { "type": "CallExpression", "start": 327, "end": 355, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 327, "end": 345, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 32 } }, "object": { "type": "CallExpression", "start": 327, "end": 341, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 28 } }, "callee": { "type": "MemberExpression", "start": 327, "end": 339, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 26 } }, "object": { "type": "Identifier", "start": 327, "end": 333, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 20 } }, "name": "endPos" }, "property": { "type": "Identifier", "start": 334, "end": 339, "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 26 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 342, "end": 345, "loc": { "start": { "line": 10, "column": 29 }, "end": { "line": 10, "column": 32 } }, "name": "sub" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 346, "end": 354, "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 41 } }, "name": "startPos" } ] }, "leadingComments": null } ], "kind": "var", "leadingComments": [ { "type": "CommentLine", "value": "should we create a line or an arc", "start": 276, "end": 311, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 39 } }, "range": [ 276, 311 ] } ] }, { "type": "VariableDeclaration", "start": 362, "end": 439, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 81 } }, "declarations": [ { "type": "VariableDeclarator", "start": 366, "end": 438, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 80 } }, "id": { "type": "Identifier", "start": 366, "end": 372, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 14 } }, "name": "onLine" }, "init": { "type": "CallExpression", "start": 375, "end": 438, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 80 } }, "callee": { "type": "MemberExpression", "start": 375, "end": 395, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 37 } }, "object": { "type": "CallExpression", "start": 375, "end": 391, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 33 } }, "callee": { "type": "MemberExpression", "start": 375, "end": 389, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 31 } }, "object": { "type": "Identifier", "start": 375, "end": 383, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 25 } }, "name": "startPos" }, "property": { "type": "Identifier", "start": 384, "end": 389, "loc": { "start": { "line": 11, "column": 26 }, "end": { "line": 11, "column": 31 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 392, "end": 395, "loc": { "start": { "line": 11, "column": 34 }, "end": { "line": 11, "column": 37 } }, "name": "add" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 396, "end": 437, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 79 } }, "callee": { "type": "MemberExpression", "start": 396, "end": 423, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 65 } }, "object": { "type": "CallExpression", "start": 396, "end": 407, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 49 } }, "callee": { "type": "MemberExpression", "start": 396, "end": 405, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 47 } }, "object": { "type": "Identifier", "start": 396, "end": 399, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 41 } }, "name": "dir" }, "property": { "type": "Identifier", "start": 400, "end": 405, "loc": { "start": { "line": 11, "column": 42 }, "end": { "line": 11, "column": 47 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 408, "end": 423, "loc": { "start": { "line": 11, "column": 50 }, "end": { "line": 11, "column": 65 } }, "name": "projectOnVector" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 424, "end": 436, "loc": { "start": { "line": 11, "column": 66 }, "end": { "line": 11, "column": 78 } }, "name": "startTangent" } ] } ] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 445, "end": 484, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 43 } }, "declarations": [ { "type": "VariableDeclarator", "start": 449, "end": 483, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 42 } }, "id": { "type": "Identifier", "start": 449, "end": 455, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 14 } }, "name": "height" }, "init": { "type": "CallExpression", "start": 458, "end": 483, "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 458, "end": 475, "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 34 } }, "object": { "type": "Identifier", "start": 458, "end": 464, "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 23 } }, "name": "onLine" }, "property": { "type": "Identifier", "start": 465, "end": 475, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 34 } }, "name": "distanceTo" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 476, "end": 482, "loc": { "start": { "line": 12, "column": 35 }, "end": { "line": 12, "column": 41 } }, "name": "endPos" } ] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 490, "end": 544, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", "start": 494, "end": 543, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 57 } }, "id": { "type": "Identifier", "start": 494, "end": 502, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 16 } }, "name": "isLinear" }, "init": { "type": "BinaryExpression", "start": 506, "end": 542, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 56 } }, "left": { "type": "Identifier", "start": 506, "end": 512, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 26 } }, "name": "height" }, "operator": "<=", "right": { "type": "BinaryExpression", "start": 516, "end": 542, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 13, "column": 56 } }, "left": { "type": "BinaryExpression", "start": 516, "end": 535, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 13, "column": 49 } }, "left": { "type": "CallExpression", "start": 516, "end": 528, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 13, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 516, "end": 526, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 13, "column": 40 } }, "object": { "type": "Identifier", "start": 516, "end": 519, "loc": { "start": { "line": 13, "column": 30 }, "end": { "line": 13, "column": 33 } }, "name": "dir" }, "property": { "type": "Identifier", "start": 520, "end": 526, "loc": { "start": { "line": 13, "column": 34 }, "end": { "line": 13, "column": 40 } }, "name": "length" }, "computed": false }, "arguments": [] }, "operator": "*", "right": { "type": "Literal", "start": 531, "end": 535, "loc": { "start": { "line": 13, "column": 45 }, "end": { "line": 13, "column": 49 } }, "value": 0.001, "rawValue": 0.001, "raw": "1e-3" } }, "operator": "+", "right": { "type": "Literal", "start": 538, "end": 542, "loc": { "start": { "line": 13, "column": 52 }, "end": { "line": 13, "column": 56 } }, "value": 0.001, "rawValue": 0.001, "raw": "1e-3"