UNPKG

awv3

Version:
1,415 lines (1,414 loc) 481 kB
{ "type": "File", "start": 0, "end": 3007, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 82, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 3007, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 82, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 31, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 31 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 12, "end": 17, "loc": { "start": { "line": 1, "column": 12 }, "end": { "line": 1, "column": 17 }, "identifierName": "THREE" }, "name": "THREE" } } ], "source": { "type": "StringLiteral", "start": 23, "end": 30, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 30 } }, "extra": { "rawValue": "three", "raw": "'three'" }, "value": "three" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @class Region contains vertices from ClassCAD, which are not visible, but\n * can be selected through raycasting and then be created with the given\n * information {id, point, meta}.\n ", "start": 33, "end": 224, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 225, "end": 3006, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 81, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 240, "end": 3006, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 81, "column": 1 } }, "id": { "type": "Identifier", "start": 246, "end": 252, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 27 }, "identifierName": "Region" }, "name": "Region", "leadingComments": null }, "superClass": { "type": "MemberExpression", "start": 261, "end": 275, "loc": { "start": { "line": 8, "column": 36 }, "end": { "line": 8, "column": 50 } }, "object": { "type": "Identifier", "start": 261, "end": 266, "loc": { "start": { "line": 8, "column": 36 }, "end": { "line": 8, "column": 41 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 267, "end": 275, "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 50 }, "identifierName": "Object3D" }, "name": "Object3D" }, "computed": false }, "body": { "type": "ClassBody", "start": 276, "end": 3006, "loc": { "start": { "line": 8, "column": 51 }, "end": { "line": 81, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 282, "end": 472, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 15, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 282, "end": 293, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 296, "end": 472, "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 15, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 306, "end": 314, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 16 } }, "expression": { "type": "CallExpression", "start": 306, "end": 313, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 15 } }, "callee": { "type": "Super", "start": 306, "end": 311, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 13 } } }, "arguments": [] } }, { "type": "ExpressionStatement", "start": 323, "end": 344, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 323, "end": 343, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 323, "end": 332, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 17 } }, "object": { "type": "ThisExpression", "start": 323, "end": 327, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } } }, "property": { "type": "Identifier", "start": 328, "end": 332, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 17 }, "identifierName": "type" }, "name": "type" }, "computed": false }, "right": { "type": "StringLiteral", "start": 335, "end": 343, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 28 } }, "extra": { "rawValue": "Region", "raw": "'Region'" }, "value": "Region" } } }, { "type": "ExpressionStatement", "start": 353, "end": 380, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 35 } }, "expression": { "type": "AssignmentExpression", "start": 353, "end": 379, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 34 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 353, "end": 372, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 27 } }, "object": { "type": "ThisExpression", "start": 353, "end": 357, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, "property": { "type": "Identifier", "start": 358, "end": 372, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 27 }, "identifierName": "boundingSphere" }, "name": "boundingSphere" }, "computed": false }, "right": { "type": "NullLiteral", "start": 375, "end": 379, "loc": { "start": { "line": 12, "column": 30 }, "end": { "line": 12, "column": 34 } } } } }, { "type": "ExpressionStatement", "start": 389, "end": 405, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 389, "end": 405, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 389, "end": 400, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 19 } }, "object": { "type": "ThisExpression", "start": 389, "end": 393, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 12 } } }, "property": { "type": "Identifier", "start": 394, "end": 400, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 19 }, "identifierName": "points" }, "name": "points" }, "computed": false }, "right": { "type": "ArrayExpression", "start": 403, "end": 405, "loc": { "start": { "line": 13, "column": 22 }, "end": { "line": 13, "column": 24 } }, "elements": [], "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "trailingComments": [ { "type": "CommentLine", "value": " structure: { id, point, meta }", "start": 406, "end": 439, "loc": { "start": { "line": 13, "column": 25 }, "end": { "line": 13, "column": 58 } } } ] }, { "type": "ExpressionStatement", "start": 448, "end": 466, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 26 } }, "expression": { "type": "AssignmentExpression", "start": 448, "end": 465, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 25 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 448, "end": 461, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 21 } }, "object": { "type": "ThisExpression", "start": 448, "end": 452, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 453, "end": 461, "loc": { "start": { "line": 14, "column": 13 }, "end": { "line": 14, "column": 21 }, "identifierName": "radiussq" }, "name": "radiussq" }, "computed": false, "leadingComments": null }, "right": { "type": "NumericLiteral", "start": 464, "end": 465, "loc": { "start": { "line": 14, "column": 24 }, "end": { "line": 14, "column": 25 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": " structure: { id, point, meta }", "start": 406, "end": 439, "loc": { "start": { "line": 13, "column": 25 }, "end": { "line": 13, "column": 58 } } } ] } ], "directives": [], "trailingComments": null }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * This code is mostly copied form THREE.Points.js and adjusted to the fact\n * that Region does not have geometry or graphical representation\n ", "start": 478, "end": 639, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 20, "column": 7 } } } ] }, { "type": "ClassMethod", "start": 644, "end": 2590, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 66, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 644, "end": 651, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 11 }, "identifierName": "raycast" }, "name": "raycast", "leadingComments": null }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 652, "end": 661, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 21 }, "identifierName": "raycaster" }, "name": "raycaster" }, { "type": "Identifier", "start": 663, "end": 673, "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 33 }, "identifierName": "intersects" }, "name": "intersects" } ], "body": { "type": "BlockStatement", "start": 675, "end": 2590, "loc": { "start": { "line": 21, "column": 35 }, "end": { "line": 66, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 685, "end": 725, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 22, "column": 48 } }, "declarations": [ { "type": "VariableDeclarator", "start": 689, "end": 724, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 47 } }, "id": { "type": "Identifier", "start": 689, "end": 702, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 25 }, "identifierName": "inverseMatrix" }, "name": "inverseMatrix" }, "init": { "type": "NewExpression", "start": 705, "end": 724, "loc": { "start": { "line": 22, "column": 28 }, "end": { "line": 22, "column": 47 } }, "callee": { "type": "MemberExpression", "start": 709, "end": 722, "loc": { "start": { "line": 22, "column": 32 }, "end": { "line": 22, "column": 45 } }, "object": { "type": "Identifier", "start": 709, "end": 714, "loc": { "start": { "line": 22, "column": 32 }, "end": { "line": 22, "column": 37 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 715, "end": 722, "loc": { "start": { "line": 22, "column": 38 }, "end": { "line": 22, "column": 45 }, "identifierName": "Matrix4" }, "name": "Matrix4" }, "computed": false }, "arguments": [] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 734, "end": 760, "loc": { "start": { "line": 23, "column": 8 }, "end": { "line": 23, "column": 34 } }, "declarations": [ { "type": "VariableDeclarator", "start": 738, "end": 759, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 33 } }, "id": { "type": "Identifier", "start": 738, "end": 741, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 15 }, "identifierName": "ray" }, "name": "ray" }, "init": { "type": "NewExpression", "start": 744, "end": 759, "loc": { "start": { "line": 23, "column": 18 }, "end": { "line": 23, "column": 33 } }, "callee": { "type": "MemberExpression", "start": 748, "end": 757, "loc": { "start": { "line": 23, "column": 22 }, "end": { "line": 23, "column": 31 } }, "object": { "type": "Identifier", "start": 748, "end": 753, "loc": { "start": { "line": 23, "column": 22 }, "end": { "line": 23, "column": 27 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 754, "end": 757, "loc": { "start": { "line": 23, "column": 28 }, "end": { "line": 23, "column": 31 }, "identifierName": "Ray" }, "name": "Ray" }, "computed": false }, "arguments": [] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 769, "end": 801, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 40 } }, "declarations": [ { "type": "VariableDeclarator", "start": 773, "end": 800, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 24, "column": 39 } }, "id": { "type": "Identifier", "start": 773, "end": 779, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 24, "column": 18 }, "identifierName": "sphere" }, "name": "sphere" }, "init": { "type": "NewExpression", "start": 782, "end": 800, "loc": { "start": { "line": 24, "column": 21 }, "end": { "line": 24, "column": 39 } }, "callee": { "type": "MemberExpression", "start": 786, "end": 798, "loc": { "start": { "line": 24, "column": 25 }, "end": { "line": 24, "column": 37 } }, "object": { "type": "Identifier", "start": 786, "end": 791, "loc": { "start": { "line": 24, "column": 25 }, "end": { "line": 24, "column": 30 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 792, "end": 798, "loc": { "start": { "line": 24, "column": 31 }, "end": { "line": 24, "column": 37 }, "identifierName": "Sphere" }, "name": "Sphere" }, "computed": false }, "arguments": [] } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 811, "end": 829, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 26 } }, "declarations": [ { "type": "VariableDeclarator", "start": 815, "end": 828, "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 25 } }, "id": { "type": "Identifier", "start": 815, "end": 821, "loc": { "start": { "line": 26, "column": 12 }, "end": { "line": 26, "column": 18 }, "identifierName": "object" }, "name": "object" }, "init": { "type": "ThisExpression", "start": 824, "end": 828, "loc": { "start": { "line": 26, "column": 21 }, "end": { "line": 26, "column": 25 } } } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 838, "end": 873, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 43 } }, "declarations": [ { "type": "VariableDeclarator", "start": 842, "end": 872, "loc": { "start": { "line": 27, "column": 12 }, "end": { "line": 27, "column": 42 } }, "id": { "type": "Identifier", "start": 842, "end": 853, "loc": { "start": { "line": 27, "column": 12 }, "end": { "line": 27, "column": 23 }, "identifierName": "matrixWorld" }, "name": "matrixWorld" }, "init": { "type": "MemberExpression", "start": 856, "end": 872, "loc": { "start": { "line": 27, "column": 26 }, "end": { "line": 27, "column": 42 } }, "object": { "type": "ThisExpression", "start": 856, "end": 860, "loc": { "start": { "line": 27, "column": 26 }, "end": { "line": 27, "column": 30 } } }, "property": { "type": "Identifier", "start": 861, "end": 872, "loc": { "start": { "line": 27, "column": 31 }, "end": { "line": 27, "column": 42 }, "identifierName": "matrixWorld" }, "name": "matrixWorld" }, "computed": false } } ], "kind": "var" }, { "type": "VariableDeclaration", "start": 882, "end": 932, "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", "start": 886, "end": 931, "loc": { "start": { "line": 28, "column": 12 }, "end": { "line": 28, "column": 57 } }, "id": { "type": "Identifier", "start": 886, "end": 895,