UNPKG

awv3

Version:
1,561 lines (1,560 loc) 806 kB
{ "type": "Program", "start": 0, "end": 7922, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 211, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 54, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 54 } }, "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": 53, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 1, "column": 53 } }, "value": "sketcher/geomobjects", "rawValue": "sketcher/geomobjects", "raw": "'sketcher/geomobjects'" } }, { "type": "ImportDeclaration", "start": 55, "end": 81, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 62, "end": 67, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "local": { "type": "Identifier", "start": 62, "end": 67, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 73, "end": 80, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ExportNamedDeclaration", "start": 83, "end": 910, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 21, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 90, "end": 910, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 21, "column": 1 } }, "id": { "type": "Identifier", "start": 99, "end": 114, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 31 } }, "name": "drawArcBy_S_T_E" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 115, "end": 123, "loc": { "start": { "line": 4, "column": 32 }, "end": { "line": 4, "column": 40 } }, "name": "startPos" }, { "type": "Identifier", "start": 125, "end": 137, "loc": { "start": { "line": 4, "column": 42 }, "end": { "line": 4, "column": 54 } }, "name": "startTangent" }, { "type": "Identifier", "start": 139, "end": 145, "loc": { "start": { "line": 4, "column": 56 }, "end": { "line": 4, "column": 62 } }, "name": "endPos" } ], "body": { "type": "BlockStatement", "start": 147, "end": 910, "loc": { "start": { "line": 4, "column": 64 }, "end": { "line": 21, "column": 1 } }, "body": [ { "type": "VariableDeclaration", "start": 193, "end": 232, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 43 } }, "declarations": [ { "type": "VariableDeclarator", "start": 197, "end": 231, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 42 } }, "id": { "type": "Identifier", "start": 197, "end": 200, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 11 } }, "name": "dir", "leadingComments": null }, "init": { "type": "CallExpression", "start": 203, "end": 231, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 203, "end": 221, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 32 } }, "object": { "type": "CallExpression", "start": 203, "end": 217, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 28 } }, "callee": { "type": "MemberExpression", "start": 203, "end": 215, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 26 } }, "object": { "type": "Identifier", "start": 203, "end": 209, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 20 } }, "name": "endPos" }, "property": { "type": "Identifier", "start": 210, "end": 215, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 26 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 218, "end": 221, "loc": { "start": { "line": 6, "column": 29 }, "end": { "line": 6, "column": 32 } }, "name": "sub" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 222, "end": 230, "loc": { "start": { "line": 6, "column": 33 }, "end": { "line": 6, "column": 41 } }, "name": "startPos" } ] }, "leadingComments": null } ], "kind": "var", "leadingComments": [ { "type": "CommentLine", "value": "should we create a line or an arc", "start": 153, "end": 188, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 39 } }, "range": [ 153, 188 ] } ] }, { "type": "VariableDeclaration", "start": 237, "end": 314, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 81 } }, "declarations": [ { "type": "VariableDeclarator", "start": 241, "end": 313, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 80 } }, "id": { "type": "Identifier", "start": 241, "end": 247, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 14 } }, "name": "onLine" }, "init": { "type": "CallExpression", "start": 250, "end": 313, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 80 } }, "callee": { "type": "MemberExpression", "start": 250, "end": 270, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 37 } }, "object": { "type": "CallExpression", "start": 250, "end": 266, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 33 } }, "callee": { "type": "MemberExpression", "start": 250, "end": 264, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 31 } }, "object": { "type": "Identifier", "start": 250, "end": 258, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 25 } }, "name": "startPos" }, "property": { "type": "Identifier", "start": 259, "end": 264, "loc": { "start": { "line": 7, "column": 26 }, "end": { "line": 7, "column": 31 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 267, "end": 270, "loc": { "start": { "line": 7, "column": 34 }, "end": { "line": 7, "column": 37 } }, "name": "add" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 271, "end": 312, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 79 } }, "callee": { "type": "MemberExpression", "start": 271, "end": 298, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 65 } }, "object": { "type": "CallExpression", "start": 271, "end": 282, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 49 } }, "callee": { "type": "MemberExpression", "start": 271, "end": 280, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 47 } }, "object": { "type": "Identifier", "start": 271, "end": 274, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 41 } }, "name": "dir" }, "property": { "type": "Identifier", "start": 275, "end": 280, "loc": { "start": { "line": 7, "column": 42 }, "end": { "line": 7, "column": 47 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 283, "end": 298, "loc": { "start": { "line": 7, "column": 50 }, "end": { "line": 7, "column": 65 } }, "name": "projectOnVector" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 299, "end": 311, "loc": { "start": { "line": 7, "column": 66 }, "end": { "line": 7, "column": 78 } }, "name": "startTangent" } ] } ] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 319, "end": 358, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 43 } }, "declarations": [ { "type": "VariableDeclarator", "start": 323, "end": 357, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 42 } }, "id": { "type": "Identifier", "start": 323, "end": 329, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 14 } }, "name": "height" }, "init": { "type": "CallExpression", "start": 332, "end": 357, "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 332, "end": 349, "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 34 } }, "object": { "type": "Identifier", "start": 332, "end": 338, "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 23 } }, "name": "onLine" }, "property": { "type": "Identifier", "start": 339, "end": 349, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 34 } }, "name": "distanceTo" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 350, "end": 356, "loc": { "start": { "line": 8, "column": 35 }, "end": { "line": 8, "column": 41 } }, "name": "endPos" } ] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 363, "end": 417, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", "start": 367, "end": 416, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 57 } }, "id": { "type": "Identifier", "start": 367, "end": 375, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 16 } }, "name": "isLinear" }, "init": { "type": "BinaryExpression", "start": 379, "end": 415, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 56 } }, "left": { "type": "Identifier", "start": 379, "end": 385, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 26 } }, "name": "height" }, "operator": "<=", "right": { "type": "BinaryExpression", "start": 389, "end": 415, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 56 } }, "left": { "type": "BinaryExpression", "start": 389, "end": 408, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 49 } }, "left": { "type": "CallExpression", "start": 389, "end": 401, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 42 } }, "callee": { "type": "MemberExpression", "start": 389, "end": 399, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 40 } }, "object": { "type": "Identifier", "start": 389, "end": 392, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 33 } }, "name": "dir" }, "property": { "type": "Identifier", "start": 393, "end": 399, "loc": { "start": { "line": 9, "column": 34 }, "end": { "line": 9, "column": 40 } }, "name": "length" }, "computed": false }, "arguments": [] }, "operator": "*", "right": { "type": "Literal", "start": 404, "end": 408, "loc": { "start": { "line": 9, "column": 45 }, "end": { "line": 9, "column": 49 } }, "value": 0.001, "rawValue": 0.001, "raw": "1e-3" } }, "operator": "+", "right": { "type": "Literal", "start": 411, "end": 415, "loc": { "start": { "line": 9, "column": 52 }, "end": { "line": 9, "column": 56 } }, "value": 0.001, "rawValue": 0.001, "raw": "1e-3" } }, "parenthesizedExpression": true } } ], "kind": "var" }, { "type": "IfStatement", "start": 423, "end": 908, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 20, "column": 5 } }, "test": { "type": "Identifier", "start": 427, "end": 435, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 16 } }, "name": "isLinear" }, "consequent": { "type": "ReturnStatement", "start": 445, "end": 483, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 46 } }, "argument": { "type": "ObjectExpression", "start": 452, "end": 482, "loc": { "start": { "line": 12, "column": 15 }, "end": { "line": 12, "column": 45 } }, "properties": [ { "type": "Property", "start": 453, "end": 468, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 31 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 453, "end": 458, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 21 } }, "name": "start" }, "value": { "type": "Identifier", "start": 460, "end": 468, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 31 } }, "name": "startPos" }, "kind": "init" }, { "type": "Property", "start": 470, "end": 481, "loc": { "start": { "line": 12, "column": 33 }, "end": { "line": 12, "column": 44 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 470, "end": 473, "loc": { "start": { "line": 12, "column": 33 }, "end": { "line": 12, "column": 36 } }, "name": "end" }, "value": { "type": "Identifier", "start": 475, "end": 481, "loc": { "start": { "line": 12, "column": 38 }, "end": { "line": 12, "column": 44 } }, "name": "endPos" }, "kind": "init" } ] } }, "alternate": { "type": "BlockStatement", "start": 493, "end": 908, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 20, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 567, "end": 619, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 60 } }, "declarations": [ { "type": "VariableDeclarator", "start": 571, "end": 618, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 59 } }, "id": { "type": "Identifier", "start": 571, "end": 577, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 18 } }, "name": "normal", "leadingComments": null }, "init": { "type": "CallExpression", "start": 580, "end": 618, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 59 } }, "callee": { "type": "MemberExpression", "start": 580, "end": 616, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 57 } }, "object": { "type": "CallExpression", "start": 580, "end": 606, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 47 } }, "callee": { "type": "MemberExpression", "start": 580, "end": 598, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 39 } }, "object": { "type": "CallExpression", "start": 580, "end": 594, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 35 } }, "callee": { "type": "MemberExpression", "start": 580, "end": 592, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 33 } }, "object": { "type": "Identifier", "start": 580, "end": 586, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 27 } }, "name": "endPos" }, "property": { "type": "Identifier", "start": 587, "end": 592, "loc": { "start": { "line": 15, "column": 28 }, "end": { "line": 15, "column": 33 } }, "name": "clone" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 595, "end": 598, "loc": { "start": {