awv3
Version:
⚡ AWV3 embedded CAD
1,437 lines (1,436 loc) • 391 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportNamespaceSpecifier",
"local": {
"type": "Identifier",
"name": "THREE",
"range": [
12,
17
],
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 17
}
}
},
"range": [
7,
17
],
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 17
}
}
}
],
"source": {
"type": "Literal",
"value": "three",
"raw": "'three'",
"range": [
23,
30
],
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 30
}
}
},
"range": [
0,
31
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 31
}
}
},
{
"type": "ExportNamedDeclaration",
"declaration": {
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Dimension",
"range": [
46,
55
],
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 3,
"column": 22
}
}
},
"superClass": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "THREE",
"range": [
64,
69
],
"loc": {
"start": {
"line": 3,
"column": 31
},
"end": {
"line": 3,
"column": 36
}
}
},
"property": {
"type": "Identifier",
"name": "Object3D",
"range": [
70,
78
],
"loc": {
"start": {
"line": 3,
"column": 37
},
"end": {
"line": 3,
"column": 45
}
}
},
"range": [
64,
78
],
"loc": {
"start": {
"line": 3,
"column": 31
},
"end": {
"line": 3,
"column": 45
}
}
},
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "constructor",
"range": [
85,
96
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 15
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Super",
"range": [
109,
114
],
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 13
}
}
},
"arguments": [],
"range": [
109,
116
],
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 15
}
}
},
"range": [
109,
117
],
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 16
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
126,
130
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "clear",
"range": [
131,
136
],
"loc": {
"start": {
"line": 6,
"column": 13
},
"end": {
"line": 6,
"column": 18
}
}
},
"range": [
126,
136
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 18
}
}
},
"arguments": [],
"range": [
126,
138
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 20
}
}
},
"range": [
126,
139
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 21
}
}
}
],
"range": [
99,
145
],
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 7,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
96,
145
],
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 7,
"column": 5
}
}
},
"kind": "constructor",
"computed": false,
"range": [
85,
145
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 7,
"column": 5
}
},
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "clear",
"range": [
151,
156
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 9
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "WhileStatement",
"test": {
"type": "BinaryExpression",
"operator": ">",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
176,
180
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "children",
"range": [
181,
189
],
"loc": {
"start": {
"line": 10,
"column": 20
},
"end": {
"line": 10,
"column": 28
}
}
},
"range": [
176,
189
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 28
}
}
},
"property": {
"type": "Identifier",
"name": "length",
"range": [
190,
196
],
"loc": {
"start": {
"line": 10,
"column": 29
},
"end": {
"line": 10,
"column": 35
}
}
},
"range": [
176,
196
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 35
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
199,
200
],
"loc": {
"start": {
"line": 10,
"column": 38
},
"end": {
"line": 10,
"column": 39
}
}
},
"range": [
176,
200
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 39
}
}
},
"body": {
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
214,
218
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"name": "children",
"range": [
219,
227
],
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 11,
"column": 25
}
}
},
"range": [
214,
227
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 25
}
}
},
"property": {
"type": "Identifier",
"name": "remove",
"range": [
228,
234
],
"loc": {
"start": {
"line": 11,
"column": 26
},
"end": {
"line": 11,
"column": 32
}
}
},
"range": [
214,
234
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 32
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": true,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
235,
239
],
"loc": {
"start": {
"line": 11,
"column": 33
},
"end": {
"line": 11,
"column": 37
}
}
},
"property": {
"type": "Identifier",
"name": "children",
"range": [
240,
248
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 46
}
}
},
"range": [
235,
248
],
"loc": {
"start": {
"line": 11,
"column": 33
},
"end": {
"line": 11,
"column": 46
}
}
},
"property": {
"type": "BinaryExpression",
"operator": "-",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
249,
253
],
"loc": {
"start": {
"line": 11,
"column": 47
},
"end": {
"line": 11,
"column": 51
}
}
},
"property": {
"type": "Identifier",
"name": "children",
"range": [
254,
262
],
"loc": {
"start": {
"line": 11,
"column": 52
},
"end": {
"line": 11,
"column": 60
}
}
},
"range": [
249,
262
],
"loc": {
"start": {
"line": 11,
"column": 47
},
"end": {
"line": 11,
"column": 60
}
}
},
"property": {
"type": "Identifier",
"name": "length",
"range": [
263,
269
],
"loc": {
"start": {
"line": 11,
"column": 61
},
"end": {
"line": 11,
"column": 67
}
}
},
"range": [
249,
269
],
"loc": {
"start": {
"line": 11,
"column": 47
},
"end": {
"line": 11,
"column": 67
}
}
},
"right": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
272,
273
],
"loc": {
"start": {
"line": 11,
"column": 70
},
"end": {
"line": 11,
"column": 71
}
}
},
"range": [
249,
273
],
"loc": {
"start": {
"line": 11,
"column": 47
},
"end": {
"line": 11,
"column": 71
}
}
},
"range": [
235,
274
],
"loc": {
"start": {
"line": 11,
"column": 33
},
"end": {
"line": 11,
"column": 72
}
}
}
],
"range": [
214,
275
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 73
}
}
},
"range": [
214,
276
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 74
}
}
},
"range": [
169,
276
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 11,
"column": 74
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
285,
289
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "lines",
"range": [
290,
295
],
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 18
}
}
},
"range": [
285,
295
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 18
}
}
},
"right": {
"type": "ArrayExpression",
"elements": [],
"range": [
298,
300
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 23
}
}
},
"range": [
285,
300
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 23
}
}
},
"range": [
285,
301
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 24
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
310,
314
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "texts",
"range": [
315,
320
],
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 18
}
}
},
"range": [
310,
320
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 18
}
}
},
"right": {
"type": "ArrayExpression",
"elements": [],
"range": [
323,
325
],
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 23
}
}
},
"range": [
310,
325
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 23
}
}
},
"range": [
310,
326
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 24
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
335,
339
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "arrows",
"range": [
340,
346
],
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 19
}
}
},
"range": [
335,
346
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 19
}
}
},
"right": {
"type": "ArrayExpression",
"elements": [],
"range": [
349,
351
],
"loc": {
"start": {
"line": 14,
"column": 22
},
"end": {
"line": 14,
"column": 24
}
}
},
"range": [
335,
351
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 24
}
}
},
"range": [
335,
352
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 25
}
}
}
],
"range": [
159,
358
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 15,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
156,
358
],
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 15,
"column": 5
}
}
},
"kind": "method",
"computed": false,
"range": [
151,
358
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 15,
"column": 5
}
},
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "addLine",
"range": [
364,
371
],
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 11
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "startPos",
"range": [
372,
380
],
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 20
}
}
},
{
"type": "Identifier",
"name": "endPos",
"range": [
382,
388
],
"loc": {
"start": {
"line": 17,
"column": 22
},
"end": {
"line": 17,
"column": 28
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "geom",
"range": [
404,
408
],
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 16
}
}
},
"init": {
"type": "NewExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "THREE",
"range": [
415,
420
],
"loc": {
"start": {
"line": 18,
"column": 23
},
"end": {
"line": 18,
"column": 28
}
}
},
"property": {
"type": "Identifier",
"name": "Geometry",
"range": [
421,
429
],
"loc": {
"start": {
"line": 18,
"column": 29
},
"end": {
"line": 18,
"column": 37
}
}
},
"range": [
415,
429
],
"loc": {
"start": {
"line": 18,
"column": 23
},
"end": {
"line": 18,
"column": 37
}
}
},
"arguments": [],
"range": [
411,
431
],
"loc": {
"start": {
"line": 18,
"column": 19
},
"end": {
"line": 18,
"column": 39
}
}
},
"range": [
404,
431
],
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 39
}
}
}
],
"kind": "var",
"range": [
400,
432
],
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 40
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "geom",