awv3
Version:
AWV client CAD framework
1,515 lines (1,514 loc) • 1.15 MB
JSON
{
"type": "Program",
"start": 0,
"end": 10505,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 262,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 37
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"name": "Sketch"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 19,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 36
}
},
"value": "sketcher/sketch",
"rawValue": "sketcher/sketch",
"raw": "'sketcher/sketch'"
}
},
{
"type": "ImportDeclaration",
"start": 38,
"end": 83,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 45
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 45,
"end": 55,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 45,
"end": 55,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"name": "Constraint"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 61,
"end": 82,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 44
}
},
"value": "sketcher/constraint",
"rawValue": "sketcher/constraint",
"raw": "'sketcher/constraint'"
}
},
{
"type": "ImportDeclaration",
"start": 84,
"end": 133,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 49
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 92,
"end": 97,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 92,
"end": 97,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 13
}
},
"name": "Point"
},
"local": {
"type": "Identifier",
"start": 92,
"end": 97,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 13
}
},
"name": "Point"
}
},
{
"type": "ImportSpecifier",
"start": 99,
"end": 103,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 19
}
},
"imported": {
"type": "Identifier",
"start": 99,
"end": 103,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 19
}
},
"name": "Line"
},
"local": {
"type": "Identifier",
"start": 99,
"end": 103,
"loc": {
"start": {
"line": 3,
"column": 15
},
"end": {
"line": 3,
"column": 19
}
},
"name": "Line"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 110,
"end": 132,
"loc": {
"start": {
"line": 3,
"column": 26
},
"end": {
"line": 3,
"column": 48
}
},
"value": "sketcher/geomobjects",
"rawValue": "sketcher/geomobjects",
"raw": "'sketcher/geomobjects'"
}
},
{
"type": "ImportDeclaration",
"start": 134,
"end": 205,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 71
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 142,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 24
}
},
"imported": {
"type": "Identifier",
"start": 142,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 24
}
},
"name": "createGeomObject"
},
"local": {
"type": "Identifier",
"start": 142,
"end": 158,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 24
}
},
"name": "createGeomObject"
}
},
{
"type": "ImportSpecifier",
"start": 160,
"end": 177,
"loc": {
"start": {
"line": 4,
"column": 26
},
"end": {
"line": 4,
"column": 43
}
},
"imported": {
"type": "Identifier",
"start": 160,
"end": 177,
"loc": {
"start": {
"line": 4,
"column": 26
},
"end": {
"line": 4,
"column": 43
}
},
"name": "drawArcBy_S_E_CPh"
},
"local": {
"type": "Identifier",
"start": 160,
"end": 177,
"loc": {
"start": {
"line": 4,
"column": 26
},
"end": {
"line": 4,
"column": 43
}
},
"name": "drawArcBy_S_E_CPh"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 184,
"end": 204,
"loc": {
"start": {
"line": 4,
"column": 50
},
"end": {
"line": 4,
"column": 70
}
},
"value": "sketcher/geomutils",
"rawValue": "sketcher/geomutils",
"raw": "'sketcher/geomutils'"
}
},
{
"type": "ImportDeclaration",
"start": 206,
"end": 232,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 213,
"end": 218,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 213,
"end": 218,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 224,
"end": 231,
"loc": {
"start": {
"line": 5,
"column": 18
},
"end": {
"line": 5,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
}
},
{
"type": "ExportDefaultDeclaration",
"start": 234,
"end": 10504,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 261,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 249,
"end": 10504,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 261,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 255,
"end": 270,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 36
}
},
"name": "FilletProcessor"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 271,
"end": 10504,
"loc": {
"start": {
"line": 7,
"column": 37
},
"end": {
"line": 261,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 277,
"end": 454,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 14,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 277,
"end": 288,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 288,
"end": 454,
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 14,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 289,
"end": 297,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 24
}
},
"name": "sketcher"
},
{
"type": "Identifier",
"start": 299,
"end": 305,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 32
}
},
"name": "sketch"
}
],
"body": {
"type": "BlockStatement",
"start": 307,
"end": 454,
"loc": {
"start": {
"line": 8,
"column": 34
},
"end": {
"line": 14,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 317,
"end": 342,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 33
}
},
"expression": {
"type": "AssignmentExpression",
"start": 317,
"end": 341,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 32
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 317,
"end": 330,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 317,
"end": 321,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 322,
"end": 330,
"loc": {
"start": {
"line": 9,
"column": 13
},
"end": {
"line": 9,
"column": 21
}
},
"name": "sketcher"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 333,
"end": 341,
"loc": {
"start": {
"line": 9,
"column": 24
},
"end": {
"line": 9,
"column": 32
}
},
"name": "sketcher"
}
}
},
{
"type": "ExpressionStatement",
"start": 351,
"end": 372,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 351,
"end": 371,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 351,
"end": 362,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 351,
"end": 355,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 356,
"end": 362,
"loc": {
"start": {
"line": 10,
"column": 13
},
"end": {
"line": 10,
"column": 19
}
},
"name": "sketch"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 365,
"end": 371,
"loc": {
"start": {
"line": 10,
"column": 22
},
"end": {
"line": 10,
"column": 28
}
},
"name": "sketch"
}
}
},
{
"type": "ExpressionStatement",
"start": 382,
"end": 410,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 36
}
},
"expression": {
"type": "AssignmentExpression",
"start": 382,
"end": 409,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 35
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 382,
"end": 402,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 28
}
},
"object": {
"type": "ThisExpression",
"start": 382,
"end": 386,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 387,
"end": 402,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 28
}
},
"name": "linearTolerance"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 405,
"end": 409,
"loc": {
"start": {
"line": 12,
"column": 31
},
"end": {
"line": 12,
"column": 35
}
},
"value": 0.001,
"rawValue": 0.001,
"raw": "1e-3"
}
}
},
{
"type": "ExpressionStatement",
"start": 419,
"end": 448,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 419,
"end": 447,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 419,
"end": 440,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 419,
"end": 423,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 424,
"end": 440,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 29
}
},
"name": "angularTolerance"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 443,
"end": 447,
"loc": {
"start": {
"line": 13,
"column": 32
},
"end": {
"line": 13,
"column": 36
}
},
"value": 0.001,
"rawValue": 0.001,
"raw": "1e-3"
}
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 460,
"end": 932,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 28,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 460,
"end": 472,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 16
}
},
"name": "FindPointsAt"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 472,
"end": 932,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 28,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 473,
"end": 476,
"loc": {
"start": {
"line": 16,
"column": 17
},
"end": {
"line": 16,
"column": 20
}
},
"name": "pos"
},
{
"type": "Identifier",
"start": 478,
"end": 481,
"loc": {
"start": {
"line": 16,
"column": 22
},
"end": {
"line": 16,
"column": 25
}
},
"name": "tol"
}
],
"body": {
"type": "BlockStatement",
"start": 483,
"end": 932,
"loc": {
"start": {
"line": 16,
"column": 27
},
"end": {
"line": 28,
"column": 5
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 493,
"end": 628,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 20,
"column": 10
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 497,
"end": 627,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 20,
"column": 9
}
},
"id": {
"type": "Identifier",
"start": 497,
"end": 508,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 23
}
},
"name": "equalPoints"
},
"init": {
"type": "FunctionExpression",
"start": 511,
"end": 627,
"loc": {
"start": {
"line": 17,
"column": 26
},
"end": {
"line": 20,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 521,
"end": 522,
"loc": {
"start": {
"line": 17,
"column": 36
},
"end": {
"line": 17,
"column": 37
}
},
"name": "a"
},
{
"type": "Identifier",
"start": 524,
"end": 525,
"loc": {
"start": {
"line": 17,
"column": 39
},
"end": {
"line": 17,
"column": 40
}
},
"name": "b"
}
],
"body": {
"type": "BlockStatement",
"start": 527,
"end": 627,
"loc": {
"start": {
"line": 17,
"column": 42
},
"end": {
"line": 20,
"column": 9
}
},
"body": [
{
"type": "IfStatement",
"start": 541,
"end": 617,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 19,
"column": 36
}
},
"test": {
"type": "Identifier",
"start": 545,
"end": 548,
"loc": {
"start": {
"line": 18,
"column": 16
},
"end": {
"line": 18,
"column": 19
}
},
"name": "tol"
},
"consequent": {
"type": "ReturnStatement",
"start": 550,
"end": 580,
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 18,
"column": 51
}
},
"argument": {
"type": "BinaryExpression",
"start": 557,
"end": 579,
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 50
}
},
"left": {
"type": "CallExpression",
"start": 557,
"end": 572,
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 43
}
},
"callee": {
"type": "MemberExpression",
"start": 557,
"end": 569,
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 40
}
},
"object": {
"type": "Identifier",
"start": 557,
"end": 558,
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 29
}
},
"name": "a"
},
"property": {
"type": "Identifier",
"start": 559,
"end": 569,
"loc": {
"start": {
"line": 18,
"column": 30
},
"end": {
"line": 18,
"column": 40
}
},
"name": "distanceTo"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 570,
"end": 571,
"loc": {
"start": {
"line": 18,
"column": 41
},
"end": {
"line": 18,
"column": 42
}
},
"name": "b"
}
]
},
"operator": "<=",
"right": {
"type": "Identifier",
"start": 576,
"end": 579,
"loc": {
"start": {
"line": 18,
"column": 47
},
"end": {
"line": 18,
"column": 50
}
},
"name": "tol"
}
}
},
"alternate": {
"type": "ReturnStatement",
"start": 598,
"end": 617,
"loc": {
"start": {
"line": 19,
"column": 17
},
"end": {
"line": 19,
"column": 36
}
},
"argument": {
"type": "CallExpression",
"start": 605,
"end": 616,
"loc": {
"start": {
"line": 19,
"column": 24
},
"end": {
"line": 19,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 605,
"end": 613,
"loc": {
"start": {
"line": 19,
"column": 24
},
"end": {
"line": 19,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 605,
"end": 606,
"loc": {
"start": {
"line": 19,
"column": 24
},
"end": {
"line": 19,
"column": 25
}
},
"name": "a"
},
"property": {
"type": "Identifier",
"start": 607,
"end": 613,
"loc": {
"start": {
"line": 19,
"column": 26
},
"end": {
"line": 19,
"column": 32
}
},
"name": "equals"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 614,
"end": 615,
"loc": {
"start": {
"line": 19,
"column": 33
},
"end": {
"line": 19,
"column": 34
}
},
"name": "b"
}
]
}
}
}
]
}
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 637,
"end": 687,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 58
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 641,
"end": 686,