UNPKG

awv3

Version:
1,570 lines (1,569 loc) 2.86 MB
{ "type": "Program", "start": 0, "end": 26973, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 695, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 37, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 37 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 } }, "local": { "type": "Identifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 } }, "name": "Sketch" } } ], "importKind": "value", "source": { "type": "Literal", "start": 19, "end": 36, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 36 } }, "value": "sketcher/sketch", "rawValue": "sketcher/sketch", "raw": "'sketcher/sketch'" } }, { "type": "ImportDeclaration", "start": 38, "end": 79, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 41 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 45, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 15 } }, "local": { "type": "Identifier", "start": 45, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 15 } }, "name": "Sketcher" } } ], "importKind": "value", "source": { "type": "Literal", "start": 59, "end": 78, "loc": { "start": { "line": 2, "column": 21 }, "end": { "line": 2, "column": 40 } }, "value": "sketcher/sketcher", "rawValue": "sketcher/sketcher", "raw": "'sketcher/sketcher'" } }, { "type": "ImportDeclaration", "start": 80, "end": 130, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 50 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 88, "end": 102, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 22 } }, "imported": { "type": "Identifier", "start": 88, "end": 102, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 22 } }, "name": "ClassCadObject" }, "local": { "type": "Identifier", "start": 88, "end": 102, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 22 } }, "name": "ClassCadObject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 109, "end": 129, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 3, "column": 49 } }, "value": "sketcher/ccobjects", "rawValue": "sketcher/ccobjects", "raw": "'sketcher/ccobjects'" } }, { "type": "ImportDeclaration", "start": 131, "end": 160, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 29 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 138, "end": 142, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "local": { "type": "Identifier", "start": 138, "end": 142, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "name": "View" } } ], "importKind": "value", "source": { "type": "Literal", "start": 148, "end": 159, "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 28 } }, "value": "core/view", "rawValue": "core/view", "raw": "'core/view'" } }, { "type": "ImportDeclaration", "start": 161, "end": 218, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 57 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 169, "end": 181, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 20 } }, "imported": { "type": "Identifier", "start": 169, "end": 181, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 20 } }, "name": "trackPromise" }, "local": { "type": "Identifier", "start": 169, "end": 181, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 20 } }, "name": "trackPromise" } }, { "type": "ImportSpecifier", "start": 183, "end": 190, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 29 } }, "imported": { "type": "Identifier", "start": 183, "end": 190, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 29 } }, "name": "Interop" }, "local": { "type": "Identifier", "start": 183, "end": 190, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 29 } }, "name": "Interop" } } ], "importKind": "value", "source": { "type": "Literal", "start": 197, "end": 217, "loc": { "start": { "line": 5, "column": 36 }, "end": { "line": 5, "column": 56 } }, "value": "sketcher/cchelpers", "rawValue": "sketcher/cchelpers", "raw": "'sketcher/cchelpers'" } }, { "type": "ImportDeclaration", "start": 219, "end": 245, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 226, "end": 231, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 12 } }, "local": { "type": "Identifier", "start": 226, "end": 231, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 237, "end": 244, "loc": { "start": { "line": 6, "column": 18 }, "end": { "line": 6, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" }, "trailingComments": [ { "type": "CommentLine", "value": "note: invisible geometry is not used anymore...", "start": 247, "end": 296, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 49 } }, "range": [ 247, 296 ] }, { "type": "CommentLine", "value": "var interactMaterial = new THREE.MeshBasicMaterial({color: 0xff0000, visible: false, side: THREE.DoubleSide});", "start": 297, "end": 409, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 112 } }, "range": [ 297, 409 ] }, { "type": "CommentLine", "value": " mixin for geometric objects that can be highlighted", "start": 411, "end": 465, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 54 } }, "range": [ 411, 465 ] } ] }, { "type": "FunctionDeclaration", "start": 466, "end": 1901, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 43, "column": 1 } }, "id": { "type": "Identifier", "start": 475, "end": 492, "loc": { "start": { "line": 12, "column": 9 }, "end": { "line": 12, "column": 26 } }, "name": "meshHighlightable", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 495, "end": 1901, "loc": { "start": { "line": 12, "column": 29 }, "end": { "line": 43, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 501, "end": 1414, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 32, "column": 6 } }, "expression": { "type": "AssignmentExpression", "start": 501, "end": 1413, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 32, "column": 5 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 501, "end": 511, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 14 } }, "object": { "type": "ThisExpression", "start": 501, "end": 505, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 8 } } }, "property": { "type": "Identifier", "start": 506, "end": 511, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 14 } }, "name": "hover" }, "computed": false }, "right": { "type": "FunctionExpression", "start": 514, "end": 1413, "loc": { "start": { "line": 13, "column": 17 }, "end": { "line": 32, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 525, "end": 1413, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 32, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 535, "end": 557, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 30 } }, "declarations": [ { "type": "VariableDeclarator", "start": 539, "end": 556, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 29 } }, "id": { "type": "Identifier", "start": 539, "end": 542, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 15 } }, "name": "obj" }, "init": { "type": "MemberExpression", "start": 545, "end": 556, "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 29 } }, "object": { "type": "ThisExpression", "start": 545, "end": 549, "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 22 } } }, "property": { "type": "Identifier", "start": 550, "end": 556, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 29 } }, "name": "parent" }, "computed": false } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 566, "end": 605, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 47 } }, "declarations": [ { "type": "VariableDeclarator", "start": 570, "end": 604, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 46 } }, "id": { "type": "Identifier", "start": 570, "end": 576, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 18 } }, "name": "sketch" }, "init": { "type": "CallExpression", "start": 579, "end": 604, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 46 } }, "callee": { "type": "MemberExpression", "start": 579, "end": 598, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 40 } }, "object": { "type": "Identifier", "start": 579, "end": 585, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 27 } }, "name": "Sketch" }, "property": { "type": "Identifier", "start": 586, "end": 598, "loc": { "start": { "line": 15, "column": 28 }, "end": { "line": 15, "column": 40 } }, "name": "FindSketchOf" }, "computed": false }, "arguments": [ { "type": "ThisExpression", "start": 599, "end": 603, "loc": { "start": { "line": 15, "column": 41 }, "end": { "line": 15, "column": 45 } } } ] } } ], "kind": "var" }, { "type": "IfStatement", "start": 614, "end": 634, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 28 } }, "test": { "type": "UnaryExpression", "start": 618, "end": 625, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 19 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 619, "end": 625, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 19 } }, "name": "sketch" } }, "consequent": { "type": "ReturnStatement", "start": 627, "end": 634, "loc": { "start": { "line": 16, "column": 21 }, "end": { "line": 16, "column": 28 } }, "argument": null, "leadingComments": null, "trailingComments": null }, "alternate": null, "trailingComments": [ { "type": "CommentLine", "value": "like object being deleted...", "start": 638, "end": 668, "loc": { "start": { "line": 16, "column": 32 }, "end": { "line": 16, "column": 62 } }, "range": [ 638, 668 ] } ] }, { "type": "ExpressionStatement", "start": 677, "end": 744, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 75 } }, "expression": { "type": "AssignmentExpression", "start": 677, "end": 743, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 74 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 677, "end": 696, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 27 } }, "object": { "type": "MemberExpression", "start": 677, "end": 690, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 21 } }, "object": { "type": "ThisExpression", "start": 677, "end": 681, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 682, "end": 690, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 21 } }, "name": "material" }, "computed": false, "leadingComments": null }, "property": { "type": "Identifier", "start": 691, "end": 696, "loc": { "start": { "line": 17, "column": 22 }, "end": { "line": 17, "column": 27 } }, "name": "color" }, "computed": false, "leadingComments": null }, "right": { "type": "NewExpression", "start": 699, "end": 743, "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 74 } }, "callee": { "type": "MemberExpression", "start": 703, "end": 714, "loc": { "start": { "line": 17, "column": 34 }, "end": { "line": 17, "column": 45 } }, "object": { "type": "Identifier", "start": 703, "end": 708, "loc": { "start": { "line": 17, "column": 34 }, "end": { "line": 17, "column": 39 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 709, "end": 714, "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 45 } }, "name": "Color" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 715, "end": 742, "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 17, "column": 73 } }, "callee": { "type": "Identifier", "start": 715, "end": 723, "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 17, "column": 54 } }, "name": "getColor" }, "arguments": [ { "type": "MemberExpression", "start": 724, "end": 735, "loc": { "start": { "line": 17, "column": 55 }, "end": { "line": 17, "column": 66 } }, "object": { "type": "ThisExpression", "start": 724, "end": 728, "loc": { "start": { "line": 17, "column": 55 }, "end": { "line": 17, "column": 59 } } }, "property": { "type": "Identifier", "start": 729, "end": 735, "loc": { "start": { "line": 17, "column": 60 }, "end": { "line": 17, "column": 66 } }, "name": "parent" }, "computed": false }, { "type": "Literal", "start": 737, "end": 741, "loc": { "start": { "line": 17, "column": 68 }, "end": { "line": 17, "column": 72 } }, "value": true, "rawValue": true, "raw": "true" } ] } ] }, "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": "like object being deleted...", "start": 638, "end": 668, "loc": { "start": { "line": 16, "column": 32 }, "end": { "line": 16, "column": 62 } }, "range": [ 638, 668 ] } ] }, { "type": "IfStatement", "start": 753, "end": 791, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 46 } }, "test": { "type": "MemberExpression", "start": 757, "end": 782, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 37 } }, "object": { "type": "Identifier", "start": 757, "end": 760, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 15 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 761, "end": 782, "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 37 } }, "name": "auxiliaryConstruction" }, "computed": false }, "consequent": { "type": "ReturnStatement", "start": 784, "end": 791, "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 18, "column": 46 } }, "argument": null }, "alternate": null }, { "type": "VariableDeclaration", "start": 800, "end": 999, "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 25, "column": 10 } }, "declarations": [ { "type": "VariableDeclarator", "start": 804, "end": 998, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 25, "column": 9 } }, "id": { "type": "Identifier", "start": 804, "end": 812, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 20 } }, "name": "material" }, "init": { "type": "NewExpression", "start": 815, "end": 998, "loc": { "start": { "line": 19, "column": 23 }, "end": { "line": 25, "column": 9 } }, "callee": { "type": "MemberExpression", "start": 819, "end": 842, "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 19, "column": 50 } }, "object": { "type": "Identifier", "start": 819, "end": 824, "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 19, "column": 32 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 825, "end": 842, "loc": { "start": { "line": 19, "column": 33 }, "end": { "line": 19, "column": 50 } }, "name": "LineBasicMaterial" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 856, "end": 988, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 24, "column": 13 } }, "properties": [ { "type": "Property", "start": 874, "end": 909, "loc": { "start": { "line": 21, "column": 16 }, "end": { "line": 21, "column": 51 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 874, "end": 879, "loc": { "start": { "line": 21, "column": 16 }, "end": { "line": 21, "column": 21 } }, "name": "color" }, "value": {