UNPKG

awv3

Version:
1,980 lines (1,979 loc) 2.78 MB
{ "type": "Program", "start": 0, "end": 32180, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 837, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 26, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "local": { "type": "Identifier", "start": 7, "end": 12, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 12 } }, "name": "delay" } } ], "importKind": "value", "source": { "type": "Literal", "start": 18, "end": 25, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 25 } }, "value": "delay", "rawValue": "delay", "raw": "'delay'" } }, { "type": "ImportDeclaration", "start": 27, "end": 53, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 34, "end": 39, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "local": { "type": "Identifier", "start": 34, "end": 39, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 45, "end": 52, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ImportDeclaration", "start": 54, "end": 94, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 61, "end": 69, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 15 } }, "local": { "type": "Identifier", "start": 61, "end": 69, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 15 } }, "name": "Object3D" } } ], "importKind": "value", "source": { "type": "Literal", "start": 75, "end": 93, "loc": { "start": { "line": 3, "column": 21 }, "end": { "line": 3, "column": 39 } }, "value": "../three/object3", "rawValue": "../three/object3", "raw": "'../three/object3'" } }, { "type": "ImportDeclaration", "start": 95, "end": 135, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 40 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 102, "end": 108, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 13 } }, "local": { "type": "Identifier", "start": 102, "end": 108, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 13 } }, "name": "Sketch" } } ], "importKind": "value", "source": { "type": "Literal", "start": 114, "end": 134, "loc": { "start": { "line": 4, "column": 19 }, "end": { "line": 4, "column": 39 } }, "value": "../sketcher/sketch", "rawValue": "../sketcher/sketch", "raw": "'../sketcher/sketch'" } }, { "type": "ImportDeclaration", "start": 136, "end": 180, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 44 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 143, "end": 151, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 } }, "local": { "type": "Identifier", "start": 143, "end": 151, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 15 } }, "name": "Sketcher" } } ], "importKind": "value", "source": { "type": "Literal", "start": 157, "end": 179, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 43 } }, "value": "../sketcher/sketcher", "rawValue": "../sketcher/sketcher", "raw": "'../sketcher/sketcher'" } }, { "type": "ImportDeclaration", "start": 181, "end": 235, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 54 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 188, "end": 204, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 23 } }, "local": { "type": "Identifier", "start": 188, "end": 204, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 23 } }, "name": "SketchConstraint" } } ], "importKind": "value", "source": { "type": "Literal", "start": 210, "end": 234, "loc": { "start": { "line": 6, "column": 29 }, "end": { "line": 6, "column": 53 } }, "value": "../sketcher/constraint", "rawValue": "../sketcher/constraint", "raw": "'../sketcher/constraint'" } }, { "type": "ImportDeclaration", "start": 236, "end": 382, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 10, "column": 33 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 249, "end": 269, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 24 } }, "imported": { "type": "Identifier", "start": 249, "end": 254, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 9 } }, "name": "Point" }, "local": { "type": "Identifier", "start": 258, "end": 269, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 24 } }, "name": "SketchPoint" } }, { "type": "ImportSpecifier", "start": 271, "end": 289, "loc": { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 44 } }, "imported": { "type": "Identifier", "start": 271, "end": 275, "loc": { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 30 } }, "name": "Line" }, "local": { "type": "Identifier", "start": 279, "end": 289, "loc": { "start": { "line": 8, "column": 34 }, "end": { "line": 8, "column": 44 } }, "name": "SketchLine" } }, { "type": "ImportSpecifier", "start": 291, "end": 307, "loc": { "start": { "line": 8, "column": 46 }, "end": { "line": 8, "column": 62 } }, "imported": { "type": "Identifier", "start": 291, "end": 294, "loc": { "start": { "line": 8, "column": 46 }, "end": { "line": 8, "column": 49 } }, "name": "Arc" }, "local": { "type": "Identifier", "start": 298, "end": 307, "loc": { "start": { "line": 8, "column": 53 }, "end": { "line": 8, "column": 62 } }, "name": "SketchArc" } }, { "type": "ImportSpecifier", "start": 313, "end": 348, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 39 } }, "imported": { "type": "Identifier", "start": 313, "end": 328, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 19 } }, "name": "GeometricObject" }, "local": { "type": "Identifier", "start": 332, "end": 348, "loc": { "start": { "line": 9, "column": 23 }, "end": { "line": 9, "column": 39 } }, "name": "SketchGeomObject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 356, "end": 381, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 32 } }, "value": "../sketcher/geomobjects", "rawValue": "../sketcher/geomobjects", "raw": "'../sketcher/geomobjects'" } }, { "type": "ImportDeclaration", "start": 383, "end": 432, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 13, "column": 31 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 396, "end": 400, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 8 } }, "imported": { "type": "Identifier", "start": 396, "end": 400, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 8 } }, "name": "Part" }, "local": { "type": "Identifier", "start": 396, "end": 400, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 8 } }, "name": "Part" } } ], "importKind": "value", "source": { "type": "Literal", "start": 408, "end": 431, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 13, "column": 30 } }, "value": "../sketcher/ccobjects", "rawValue": "../sketcher/ccobjects", "raw": "'../sketcher/ccobjects'" } }, { "type": "FunctionDeclaration", "start": 435, "end": 699, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 22, "column": 1 } }, "id": { "type": "Identifier", "start": 444, "end": 449, "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 16, "column": 14 } }, "name": "check" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 450, "end": 454, "loc": { "start": { "line": 16, "column": 15 }, "end": { "line": 16, "column": 19 } }, "name": "cond" }, { "type": "Identifier", "start": 456, "end": 463, "loc": { "start": { "line": 16, "column": 21 }, "end": { "line": 16, "column": 28 } }, "name": "message" } ], "body": { "type": "BlockStatement", "start": 465, "end": 699, "loc": { "start": { "line": 16, "column": 30 }, "end": { "line": 22, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 653, "end": 697, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 21, "column": 33 } }, "test": { "type": "UnaryExpression", "start": 657, "end": 662, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 13 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 658, "end": 662, "loc": { "start": { "line": 20, "column": 9 }, "end": { "line": 20, "column": 13 } }, "name": "cond", "leadingComments": null }, "leadingComments": null }, "consequent": { "type": "ThrowStatement", "start": 672, "end": 697, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 33 } }, "argument": { "type": "NewExpression", "start": 678, "end": 696, "loc": { "start": { "line": 21, "column": 14 }, "end": { "line": 21, "column": 32 } }, "callee": { "type": "Identifier", "start": 682, "end": 687, "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 23 } }, "name": "Error" }, "arguments": [ { "type": "Identifier", "start": 688, "end": 695, "loc": { "start": { "line": 21, "column": 24 }, "end": { "line": 21, "column": 31 } }, "name": "message" } ] } }, "alternate": null, "leadingComments": [ { "type": "CommentLine", "value": "TODO: Throw custom exception and wrap arguments into it", "start": 471, "end": 528, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 17, "column": 61 } }, "range": [ 471, 528 ] }, { "type": "CommentLine", "value": "so that it could be redirected to console.error later.", "start": 533, "end": 589, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 60 } }, "range": [ 533, 589 ] }, { "type": "CommentLine", "value": "After that improve error messages all over the code.", "start": 594, "end": 648, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 58 } }, "range": [ 594, 648 ] } ] } ], "trailingComments": null }, "trailingComments": [ { "type": "CommentLine", "value": "for setting names used in sketch matching", "start": 701, "end": 744, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 24, "column": 43 } }, "range": [ 701, 744 ] } ] }, { "type": "FunctionDeclaration", "start": 745, "end": 932, "loc": { "start": { "line": 25, "column": 0 }, "end": { "line": 28, "column": 1 } }, "id": { "type": "Identifier", "start": 754, "end": 765, "loc": { "start": { "line": 25, "column": 9 }, "end": { "line": 25, "column": 20 } }, "name": "setTestName", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 766, "end": 769, "loc": { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 24 } }, "name": "obj" }, { "type": "Identifier", "start": 771, "end": 775, "loc": { "start": { "line": 25, "column": 26 }, "end": { "line": 25, "column": 30 } }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 777, "end": 932, "loc": { "start": { "line": 25, "column": 32 }, "end": { "line": 28, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 783, "end": 905, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 126 } }, "expression": { "type": "CallExpression", "start": 783, "end": 904, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 125 } }, "callee": { "type": "Identifier", "start": 783, "end": 788, "loc": { "start": { "line": 26, "column": 4 }, "end": { "line": 26, "column": 9 } }, "name": "check" }, "arguments": [ { "type": "LogicalExpression", "start": 789, "end": 840, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 26, "column": 61 } }, "left": { "type": "BinaryExpression", "start": 789, "end": 815, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 26, "column": 36 } }, "left": { "type": "MemberExpression", "start": 789, "end": 801, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 26, "column": 22 } }, "object": { "type": "Identifier", "start": 789, "end": 792, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 26, "column": 13 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 793, "end": 801, "loc": { "start": { "line": 26, "column": 14 }, "end": { "line": 26, "column": 22 } }, "name": "testName" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 806, "end": 815, "loc": { "start": { "line": 26, "column": 27 }, "end": { "line": 26, "column": 36 } }, "name": "undefined" } }, "operator": "||", "right": { "type": "BinaryExpression", "start": 819, "end": 840, "loc": { "start": { "line": 26, "column": 40 }, "end": { "line": 26, "column": 61 } }, "left": { "type": "MemberExpression", "start": 819, "end": 831, "loc": { "start": { "line": 26, "column": 40 }, "end": { "line": 26, "column": 52 } }, "object": { "type": "Identifier", "start": 819, "end": 822, "loc": { "start": { "line": 26, "column": 40 }, "end": { "line": 26, "column": 43 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 823, "end": 831, "loc": { "start": { "line": 26, "column": 44 }, "end": { "line": 26, "column": 52 } }, "name": "testName" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 836, "end": 840, "loc": { "start": { "line": 26, "column": 57 }, "end": { "line": 26, "column": 61 } }, "name": "name" } } }, { "type": "BinaryExpression", "start": 842, "end": 903, "loc": { "start": { "line": 26, "column": 63 }, "end": { "line": 26, "column": 124 } }, "left": { "type": "BinaryExpression", "start": 842, "end": 896, "loc": { "start": { "line": 26, "column": 63 }, "end": { "line": 26, "column": 117 } }, "left": { "type": "BinaryExpression", "start": 842, "end": 885, "loc": { "start": { "line": 26, "column": 63 }, "end": { "line": 26, "column": 106 } }, "left": { "type": "Literal", "start": 842, "end": 870, "loc": { "start": { "line": 26, "column": 63 }, "end": { "line": 26, "column": 91 } }, "value": "Overwriting object's name ", "rawValue": "Overwriting object's name ", "raw": "\"Overwriting object's name \"" }, "operator": "+", "right": { "type": "MemberExpression", "start": 873, "end": 885, "loc": { "start": { "line": 26, "column": 94 }, "end": { "line": 26, "column": 106 } }, "object": { "type": "Identifier", "start": 873, "end": 876, "loc": { "start": { "line": 26, "column": 94 }, "end": { "line": 26, "column": 97 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 877, "end": 885, "loc": { "start": { "line": 26, "column": 98 }, "end": { "line": 26, "column": 106 } }, "name": "testName" }, "computed": false } }, "operator": "+", "right": { "type": "Literal", "start": 888, "end": 896, "loc": { "start": { "line": 26, "column": 109 }, "end": { "line": 26, "column": 117 } }, "value": " with ", "rawValue": " with ", "raw": "\" with \"" } }, "operator": "+", "right": { "type": "Identifier", "start": 899, "end": 903, "loc": { "start": { "line": 26, "column": 120 }, "end": { "line": 26, "column": 124 } }, "name": "name" } } ] } }, { "type": "ExpressionStatement", "start": 910, "end": 930, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 910, "end": 929, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 23 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 910, "end": 922, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 16 } }, "object": { "type": "Identifier", "start": 910, "end": 913, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 7 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 914, "end": 922, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 16 } }, "name": "testName" }, "computed": false }, "right": { "type": "Identifier", "start": 925, "end": 929, "loc": { "start": { "line": 27, "column": 19 }, "end": { "line": 27, "column": 23 } }, "name": "name" } } } ] }, "leadingComments": [ { "type": "CommentLine", "value": "for setting names used in sketch matching", "start": 701, "end": 744, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 24, "column": 43 } }, "range": [ 701, 744 ] } ] }, { "type": "FunctionDeclaration", "start": 933, "end": 993, "loc": { "start": { "line": 29, "column": 0 }, "end": { "line": 31, "column": 1 } }, "id": { "type": "Identifier", "start": 942, "end": 953, "loc": { "start": { "line": 29, "column": 9 }, "end": { "line": 29, "column": 20 } }, "name": "getTestName" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 954, "end": 957, "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 24 } }, "name": "obj" }, { "type": "Identifier", "start": 959, "end": 963, "loc": { "start": { "line": 29, "column": 26 }, "end": { "line": 29, "column": 30 } }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 965, "end": 993, "loc": { "start": { "line": 29, "column": 32 }, "end": { "line": 31, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 971, "end": 991, "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 24 } }, "argument": { "type": "MemberExpression", "start": 978, "end": 990, "loc": { "start": { "line": 30, "column": 11 }, "end": { "line": 30, "column": 23 } }, "object": { "type": "Identifier", "start": 978, "end": 981, "loc": { "start": { "line": 30, "column": 11 }, "end": { "line": 30, "column": 14 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 982, "end": 990, "loc": { "start": { "line": 30, "column": 15 }, "end": { "line": 30, "column": 23 } }, "name": "testName" }, "computed": false } } ] } }, { "type": "FunctionDeclaration", "start": 995, "end": 1314, "loc": { "start": { "line": 33, "column": 0 }, "end": { "line": 39, "column": 1 } }, "id": { "type": "Identifier", "start": 1004, "end": 1015, "loc": { "start": { "line": 33, "column": 9 }, "end": { "line": 33, "column": 20 } }, "name": "_convVector" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1016, "end": 1019, "loc": { "start": { "line": 33, "column": 21 }, "end": { "line": 33, "column": 24 } }, "name": "vec" } ], "body": { "type": "BlockStatement", "start": 1021, "end": 1314, "loc": { "start": { "line": 33, "column": 26 }, "end": { "line": 39, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 1027, "end": 1181, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 35, "column": 49 } }, "test": { "type": "LogicalExpression", "start": 1031, "end": 1130, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 107 } }, "left": { "type": "LogicalExpression", "start": 1031, "end": 1099, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 76 } }, "left": { "type": "LogicalExpression", "start": 1031, "end": 1068, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 45 } }, "left": { "type": "CallExpression", "start": 1031, "end": 1049, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 26 } }, "callee": { "type": "MemberExpression", "start": 1031, "end": 1044, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 21 } }, "object": { "type": "Identifier", "start": 1031, "end": 1036, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 13 } }, "name": "Array" }, "property": { "type": "Identifier", "start": 1037, "end": 1044, "loc": { "start": { "line": 34, "column": 14 }, "end": { "line": 34, "column": 21 } }, "name": "isArray" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 1045, "end": 1048, "loc": { "start": { "line": 34, "column": 22 }, "end": { "line": 34, "column": 25 } }, "name": "vec" } ] }, "operator": "&&", "right": { "type": "BinaryExpression", "start": 1053, "end": 1068, "loc": { "start": { "line": 34, "column": 30 }, "end": { "line": 34, "column": 45 } }, "left": { "type": "MemberExpression", "start": 1053, "end": 1063, "loc": { "start": { "line": 34, "column": 30 }, "end": { "line": 34, "column": 40 } }, "object": { "type": "Identifier", "start": 1053, "end": 1056, "loc": { "start": { "line": 34, "column": 30 }, "end": { "line": 34, "column": 33 } },