awv3
Version:
⚡ AWV3 embedded CAD
1,402 lines (1,401 loc) • 126 kB
JSON
{
"type": "File",
"start": 0,
"end": 655,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 23,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 655,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 23,
"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"
}
},
{
"type": "ExportDefaultDeclaration",
"start": 33,
"end": 654,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 22,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 48,
"end": 654,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 22,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 54,
"end": 66,
"loc": {
"start": {
"line": 3,
"column": 21
},
"end": {
"line": 3,
"column": 33
},
"identifierName": "BaseGraphics"
},
"name": "BaseGraphics"
},
"superClass": {
"type": "MemberExpression",
"start": 75,
"end": 89,
"loc": {
"start": {
"line": 3,
"column": 42
},
"end": {
"line": 3,
"column": 56
}
},
"object": {
"type": "Identifier",
"start": 75,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 42
},
"end": {
"line": 3,
"column": 47
},
"identifierName": "THREE"
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 81,
"end": 89,
"loc": {
"start": {
"line": 3,
"column": 48
},
"end": {
"line": 3,
"column": 56
},
"identifierName": "Object3D"
},
"name": "Object3D"
},
"computed": false
},
"body": {
"type": "ClassBody",
"start": 90,
"end": 654,
"loc": {
"start": {
"line": 3,
"column": 57
},
"end": {
"line": 22,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 96,
"end": 307,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 8,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 96,
"end": 118,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 26
},
"identifierName": "updateCoordinateSystem"
},
"name": "updateCoordinateSystem"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 119,
"end": 135,
"loc": {
"start": {
"line": 4,
"column": 27
},
"end": {
"line": 4,
"column": 43
},
"identifierName": "coordinateSystem"
},
"name": "coordinateSystem"
}
],
"body": {
"type": "BlockStatement",
"start": 137,
"end": 307,
"loc": {
"start": {
"line": 4,
"column": 45
},
"end": {
"line": 8,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 147,
"end": 182,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 43
}
},
"expression": {
"type": "CallExpression",
"start": 147,
"end": 181,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 42
}
},
"callee": {
"type": "MemberExpression",
"start": 147,
"end": 163,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 24
}
},
"object": {
"type": "MemberExpression",
"start": 147,
"end": 158,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 147,
"end": 151,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 152,
"end": 158,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 19
},
"identifierName": "matrix"
},
"name": "matrix"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 159,
"end": 163,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 24
},
"identifierName": "copy"
},
"name": "copy"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 164,
"end": 180,
"loc": {
"start": {
"line": 5,
"column": 25
},
"end": {
"line": 5,
"column": 41
},
"identifierName": "coordinateSystem"
},
"name": "coordinateSystem"
}
]
}
},
{
"type": "ExpressionStatement",
"start": 191,
"end": 257,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 74
}
},
"expression": {
"type": "CallExpression",
"start": 191,
"end": 256,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 73
}
},
"callee": {
"type": "MemberExpression",
"start": 191,
"end": 212,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 29
}
},
"object": {
"type": "MemberExpression",
"start": 191,
"end": 202,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 191,
"end": 195,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 196,
"end": 202,
"loc": {
"start": {
"line": 6,
"column": 13
},
"end": {
"line": 6,
"column": 19
},
"identifierName": "matrix"
},
"name": "matrix"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 203,
"end": 212,
"loc": {
"start": {
"line": 6,
"column": 20
},
"end": {
"line": 6,
"column": 29
},
"identifierName": "decompose"
},
"name": "decompose"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 213,
"end": 226,
"loc": {
"start": {
"line": 6,
"column": 30
},
"end": {
"line": 6,
"column": 43
}
},
"object": {
"type": "ThisExpression",
"start": 213,
"end": 217,
"loc": {
"start": {
"line": 6,
"column": 30
},
"end": {
"line": 6,
"column": 34
}
}
},
"property": {
"type": "Identifier",
"start": 218,
"end": 226,
"loc": {
"start": {
"line": 6,
"column": 35
},
"end": {
"line": 6,
"column": 43
},
"identifierName": "position"
},
"name": "position"
},
"computed": false
},
{
"type": "MemberExpression",
"start": 228,
"end": 243,
"loc": {
"start": {
"line": 6,
"column": 45
},
"end": {
"line": 6,
"column": 60
}
},
"object": {
"type": "ThisExpression",
"start": 228,
"end": 232,
"loc": {
"start": {
"line": 6,
"column": 45
},
"end": {
"line": 6,
"column": 49
}
}
},
"property": {
"type": "Identifier",
"start": 233,
"end": 243,
"loc": {
"start": {
"line": 6,
"column": 50
},
"end": {
"line": 6,
"column": 60
},
"identifierName": "quaternion"
},
"name": "quaternion"
},
"computed": false
},
{
"type": "MemberExpression",
"start": 245,
"end": 255,
"loc": {
"start": {
"line": 6,
"column": 62
},
"end": {
"line": 6,
"column": 72
}
},
"object": {
"type": "ThisExpression",
"start": 245,
"end": 249,
"loc": {
"start": {
"line": 6,
"column": 62
},
"end": {
"line": 6,
"column": 66
}
}
},
"property": {
"type": "Identifier",
"start": 250,
"end": 255,
"loc": {
"start": {
"line": 6,
"column": 67
},
"end": {
"line": 6,
"column": 72
},
"identifierName": "scale"
},
"name": "scale"
},
"computed": false
}
]
}
},
{
"type": "ExpressionStatement",
"start": 266,
"end": 301,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 43
}
},
"expression": {
"type": "AssignmentExpression",
"start": 266,
"end": 300,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 42
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 266,
"end": 293,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 35
}
},
"object": {
"type": "ThisExpression",
"start": 266,
"end": 270,
"loc": {
"start": {
"line": 7,
"column": 8
},
"end": {
"line": 7,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 271,
"end": 293,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 35
},
"identifierName": "matrixWorldNeedsUpdate"
},
"name": "matrixWorldNeedsUpdate"
},
"computed": false
},
"right": {
"type": "BooleanLiteral",
"start": 296,
"end": 300,
"loc": {
"start": {
"line": 7,
"column": 38
},
"end": {
"line": 7,
"column": 42
}
},
"value": true
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 313,
"end": 419,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 12,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 313,
"end": 333,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 24
},
"identifierName": "updateFromGeomParams"
},
"name": "updateFromGeomParams"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 334,
"end": 344,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 35
},
"identifierName": "geomParams"
},
"name": "geomParams"
}
],
"body": {
"type": "BlockStatement",
"start": 346,
"end": 419,
"loc": {
"start": {
"line": 10,
"column": 37
},
"end": {
"line": 12,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 356,
"end": 413,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 65
}
},
"expression": {
"type": "CallExpression",
"start": 356,
"end": 412,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 64
}
},
"callee": {
"type": "MemberExpression",
"start": 356,
"end": 383,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 35
}
},
"object": {
"type": "ThisExpression",
"start": 356,
"end": 360,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 361,
"end": 383,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 35
},
"identifierName": "updateCoordinateSystem"
},
"name": "updateCoordinateSystem"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 384,
"end": 411,
"loc": {
"start": {
"line": 11,
"column": 36
},
"end": {
"line": 11,
"column": 63
}
},
"object": {
"type": "Identifier",
"start": 384,
"end": 394,
"loc": {
"start": {
"line": 11,
"column": 36
},
"end": {
"line": 11,
"column": 46
},
"identifierName": "geomParams"
},
"name": "geomParams"
},
"property": {
"type": "Identifier",
"start": 395,
"end": 411,
"loc": {
"start": {
"line": 11,
"column": 47
},
"end": {
"line": 11,
"column": 63
},
"identifierName": "coordinateSystem"
},
"name": "coordinateSystem"
},
"computed": false
}
]
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 425,
"end": 523,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 16,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 425,
"end": 438,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 17
},
"identifierName": "updateMetaBox"
},
"name": "updateMetaBox"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 441,
"end": 523,
"loc": {
"start": {
"line": 14,
"column": 20
},
"end": {
"line": 16,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 451,
"end": 517,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 74
}
},
"expression": {
"type": "AssignmentExpression",
"start": 451,
"end": 516,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 73
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 451,
"end": 483,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 40
}
},
"object": {
"type": "MemberExpression",
"start": 451,
"end": 479,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 36
}
},
"object": {
"type": "MemberExpression",
"start": 451,
"end": 474,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 31
}
},
"object": {
"type": "MemberExpression",
"start": 451,
"end": 465,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 22
}
},
"object": {
"type": "ThisExpression",
"start": 451,
"end": 455,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 456,
"end": 465,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 22
},
"identifierName": "localMesh"
},
"name": "localMesh"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 466,
"end": 474,
"loc": {
"start": {
"line": 15,
"column": 23
},
"end": {
"line": 15,
"column": 31
},
"identifierName": "material"
},
"name": "material"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 475,
"end": 479,
"loc": {
"start": {
"line": 15,
"column": 32
},
"end": {
"line": 15,
"column": 36
},
"identifierName": "meta"
},
"name": "meta"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 480,
"end": 483,
"loc": {
"start": {
"line": 15,
"column": 37
},
"end": {
"line": 15,
"column": 40
},
"identifierName": "box"
},
"name": "box"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 486,
"end": 516,
"loc": {
"start": {
"line": 15,
"column": 43
},
"end": {
"line": 15,
"column": 73
}
},
"object": {
"type": "MemberExpression",
"start": 486,
"end": 512,
"loc": {
"start": {
"line": 15,
"column": 43
},
"end": {
"line": 15,
"column": 69
}
},
"object": {
"type": "CallExpression",
"start": 486,
"end": 505,
"loc": {
"start": {
"line": 15,
"column": 43
},
"end": {
"line": 15,
"column": 62
}
},
"callee": {
"type": "MemberExpression",
"start": 486,
"end": 503,
"loc": {
"start": {
"line": 15,
"column": 43
},
"end": {
"line": 15,
"column": 60
}
},
"object": {
"type": "ThisExpression",
"start": 486,
"end": 490,
"loc": {
"start": {
"line": 15,
"column": 43
},
"end": {
"line": 15,
"column": 47
}
}
},
"property": {
"type": "Identifier",
"start": 491,
"end": 503,
"loc": {
"start": {
"line": 15,
"column": 48
},
"end": {
"line": 15,
"column": 60
},
"identifierName": "updateBounds"
},
"name": "updateBounds"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 506,
"end": 512,
"loc": {
"start": {
"line": 15,
"column": 63
},
"end": {
"line": 15,
"column": 69
},
"identifierName": "bounds"
},
"name": "bounds"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 513,
"end": 516,
"loc": {
"start": {
"line": 15,
"column": 70
},
"end": {
"line": 15,
"column": 73
},
"identifierName": "box"
},
"name": "box"
},
"computed": false
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 529,
"end": 652,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 21,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 529,
"end": 552,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 27
},
"identifierName": "updateFromSketcherAndId"
},
"name": "updateFromSketcherAndId"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 553,
"end": 561,
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 36
},
"identifierName": "sketcher"
},
"name": "sketcher"
},
{
"type": "Identifier",
"start": 563,
"end": 565,
"loc": {
"start": {