awv3
Version:
AWV client CAD framework
1,594 lines (1,593 loc) • 2.95 MB
JSON
{
"type": "Program",
"start": 0,
"end": 28370,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 711,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 40
}
},
"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": 39,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 39
}
},
"value": "../sketcher/sketch",
"rawValue": "../sketcher/sketch",
"raw": "'../sketcher/sketch'"
}
},
{
"type": "ImportDeclaration",
"start": 42,
"end": 86,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 44
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 49,
"end": 57,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 49,
"end": 57,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 15
}
},
"name": "Sketcher"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 63,
"end": 85,
"loc": {
"start": {
"line": 2,
"column": 21
},
"end": {
"line": 2,
"column": 43
}
},
"value": "../sketcher/sketcher",
"rawValue": "../sketcher/sketcher",
"raw": "'../sketcher/sketcher'"
}
},
{
"type": "ImportDeclaration",
"start": 88,
"end": 141,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 53
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 96,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 22
}
},
"imported": {
"type": "Identifier",
"start": 96,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 22
}
},
"name": "ClassCadObject"
},
"local": {
"type": "Identifier",
"start": 96,
"end": 110,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 22
}
},
"name": "ClassCadObject"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 117,
"end": 140,
"loc": {
"start": {
"line": 3,
"column": 29
},
"end": {
"line": 3,
"column": 52
}
},
"value": "../sketcher/ccobjects",
"rawValue": "../sketcher/ccobjects",
"raw": "'../sketcher/ccobjects'"
}
},
{
"type": "ImportDeclaration",
"start": 143,
"end": 175,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 32
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 150,
"end": 154,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 150,
"end": 154,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 11
}
},
"name": "View"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 160,
"end": 174,
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 31
}
},
"value": "../core/view",
"rawValue": "../core/view",
"raw": "'../core/view'"
}
},
{
"type": "ImportDeclaration",
"start": 177,
"end": 246,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 69
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 185,
"end": 192,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 15
}
},
"imported": {
"type": "Identifier",
"start": 185,
"end": 192,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 15
}
},
"name": "parseTo"
},
"local": {
"type": "Identifier",
"start": 185,
"end": 192,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 15
}
},
"name": "parseTo"
}
},
{
"type": "ImportSpecifier",
"start": 194,
"end": 204,
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 27
}
},
"imported": {
"type": "Identifier",
"start": 194,
"end": 204,
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 27
}
},
"name": "Expression"
},
"local": {
"type": "Identifier",
"start": 194,
"end": 204,
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 27
}
},
"name": "Expression"
}
},
{
"type": "ImportSpecifier",
"start": 206,
"end": 215,
"loc": {
"start": {
"line": 5,
"column": 29
},
"end": {
"line": 5,
"column": 38
}
},
"imported": {
"type": "Identifier",
"start": 206,
"end": 215,
"loc": {
"start": {
"line": 5,
"column": 29
},
"end": {
"line": 5,
"column": 38
}
},
"name": "Statement"
},
"local": {
"type": "Identifier",
"start": 206,
"end": 215,
"loc": {
"start": {
"line": 5,
"column": 29
},
"end": {
"line": 5,
"column": 38
}
},
"name": "Statement"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 222,
"end": 245,
"loc": {
"start": {
"line": 5,
"column": 45
},
"end": {
"line": 5,
"column": 68
}
},
"value": "../sketcher/cchelpers",
"rawValue": "../sketcher/cchelpers",
"raw": "'../sketcher/cchelpers'"
}
},
{
"type": "ImportDeclaration",
"start": 248,
"end": 274,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 255,
"end": 260,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 255,
"end": 260,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 12
}
},
"name": "THREE"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 266,
"end": 273,
"loc": {
"start": {
"line": 6,
"column": 18
},
"end": {
"line": 6,
"column": 25
}
},
"value": "three",
"rawValue": "three",
"raw": "'three'"
},
"trailingComments": [
{
"type": "CommentLine",
"value": "note: invisible geometry is not used anymore...",
"start": 278,
"end": 327,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 49
}
},
"range": [
278,
327
]
},
{
"type": "CommentLine",
"value": "var interactMaterial = new THREE.MeshBasicMaterial({color: 0xff0000, visible: false, side: THREE.DoubleSide});",
"start": 329,
"end": 441,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 112
}
},
"range": [
329,
441
]
},
{
"type": "CommentLine",
"value": " mixin for geometric objects that can be highlighted",
"start": 445,
"end": 499,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 54
}
},
"range": [
445,
499
]
}
]
},
{
"type": "FunctionDeclaration",
"start": 501,
"end": 1967,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 43,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 510,
"end": 527,
"loc": {
"start": {
"line": 12,
"column": 9
},
"end": {
"line": 12,
"column": 26
}
},
"name": "meshHighlightable",
"leadingComments": null
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 530,
"end": 1967,
"loc": {
"start": {
"line": 12,
"column": 29
},
"end": {
"line": 43,
"column": 1
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 537,
"end": 1469,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 32,
"column": 6
}
},
"expression": {
"type": "AssignmentExpression",
"start": 537,
"end": 1468,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 32,
"column": 5
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 537,
"end": 547,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 14
}
},
"object": {
"type": "ThisExpression",
"start": 537,
"end": 541,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 542,
"end": 547,
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 14
}
},
"name": "hover"
},
"computed": false
},
"right": {
"type": "FunctionExpression",
"start": 550,
"end": 1468,
"loc": {
"start": {
"line": 13,
"column": 17
},
"end": {
"line": 32,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 561,
"end": 1468,
"loc": {
"start": {
"line": 13,
"column": 28
},
"end": {
"line": 32,
"column": 5
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 572,
"end": 594,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 30
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 576,
"end": 593,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 29
}
},
"id": {
"type": "Identifier",
"start": 576,
"end": 579,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 15
}
},
"name": "obj"
},
"init": {
"type": "MemberExpression",
"start": 582,
"end": 593,
"loc": {
"start": {
"line": 14,
"column": 18
},
"end": {
"line": 14,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 582,
"end": 586,
"loc": {
"start": {
"line": 14,
"column": 18
},
"end": {
"line": 14,
"column": 22
}
}
},
"property": {
"type": "Identifier",
"start": 587,
"end": 593,
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 29
}
},
"name": "parent"
},
"computed": false
}
}
],
"kind": "var"
},
{
"type": "VariableDeclaration",
"start": 604,
"end": 643,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 47
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 608,
"end": 642,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 46
}
},
"id": {
"type": "Identifier",
"start": 608,
"end": 614,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 18
}
},
"name": "sketch"
},
"init": {
"type": "CallExpression",
"start": 617,
"end": 642,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 46
}
},
"callee": {
"type": "MemberExpression",
"start": 617,
"end": 636,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 40
}
},
"object": {
"type": "Identifier",
"start": 617,
"end": 623,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 27
}
},
"name": "Sketch"
},
"property": {
"type": "Identifier",
"start": 624,
"end": 636,
"loc": {
"start": {
"line": 15,
"column": 28
},
"end": {
"line": 15,
"column": 40
}
},
"name": "FindSketchOf"
},
"computed": false
},
"arguments": [
{
"type": "ThisExpression",
"start": 637,
"end": 641,
"loc": {
"start": {
"line": 15,
"column": 41
},
"end": {
"line": 15,
"column": 45
}
}
}
]
}
}
],
"kind": "var"
},
{
"type": "IfStatement",
"start": 653,
"end": 673,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 28
}
},
"test": {
"type": "UnaryExpression",
"start": 657,
"end": 664,
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 19
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 658,
"end": 664,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 19
}
},
"name": "sketch"
}
},
"consequent": {
"type": "ReturnStatement",
"start": 666,
"end": 673,
"loc": {
"start": {
"line": 16,
"column": 21
},
"end": {
"line": 16,
"column": 28
}
},
"argument": null,
"leadingComments": null,
"trailingComments": null
},
"alternate": null,
"trailingComments": [
{
"type": "CommentLine",
"value": "like object being deleted...",
"start": 677,
"end": 707,
"loc": {
"start": {
"line": 16,
"column": 32
},
"end": {
"line": 16,
"column": 62
}
},
"range": [
677,
707
]
}
]
},
{
"type": "ExpressionStatement",
"start": 717,
"end": 784,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 75
}
},
"expression": {
"type": "AssignmentExpression",
"start": 717,
"end": 783,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 74
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 717,
"end": 736,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 27
}
},
"object": {
"type": "MemberExpression",
"start": 717,
"end": 730,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 717,
"end": 721,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 722,
"end": 730,
"loc": {
"start": {
"line": 17,
"column": 13
},
"end": {
"line": 17,
"column": 21
}
},
"name": "material"
},
"computed": false,
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 731,
"end": 736,
"loc": {
"start": {
"line": 17,
"column": 22
},
"end": {
"line": 17,
"column": 27
}
},
"name": "color"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "NewExpression",
"start": 739,
"end": 783,
"loc": {
"start": {
"line": 17,
"column": 30
},
"end": {
"line": 17,
"column": 74
}
},
"callee": {
"type": "MemberExpression",
"start": 743,
"end": 754,
"loc": {
"start": {
"line": 17,
"column": 34
},
"end": {
"line": 17,
"column": 45
}
},
"object": {
"type": "Identifier",
"start": 743,
"end": 748,
"loc": {
"start": {
"line": 17,
"column": 34
},
"end": {
"line": 17,
"column": 39
}
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 749,
"end": 754,
"loc": {
"start": {
"line": 17,
"column": 40
},
"end": {
"line": 17,
"column": 45
}
},
"name": "Color"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 755,
"end": 782,
"loc": {
"start": {
"line": 17,
"column": 46
},
"end": {
"line": 17,
"column": 73
}
},
"callee": {
"type": "Identifier",
"start": 755,
"end": 763,
"loc": {
"start": {
"line": 17,
"column": 46
},
"end": {
"line": 17,
"column": 54
}
},
"name": "getColor"
},
"arguments": [
{
"type": "MemberExpression",
"start": 764,
"end": 775,
"loc": {
"start": {
"line": 17,
"column": 55
},
"end": {
"line": 17,
"column": 66
}
},
"object": {
"type": "ThisExpression",
"start": 764,
"end": 768,
"loc": {
"start": {
"line": 17,
"column": 55
},
"end": {
"line": 17,
"column": 59
}
}
},
"property": {
"type": "Identifier",
"start": 769,
"end": 775,
"loc": {
"start": {
"line": 17,
"column": 60
},
"end": {
"line": 17,
"column": 66
}
},
"name": "parent"
},
"computed": false
},
{
"type": "Literal",
"start": 777,
"end": 781,
"loc": {
"start": {
"line": 17,
"column": 68
},
"end": {
"line": 17,
"column": 72
}
},
"value": true,
"rawValue": true,
"raw": "true"
}
]
}
]
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": "like object being deleted...",
"start": 677,
"end": 707,
"loc": {
"start": {
"line": 16,
"column": 32
},
"end": {
"line": 16,
"column": 62
}
},
"range": [
677,
707
]
}
]
},
{
"type": "IfStatement",
"start": 794,
"end": 832,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 46
}
},
"test": {
"type": "MemberExpression",
"start": 798,
"end": 823,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 798,
"end": 801,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 15
}
},
"name": "obj"
},
"property": {
"type": "Identifier",
"start": 802,
"end": 823,
"loc": {
"start": {
"line": 18,
"column": 16
},
"end": {
"line": 18,
"column": 37
}
},
"name": "auxiliaryConstruction"
},
"computed": false
},
"consequent": {
"type": "ReturnStatement",
"start": 825,
"end": 832,
"loc": {
"start": {
"line": 18,
"column": 39
},
"end": {
"line": 18,
"column": 46
}
},
"argument": null
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 842,
"end": 1047,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 25,
"column": 10
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 846,
"end": 1046,
"loc": {
"start": {
"line": 19,
"column": 12
},
"end": {
"line": 25,
"column": 9
}
},
"id": {
"type": "Identifier",
"start": 846,
"end": 854,
"loc": {
"start": {
"line": 19,
"column": 12
},
"end": {
"line": 19,
"column": 20
}
},
"name": "material"
},
"init": {
"type": "NewExpression",
"start": 857,
"end": 1046,
"loc": {
"start": {
"line": 19,
"column": 23
},
"end": {
"line": 25,
"column": 9
}
},
"callee": {
"type": "MemberExpression",
"start": 861,
"end": 884,
"loc": {
"start": {
"line": 19,
"column": 27
},
"end": {
"line": 19,
"column": 50
}
},
"object": {
"type": "Identifier",
"start": 861,
"end": 866,
"loc": {
"start": {
"line": 19,
"column": 27
},
"end": {
"line": 19,
"column": 32
}
},
"name": "THREE"
},
"property": {
"type": "Identifier",
"start": 867,
"end": 884,
"loc": {
"start": {
"line": 19,
"column": 33
},
"end": {
"line": 19,
"column": 50
}
},
"name": "LineBasicMaterial"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 899,
"end": 1035,
"loc": {
"start": {
"line": 20,
"column": 12
},
"end": {
"line": 24,
"column": 13
}
},
"properties": [
{
"type": "Property",
"start": 918,
"end": 953,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,