UNPKG

awv3

Version:
1,594 lines (1,593 loc) 2.95 MB
{ "type": "Program", "start": 0, "end": 27660, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 711, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 40, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 40 } }, "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": 39, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 39 } }, "value": "../sketcher/sketch", "rawValue": "../sketcher/sketch", "raw": "'../sketcher/sketch'" } }, { "type": "ImportDeclaration", "start": 41, "end": 85, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 44 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 48, "end": 56, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 15 } }, "local": { "type": "Identifier", "start": 48, "end": 56, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 15 } }, "name": "Sketcher" } } ], "importKind": "value", "source": { "type": "Literal", "start": 62, "end": 84, "loc": { "start": { "line": 2, "column": 21 }, "end": { "line": 2, "column": 43 } }, "value": "../sketcher/sketcher", "rawValue": "../sketcher/sketcher", "raw": "'../sketcher/sketcher'" } }, { "type": "ImportDeclaration", "start": 86, "end": 139, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 53 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 94, "end": 108, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 22 } }, "imported": { "type": "Identifier", "start": 94, "end": 108, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 22 } }, "name": "ClassCadObject" }, "local": { "type": "Identifier", "start": 94, "end": 108, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 22 } }, "name": "ClassCadObject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 115, "end": 138, "loc": { "start": { "line": 3, "column": 29 }, "end": { "line": 3, "column": 52 } }, "value": "../sketcher/ccobjects", "rawValue": "../sketcher/ccobjects", "raw": "'../sketcher/ccobjects'" } }, { "type": "ImportDeclaration", "start": 140, "end": 172, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 32 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 147, "end": 151, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "local": { "type": "Identifier", "start": 147, "end": 151, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 11 } }, "name": "View" } } ], "importKind": "value", "source": { "type": "Literal", "start": 157, "end": 171, "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 31 } }, "value": "../core/view", "rawValue": "../core/view", "raw": "'../core/view'" } }, { "type": "ImportDeclaration", "start": 173, "end": 242, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 69 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 181, "end": 188, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 15 } }, "imported": { "type": "Identifier", "start": 181, "end": 188, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 15 } }, "name": "parseTo" }, "local": { "type": "Identifier", "start": 181, "end": 188, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 15 } }, "name": "parseTo" } }, { "type": "ImportSpecifier", "start": 190, "end": 200, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 27 } }, "imported": { "type": "Identifier", "start": 190, "end": 200, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 27 } }, "name": "Expression" }, "local": { "type": "Identifier", "start": 190, "end": 200, "loc": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 27 } }, "name": "Expression" } }, { "type": "ImportSpecifier", "start": 202, "end": 211, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 38 } }, "imported": { "type": "Identifier", "start": 202, "end": 211, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 38 } }, "name": "Statement" }, "local": { "type": "Identifier", "start": 202, "end": 211, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 38 } }, "name": "Statement" } } ], "importKind": "value", "source": { "type": "Literal", "start": 218, "end": 241, "loc": { "start": { "line": 5, "column": 45 }, "end": { "line": 5, "column": 68 } }, "value": "../sketcher/cchelpers", "rawValue": "../sketcher/cchelpers", "raw": "'../sketcher/cchelpers'" } }, { "type": "ImportDeclaration", "start": 243, "end": 269, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 250, "end": 255, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 12 } }, "local": { "type": "Identifier", "start": 250, "end": 255, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 261, "end": 268, "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": 271, "end": 320, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 49 } }, "range": [ 271, 320 ] }, { "type": "CommentLine", "value": "var interactMaterial = new THREE.MeshBasicMaterial({color: 0xff0000, visible: false, side: THREE.DoubleSide});", "start": 321, "end": 433, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 112 } }, "range": [ 321, 433 ] }, { "type": "CommentLine", "value": " mixin for geometric objects that can be highlighted", "start": 435, "end": 489, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 54 } }, "range": [ 435, 489 ] } ] }, { "type": "FunctionDeclaration", "start": 490, "end": 1925, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 43, "column": 1 } }, "id": { "type": "Identifier", "start": 499, "end": 516, "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": 519, "end": 1925, "loc": { "start": { "line": 12, "column": 29 }, "end": { "line": 43, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 525, "end": 1438, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 32, "column": 6 } }, "expression": { "type": "AssignmentExpression", "start": 525, "end": 1437, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 32, "column": 5 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 525, "end": 535, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 14 } }, "object": { "type": "ThisExpression", "start": 525, "end": 529, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 8 } } }, "property": { "type": "Identifier", "start": 530, "end": 535, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 14 } }, "name": "hover" }, "computed": false }, "right": { "type": "FunctionExpression", "start": 538, "end": 1437, "loc": { "start": { "line": 13, "column": 17 }, "end": { "line": 32, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 549, "end": 1437, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 32, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 559, "end": 581, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 30 } }, "declarations": [ { "type": "VariableDeclarator", "start": 563, "end": 580, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 29 } }, "id": { "type": "Identifier", "start": 563, "end": 566, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 15 } }, "name": "obj" }, "init": { "type": "MemberExpression", "start": 569, "end": 580, "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 29 } }, "object": { "type": "ThisExpression", "start": 569, "end": 573, "loc": { "start": { "line": 14, "column": 18 }, "end": { "line": 14, "column": 22 } } }, "property": { "type": "Identifier", "start": 574, "end": 580, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 29 } }, "name": "parent" }, "computed": false } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 590, "end": 629, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 47 } }, "declarations": [ { "type": "VariableDeclarator", "start": 594, "end": 628, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 46 } }, "id": { "type": "Identifier", "start": 594, "end": 600, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 18 } }, "name": "sketch" }, "init": { "type": "CallExpression", "start": 603, "end": 628, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 46 } }, "callee": { "type": "MemberExpression", "start": 603, "end": 622, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 40 } }, "object": { "type": "Identifier", "start": 603, "end": 609, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 27 } }, "name": "Sketch" }, "property": { "type": "Identifier", "start": 610, "end": 622, "loc": { "start": { "line": 15, "column": 28 }, "end": { "line": 15, "column": 40 } }, "name": "FindSketchOf" }, "computed": false }, "arguments": [ { "type": "ThisExpression", "start": 623, "end": 627, "loc": { "start": { "line": 15, "column": 41 }, "end": { "line": 15, "column": 45 } } } ] } } ], "kind": "var" }, { "type": "IfStatement", "start": 638, "end": 658, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 28 } }, "test": { "type": "UnaryExpression", "start": 642, "end": 649, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 19 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 643, "end": 649, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 19 } }, "name": "sketch" } }, "consequent": { "type": "ReturnStatement", "start": 651, "end": 658, "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": 662, "end": 692, "loc": { "start": { "line": 16, "column": 32 }, "end": { "line": 16, "column": 62 } }, "range": [ 662, 692 ] } ] }, { "type": "ExpressionStatement", "start": 701, "end": 768, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 75 } }, "expression": { "type": "AssignmentExpression", "start": 701, "end": 767, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 74 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 701, "end": 720, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 27 } }, "object": { "type": "MemberExpression", "start": 701, "end": 714, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 21 } }, "object": { "type": "ThisExpression", "start": 701, "end": 705, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 706, "end": 714, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 21 } }, "name": "material" }, "computed": false, "leadingComments": null }, "property": { "type": "Identifier", "start": 715, "end": 720, "loc": { "start": { "line": 17, "column": 22 }, "end": { "line": 17, "column": 27 } }, "name": "color" }, "computed": false, "leadingComments": null }, "right": { "type": "NewExpression", "start": 723, "end": 767, "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 74 } }, "callee": { "type": "MemberExpression", "start": 727, "end": 738, "loc": { "start": { "line": 17, "column": 34 }, "end": { "line": 17, "column": 45 } }, "object": { "type": "Identifier", "start": 727, "end": 732, "loc": { "start": { "line": 17, "column": 34 }, "end": { "line": 17, "column": 39 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 733, "end": 738, "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 45 } }, "name": "Color" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 739, "end": 766, "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 17, "column": 73 } }, "callee": { "type": "Identifier", "start": 739, "end": 747, "loc": { "start": { "line": 17, "column": 46 }, "end": { "line": 17, "column": 54 } }, "name": "getColor" }, "arguments": [ { "type": "MemberExpression", "start": 748, "end": 759, "loc": { "start": { "line": 17, "column": 55 }, "end": { "line": 17, "column": 66 } }, "object": { "type": "ThisExpression", "start": 748, "end": 752, "loc": { "start": { "line": 17, "column": 55 }, "end": { "line": 17, "column": 59 } } }, "property": { "type": "Identifier", "start": 753, "end": 759, "loc": { "start": { "line": 17, "column": 60 }, "end": { "line": 17, "column": 66 } }, "name": "parent" }, "computed": false }, { "type": "Literal", "start": 761, "end": 765, "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": 662, "end": 692, "loc": { "start": { "line": 16, "column": 32 }, "end": { "line": 16, "column": 62 } }, "range": [ 662, 692 ] } ] }, { "type": "IfStatement", "start": 777, "end": 815, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 46 } }, "test": { "type": "MemberExpression", "start": 781, "end": 806, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 37 } }, "object": { "type": "Identifier", "start": 781, "end": 784, "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 15 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 785, "end": 806, "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 37 } }, "name": "auxiliaryConstruction" }, "computed": false }, "consequent": { "type": "ReturnStatement", "start": 808, "end": 815, "loc": { "start": { "line": 18, "column": 39 }, "end": { "line": 18, "column": 46 } }, "argument": null }, "alternate": null }, { "type": "VariableDeclaration", "start": 824, "end": 1023, "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 25, "column": 10 } }, "declarations": [ { "type": "VariableDeclarator", "start": 828, "end": 1022, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 25, "column": 9 } }, "id": { "type": "Identifier", "start": 828, "end": 836, "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 20 } }, "name": "material" }, "init": { "type": "NewExpression", "start": 839, "end": 1022, "loc": { "start": { "line": 19, "column": 23 }, "end": { "line": 25, "column": 9 } }, "callee": { "type": "MemberExpression", "start": 843, "end": 866, "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 19, "column": 50 } }, "object": { "type": "Identifier", "start": 843, "end": 848, "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 19, "column": 32 } }, "name": "THREE" }, "property": { "type": "Identifier", "start": 849, "end": 866, "loc": { "start": { "line": 19, "column": 33 }, "end": { "line": 19, "column": 50 } }, "name": "LineBasicMaterial" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 880, "end": 1012, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 24, "column": 13 } }, "properties": [ { "type": "Property", "start": 898, "end": 933, "loc": { "start": { "line": 21, "column": 16 }, "end": { "line": 21,