awv3
Version:
⚡ AWV3 embedded CAD
1,326 lines (1,325 loc) • 571 kB
JSON
{
"type": "File",
"start": 0,
"end": 2312,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 56,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 2312,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 56,
"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": "CommentLine",
"value": "note: number of vertices is constant in order to use the same vertex buffer",
"start": 33,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 77
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 111,
"end": 2310,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 55,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 126,
"end": 2310,
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 55,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 132,
"end": 144,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 33
},
"identifierName": "RingGeometry"
},
"name": "RingGeometry",
"leadingComments": null
},
"superClass": {
"type": "MemberExpression",
"start": 153,
"end": 173,
"loc": {
"start": {
"line": 4,
"column": 42
},
"end": {
"line": 4,
"column": 62
}
},
"object": {
"type": "Identifier",
"start": 153,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 42
},
"end": {
"line": 4,
"column": 47
},
"identifierName": "THREE"
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 159,
"end": 173,
"loc": {
"start": {
"line": 4,
"column": 48
},
"end": {
"line": 4,
"column": 62
},
"identifierName": "BufferGeometry"
},
"name": "BufferGeometry"
},
"computed": false
},
"body": {
"type": "ClassBody",
"start": 174,
"end": 2310,
"loc": {
"start": {
"line": 4,
"column": 63
},
"end": {
"line": 55,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 180,
"end": 1237,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 33,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 180,
"end": 191,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 192,
"end": 200,
"loc": {
"start": {
"line": 5,
"column": 16
},
"end": {
"line": 5,
"column": 24
},
"identifierName": "segments"
},
"name": "segments"
}
],
"body": {
"type": "BlockStatement",
"start": 202,
"end": 1237,
"loc": {
"start": {
"line": 5,
"column": 26
},
"end": {
"line": 33,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 212,
"end": 220,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 212,
"end": 219,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 212,
"end": 217,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 13
}
}
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 230,
"end": 422,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 14,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 230,
"end": 421,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 14,
"column": 9
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 230,
"end": 245,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 23
}
},
"object": {
"type": "ThisExpression",
"start": 230,
"end": 234,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 235,
"end": 245,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 23
},
"identifierName": "parameters"
},
"name": "parameters"
},
"computed": false
},
"right": {
"type": "ObjectExpression",
"start": 248,
"end": 421,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 14,
"column": 9
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 262,
"end": 285,
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 35
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 262,
"end": 275,
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 25
},
"identifierName": "thetaSegments"
},
"name": "thetaSegments"
},
"value": {
"type": "Identifier",
"start": 277,
"end": 285,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 35
},
"identifierName": "segments"
},
"name": "segments"
}
},
{
"type": "ObjectProperty",
"start": 299,
"end": 315,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 28
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 299,
"end": 310,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 23
},
"identifierName": "innerRadius"
},
"name": "innerRadius"
},
"value": {
"type": "NumericLiteral",
"start": 312,
"end": 315,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 28
}
},
"extra": {
"rawValue": 1,
"raw": "1.0"
},
"value": 1
}
},
{
"type": "ObjectProperty",
"start": 329,
"end": 345,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 28
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 329,
"end": 340,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 23
},
"identifierName": "outerRadius"
},
"name": "outerRadius"
},
"value": {
"type": "NumericLiteral",
"start": 342,
"end": 345,
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 28
}
},
"extra": {
"rawValue": 2,
"raw": "2.0"
},
"value": 2
}
},
{
"type": "ObjectProperty",
"start": 359,
"end": 374,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 359,
"end": 369,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 22
},
"identifierName": "thetaStart"
},
"name": "thetaStart"
},
"value": {
"type": "NumericLiteral",
"start": 371,
"end": 374,
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 27
}
},
"extra": {
"rawValue": 0,
"raw": "0.0"
},
"value": 0
}
},
{
"type": "ObjectProperty",
"start": 388,
"end": 410,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 34
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 388,
"end": 399,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 23
},
"identifierName": "thetaLength"
},
"name": "thetaLength"
},
"value": {
"type": "BinaryExpression",
"start": 401,
"end": 410,
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 13,
"column": 34
}
},
"left": {
"type": "NumericLiteral",
"start": 401,
"end": 402,
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 13,
"column": 26
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
},
"operator": "*",
"right": {
"type": "MemberExpression",
"start": 403,
"end": 410,
"loc": {
"start": {
"line": 13,
"column": 27
},
"end": {
"line": 13,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 403,
"end": 407,
"loc": {
"start": {
"line": 13,
"column": 27
},
"end": {
"line": 13,
"column": 31
},
"identifierName": "Math"
},
"name": "Math"
},
"property": {
"type": "Identifier",
"start": 408,
"end": 410,
"loc": {
"start": {
"line": 13,
"column": 32
},
"end": {
"line": 13,
"column": 34
},
"identifierName": "PI"
},
"name": "PI"
},
"computed": false
}
}
}
]
}
}
},
{
"type": "VariableDeclaration",
"start": 432,
"end": 468,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 44
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 436,
"end": 467,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 43
}
},
"id": {
"type": "Identifier",
"start": 436,
"end": 446,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 22
},
"identifierName": "vertsCount"
},
"name": "vertsCount"
},
"init": {
"type": "BinaryExpression",
"start": 449,
"end": 467,
"loc": {
"start": {
"line": 16,
"column": 25
},
"end": {
"line": 16,
"column": 43
}
},
"left": {
"type": "BinaryExpression",
"start": 450,
"end": 462,
"loc": {
"start": {
"line": 16,
"column": 26
},
"end": {
"line": 16,
"column": 38
}
},
"left": {
"type": "Identifier",
"start": 450,
"end": 458,
"loc": {
"start": {
"line": 16,
"column": 26
},
"end": {
"line": 16,
"column": 34
},
"identifierName": "segments"
},
"name": "segments"
},
"operator": "+",
"right": {
"type": "NumericLiteral",
"start": 461,
"end": 462,
"loc": {
"start": {
"line": 16,
"column": 37
},
"end": {
"line": 16,
"column": 38
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesized": true,
"parenStart": 449
}
},
"operator": "*",
"right": {
"type": "NumericLiteral",
"start": 466,
"end": 467,
"loc": {
"start": {
"line": 16,
"column": 42
},
"end": {
"line": 16,
"column": 43
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
}
],
"kind": "let"
},
{
"type": "VariableDeclaration",
"start": 477,
"end": 507,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 38
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 481,
"end": 506,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 37
}
},
"id": {
"type": "Identifier",
"start": 481,
"end": 491,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 22
},
"identifierName": "facesCount"
},
"name": "facesCount"
},
"init": {
"type": "BinaryExpression",
"start": 494,
"end": 506,
"loc": {
"start": {
"line": 17,
"column": 25
},
"end": {
"line": 17,
"column": 37
}
},
"left": {
"type": "Identifier",
"start": 494,
"end": 502,
"loc": {
"start": {
"line": 17,
"column": 25
},
"end": {
"line": 17,
"column": 33
},
"identifierName": "segments"
},
"name": "segments"
},
"operator": "*",
"right": {
"type": "NumericLiteral",
"start": 505,
"end": 506,
"loc": {
"start": {
"line": 17,
"column": 36
},
"end": {
"line": 17,
"column": 37
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
}
],
"kind": "let"
},
{
"type": "ExpressionStatement",
"start": 516,
"end": 593,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 85
}
},
"expression": {
"type": "CallExpression",
"start": 516,
"end": 592,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 84
}
},
"callee": {
"type": "MemberExpression",
"start": 516,
"end": 529,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 516,
"end": 520,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 521,
"end": 529,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 21
},
"identifierName": "setIndex"
},
"name": "setIndex"
},
"computed": false
},
"arguments": [
{
"type": "NewExpression",
"start": 530,
"end": 591,
"loc": {
"start": {
"line": 18,
"column": 22
},
"end": {
"line": 18,
"column": 83
}
},
"callee": {
"type": "MemberExpression",
"start": 534,
"end": 555,
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 47
}
},
"object": {
"type": "Identifier",
"start": 534,
"end": 539,
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 31
},
"identifierName": "THREE"
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 540,
"end": 555,
"loc": {
"start": {
"line": 18,
"column": 32
},
"end": {
"line": 18,
"column": 47
},
"identifierName": "BufferAttribute"
},
"name": "BufferAttribute"
},
"computed": false
},
"arguments": [
{
"type": "NewExpression",
"start": 556,
"end": 587,
"loc": {
"start": {
"line": 18,
"column": 48
},
"end": {
"line": 18,
"column": 79
}
},
"callee": {
"type": "Identifier",
"start": 560,
"end": 571,
"loc": {
"start": {
"line": 18,
"column": 52
},
"end": {
"line": 18,
"column": 63
},
"identifierName": "Uint32Array"
},
"name": "Uint32Array"
},
"arguments": [
{
"type": "BinaryExpression",
"start": 572,
"end": 586,
"loc": {
"start": {
"line": 18,
"column": 64
},
"end": {
"line": 18,
"column": 78
}
},
"left": {
"type": "Identifier",
"start": 572,
"end": 582,
"loc": {
"start": {
"line": 18,
"column": 64
},
"end": {
"line": 18,
"column": 74
},
"identifierName": "facesCount"
},
"name": "facesCount"
},
"operator": "*",
"right": {
"type": "NumericLiteral",
"start": 585,
"end": 586,
"loc": {
"start": {
"line": 18,
"column": 77
},
"end": {
"line": 18,
"column": 78
}
},
"extra": {
"rawValue": 3,
"raw": "3"
},
"value": 3
}
}
]
},
{
"type": "NumericLiteral",
"start": 589,
"end": 590,
"loc": {
"start": {
"line": 18,
"column": 81
},
"end": {
"line": 18,
"column": 82
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
]
}
]
}
},
{
"type": "ExpressionStatement",
"start": 602,
"end": 696,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 102
}
},
"expression": {
"type": "CallExpression",
"start": 602,
"end": 695,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 101
}
},
"callee": {
"type": "MemberExpression",
"start": 602,
"end": 619,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 602,