awv3
Version:
AWV client CAD framework
1,647 lines (1,646 loc) • 908 kB
JSON
{
"type": "Program",
"start": 0,
"end": 9094,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 236,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 54,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 54
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 8,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 8,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 13
}
},
"name": "Point"
},
"local": {
"type": "Identifier",
"start": 8,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 13
}
},
"name": "Point"
}
},
{
"type": "ImportSpecifier",
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 19
}
},
"imported": {
"type": "Identifier",
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 19
}
},
"name": "Line"
},
"local": {
"type": "Identifier",
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 19
}
},
"name": "Line"
}
},
{
"type": "ImportSpecifier",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
},
"imported": {
"type": "Identifier",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
},
"name": "Arc"
},
"local": {
"type": "Identifier",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
},
"name": "Arc"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 31,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 53
}
},
"value": "sketcher/geomobjects",
"rawValue": "sketcher/geomobjects",
"raw": "'sketcher/geomobjects'"
}
},
{
"type": "ImportDeclaration",
"start": 55,
"end": 81,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 62,
"end": 67,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 62,
"end": 67,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 73,
"end": 80,
"loc": {
"start": {
"line": 2,
"column": 18
},
"end": {
"line": 2,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
}
},
{
"type": "ExpressionStatement",
"start": 87,
"end": 205,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 6,
"column": 6
}
},
"expression": {
"type": "AssignmentExpression",
"start": 87,
"end": 204,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 6,
"column": 5
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 87,
"end": 100,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 17
}
},
"object": {
"type": "Identifier",
"start": 87,
"end": 92,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 9
}
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 93,
"end": 100,
"loc": {
"start": {
"line": 4,
"column": 10
},
"end": {
"line": 4,
"column": 17
}
},
"name": "cross2d"
},
"computed": false
},
"right": {
"type": "FunctionExpression",
"start": 103,
"end": 204,
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 6,
"column": 5
}
},
"id": {
"type": "Identifier",
"start": 93,
"end": 100,
"loc": {
"start": {
"line": 4,
"column": 10
},
"end": {
"line": 4,
"column": 17
}
},
"name": "cross2d"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 112,
"end": 113,
"loc": {
"start": {
"line": 4,
"column": 29
},
"end": {
"line": 4,
"column": 30
}
},
"name": "a"
},
{
"type": "Identifier",
"start": 115,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 32
},
"end": {
"line": 4,
"column": 33
}
},
"name": "b"
}
],
"body": {
"type": "BlockStatement",
"start": 118,
"end": 204,
"loc": {
"start": {
"line": 4,
"column": 35
},
"end": {
"line": 6,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 169,
"end": 198,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 37
}
},
"argument": {
"type": "BinaryExpression",
"start": 176,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 5,
"column": 36
}
},
"left": {
"type": "BinaryExpression",
"start": 176,
"end": 185,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 5,
"column": 24
}
},
"left": {
"type": "MemberExpression",
"start": 176,
"end": 179,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 5,
"column": 18
}
},
"object": {
"type": "Identifier",
"start": 176,
"end": 177,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 5,
"column": 16
}
},
"name": "a",
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 178,
"end": 179,
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 18
}
},
"name": "x"
},
"computed": false,
"leadingComments": null
},
"operator": "*",
"right": {
"type": "MemberExpression",
"start": 182,
"end": 185,
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 5,
"column": 24
}
},
"object": {
"type": "Identifier",
"start": 182,
"end": 183,
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 5,
"column": 22
}
},
"name": "b"
},
"property": {
"type": "Identifier",
"start": 184,
"end": 185,
"loc": {
"start": {
"line": 5,
"column": 23
},
"end": {
"line": 5,
"column": 24
}
},
"name": "y"
},
"computed": false
},
"leadingComments": null
},
"operator": "-",
"right": {
"type": "BinaryExpression",
"start": 188,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 27
},
"end": {
"line": 5,
"column": 36
}
},
"left": {
"type": "MemberExpression",
"start": 188,
"end": 191,
"loc": {
"start": {
"line": 5,
"column": 27
},
"end": {
"line": 5,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 188,
"end": 189,
"loc": {
"start": {
"line": 5,
"column": 27
},
"end": {
"line": 5,
"column": 28
}
},
"name": "a"
},
"property": {
"type": "Identifier",
"start": 190,
"end": 191,
"loc": {
"start": {
"line": 5,
"column": 29
},
"end": {
"line": 5,
"column": 30
}
},
"name": "y"
},
"computed": false
},
"operator": "*",
"right": {
"type": "MemberExpression",
"start": 194,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 33
},
"end": {
"line": 5,
"column": 36
}
},
"object": {
"type": "Identifier",
"start": 194,
"end": 195,
"loc": {
"start": {
"line": 5,
"column": 33
},
"end": {
"line": 5,
"column": 34
}
},
"name": "b"
},
"property": {
"type": "Identifier",
"start": 196,
"end": 197,
"loc": {
"start": {
"line": 5,
"column": 35
},
"end": {
"line": 5,
"column": 36
}
},
"name": "x"
},
"computed": false
}
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": "TODO: properly install into THREE?...",
"start": 121,
"end": 160,
"loc": {
"start": {
"line": 4,
"column": 38
},
"end": {
"line": 4,
"column": 77
}
},
"range": [
121,
160
]
}
]
}
]
}
}
}
},
{
"type": "ExportNamedDeclaration",
"start": 211,
"end": 1057,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 25,
"column": 1
}
},
"declaration": {
"type": "FunctionDeclaration",
"start": 218,
"end": 1057,
"loc": {
"start": {
"line": 8,
"column": 11
},
"end": {
"line": 25,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 227,
"end": 242,
"loc": {
"start": {
"line": 8,
"column": 20
},
"end": {
"line": 8,
"column": 35
}
},
"name": "drawArcBy_S_T_E"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 243,
"end": 251,
"loc": {
"start": {
"line": 8,
"column": 36
},
"end": {
"line": 8,
"column": 44
}
},
"name": "startPos"
},
{
"type": "Identifier",
"start": 253,
"end": 265,
"loc": {
"start": {
"line": 8,
"column": 46
},
"end": {
"line": 8,
"column": 58
}
},
"name": "startTangent"
},
{
"type": "Identifier",
"start": 267,
"end": 273,
"loc": {
"start": {
"line": 8,
"column": 60
},
"end": {
"line": 8,
"column": 66
}
},
"name": "endPos"
}
],
"body": {
"type": "BlockStatement",
"start": 275,
"end": 1057,
"loc": {
"start": {
"line": 8,
"column": 68
},
"end": {
"line": 25,
"column": 1
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 329,
"end": 368,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 47
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 333,
"end": 367,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 46
}
},
"id": {
"type": "Identifier",
"start": 333,
"end": 336,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 15
}
},
"name": "dir",
"leadingComments": null
},
"init": {
"type": "CallExpression",
"start": 339,
"end": 367,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 46
}
},
"callee": {
"type": "MemberExpression",
"start": 339,
"end": 357,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 36
}
},
"object": {
"type": "CallExpression",
"start": 339,
"end": 353,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 32
}
},
"callee": {
"type": "MemberExpression",
"start": 339,
"end": 351,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 339,
"end": 345,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 24
}
},
"name": "endPos"
},
"property": {
"type": "Identifier",
"start": 346,
"end": 351,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 30
}
},
"name": "clone"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 354,
"end": 357,
"loc": {
"start": {
"line": 10,
"column": 33
},
"end": {
"line": 10,
"column": 36
}
},
"name": "sub"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 358,
"end": 366,
"loc": {
"start": {
"line": 10,
"column": 37
},
"end": {
"line": 10,
"column": 45
}
},
"name": "startPos"
}
]
},
"leadingComments": null
}
],
"kind": "var",
"leadingComments": [
{
"type": "CommentLine",
"value": "should we create a line or an arc",
"start": 285,
"end": 320,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 43
}
},
"range": [
285,
320
]
}
]
},
{
"type": "VariableDeclaration",
"start": 377,
"end": 454,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 85
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 381,
"end": 453,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 84
}
},
"id": {
"type": "Identifier",
"start": 381,
"end": 387,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 18
}
},
"name": "onLine"
},
"init": {
"type": "CallExpression",
"start": 390,
"end": 453,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 84
}
},
"callee": {
"type": "MemberExpression",
"start": 390,
"end": 410,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 41
}
},
"object": {
"type": "CallExpression",
"start": 390,
"end": 406,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 37
}
},
"callee": {
"type": "MemberExpression",
"start": 390,
"end": 404,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 390,
"end": 398,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 29
}
},
"name": "startPos"
},
"property": {
"type": "Identifier",
"start": 399,
"end": 404,
"loc": {
"start": {
"line": 11,
"column": 30
},
"end": {
"line": 11,
"column": 35
}
},
"name": "clone"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 407,
"end": 410,
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 41
}
},
"name": "add"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 411,
"end": 452,
"loc": {
"start": {
"line": 11,
"column": 42
},
"end": {
"line": 11,
"column": 83
}
},
"callee": {
"type": "MemberExpression",
"start": 411,
"end": 438,
"loc": {
"start": {
"line": 11,
"column": 42
},
"end": {
"line": 11,
"column": 69
}
},
"object": {
"type": "CallExpression",
"start": 411,
"end": 422,
"loc": {
"start": {
"line": 11,
"column": 42
},
"end": {
"line": 11,
"column": 53
}
},
"callee": {
"type": "MemberExpression",
"start": 411,
"end": 420,
"loc": {
"start": {
"line": 11,
"column": 42
},
"end": {
"line": 11,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 411,
"end": 414,
"loc": {
"start": {
"line": 11,
"column": 42
},
"end": {
"line": 11,
"column": 45
}
},
"name": "dir"
},
"property": {
"type": "Identifier",
"start": 415,
"end": 420,
"loc": {
"start": {
"line": 11,
"column": 46
},
"end": {
"line": 11,
"column": 51
}
},
"name": "clone"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 423,
"end": 438,
"loc": {
"start": {
"line": 11,
"column": 54
},
"end": {
"line": 11,
"column": 69
}
},
"name": "projectOnVector"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 439,
"end": 451,
"loc": {
"start": {
"line": 11,
"column": 70
},
"end": {
"line": 11,
"column": 82
}
},
"name": "startTangent"
}
]
}
]
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 463,
"end": 502,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 47
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 467,
"end": 501,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 46
}
},
"id": {
"type": "Identifier",
"start": 467,
"end": 473,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 18
}
},
"name": "height"
},
"init": {
"type": "CallExpression",
"start": 476,
"end": 501,
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 46
}
},
"callee": {
"type": "MemberExpression",
"start": 476,
"end": 493,
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 38
}
},
"object": {
"type": "Identifier",
"start": 476,
"end": 482,
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 27
}
},
"name": "onLine"
},
"property": {
"type": "Identifier",
"start": 483,
"end": 493,
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 38
}
},
"name": "distanceTo"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 494,
"end": 500,
"loc": {
"start": {
"line": 12,
"column": 39
},
"end": {
"line": 12,
"column": 45
}
},
"name": "endPos"
}
]
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 511,
"end": 565,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 62
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 515,
"end": 564,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 61
}
},
"id": {
"type": "Identifier",
"start": 515,
"end": 523,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 20
}
},
"name": "isLinear"
},
"init": {
"type": "BinaryExpression",
"start": 527,
"end": 563,
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 60
}
},
"left": {
"type": "Identifier",
"start": 527,
"end": 533,
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 30
}
},
"name": "height"
},
"operator": "<=",
"right": {
"type": "BinaryExpression",
"start": 537,
"end": 563,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 60
}
},
"left": {
"type": "BinaryExpression",
"start": 537,
"end": 556,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 53
}
},
"left": {
"type": "CallExpression",
"start": 537,
"end": 549,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 46
}
},
"callee": {
"type": "MemberExpression",
"start": 537,
"end": 547,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 44
}
},
"object": {
"type": "Identifier",
"start": 537,
"end": 540,
"loc": {
"start": {
"line": 13,
"column": 34
},
"end": {
"line": 13,
"column": 37
}
},
"name": "dir"
},
"property": {
"type": "Identifier",
"start": 541,
"end": 547,
"loc": {
"start": {
"line": 13,
"column": 38
},
"end": {
"line": 13,
"column": 44
}
},
"name": "length"
},
"computed": false
},
"arguments": []
},
"operator": "*",
"right": {
"type": "Literal",
"start": 552,
"end": 556,
"loc": {
"start": {
"line": 13,
"column": 49
},
"end": {
"line": 13,
"column": 53
}
},
"value": 0.001,
"rawValue": 0.001,
"raw": "1e-3"
}
},
"operator": "+",
"right": {
"type": "Literal",
"start": 559,
"end": 563,
"loc": {
"start": {
"line": 13,
"column": 56
},
"end": {
"line": 13,
"column": 60
}
},
"value": 0.001,
"rawValue": 0.001,
"raw": "1e-3"