awv3
Version:
⚡ AWV3 embedded CAD
1,569 lines • 847 kB
JSON
{
"type": "File",
"start": 0,
"end": 4147,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 120,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 4147,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 120,
"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"
}
},
{
"type": "ImportDeclaration",
"start": 32,
"end": 77,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 45
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 39,
"end": 46,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 39,
"end": 46,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "Object3"
},
"name": "Object3"
}
}
],
"source": {
"type": "StringLiteral",
"start": 52,
"end": 76,
"loc": {
"start": {
"line": 2,
"column": 20
},
"end": {
"line": 2,
"column": 44
}
},
"extra": {
"rawValue": "../../../three/object3",
"raw": "'../../../three/object3'"
},
"value": "../../../three/object3"
}
},
{
"type": "ImportDeclaration",
"start": 78,
"end": 107,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 29
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 85,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 85,
"end": 90,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 12
},
"identifierName": "Ccref"
},
"name": "Ccref"
}
}
],
"source": {
"type": "StringLiteral",
"start": 96,
"end": 106,
"loc": {
"start": {
"line": 3,
"column": 18
},
"end": {
"line": 3,
"column": 28
}
},
"extra": {
"rawValue": "../ccref",
"raw": "'../ccref'"
},
"value": "../ccref"
}
},
{
"type": "ImportDeclaration",
"start": 108,
"end": 152,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 44
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 117,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
}
},
"imported": {
"type": "Identifier",
"start": 117,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "getArcAngles"
},
"name": "getArcAngles"
},
"local": {
"type": "Identifier",
"start": 117,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "getArcAngles"
},
"name": "getArcAngles"
}
}
],
"source": {
"type": "StringLiteral",
"start": 137,
"end": 151,
"loc": {
"start": {
"line": 4,
"column": 29
},
"end": {
"line": 4,
"column": 43
}
},
"extra": {
"rawValue": "../geomutils",
"raw": "'../geomutils'"
},
"value": "../geomutils"
}
},
{
"type": "ImportDeclaration",
"start": 153,
"end": 209,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 56
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 160,
"end": 178,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 25
}
},
"local": {
"type": "Identifier",
"start": 160,
"end": 178,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 25
},
"identifierName": "ConstraintGraphics"
},
"name": "ConstraintGraphics"
}
}
],
"source": {
"type": "StringLiteral",
"start": 184,
"end": 208,
"loc": {
"start": {
"line": 5,
"column": 31
},
"end": {
"line": 5,
"column": 55
}
},
"extra": {
"rawValue": "../graphics/constraint",
"raw": "'../graphics/constraint'"
},
"value": "../graphics/constraint"
}
},
{
"type": "VariableDeclaration",
"start": 211,
"end": 286,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 11,
"column": 3
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 217,
"end": 285,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 11,
"column": 2
}
},
"id": {
"type": "Identifier",
"start": 217,
"end": 221,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 10
},
"identifierName": "Mode"
},
"name": "Mode"
},
"init": {
"type": "CallExpression",
"start": 224,
"end": 285,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 11,
"column": 2
}
},
"callee": {
"type": "MemberExpression",
"start": 224,
"end": 237,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 26
}
},
"object": {
"type": "Identifier",
"start": 224,
"end": 230,
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 19
},
"identifierName": "Object"
},
"name": "Object"
},
"property": {
"type": "Identifier",
"start": 231,
"end": 237,
"loc": {
"start": {
"line": 7,
"column": 20
},
"end": {
"line": 7,
"column": 26
},
"identifierName": "freeze"
},
"name": "freeze"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 238,
"end": 284,
"loc": {
"start": {
"line": 7,
"column": 27
},
"end": {
"line": 11,
"column": 1
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 244,
"end": 252,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 12
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 244,
"end": 249,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 9
},
"identifierName": "Never"
},
"name": "Never"
},
"value": {
"type": "NumericLiteral",
"start": 251,
"end": 252,
"loc": {
"start": {
"line": 8,
"column": 11
},
"end": {
"line": 8,
"column": 12
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
},
{
"type": "ObjectProperty",
"start": 258,
"end": 266,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 12
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 258,
"end": 263,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 9
},
"identifierName": "Hover"
},
"name": "Hover"
},
"value": {
"type": "NumericLiteral",
"start": 265,
"end": 266,
"loc": {
"start": {
"line": 9,
"column": 11
},
"end": {
"line": 9,
"column": 12
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
{
"type": "ObjectProperty",
"start": 272,
"end": 281,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 13
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 272,
"end": 278,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 10
},
"identifierName": "Always"
},
"name": "Always"
},
"value": {
"type": "NumericLiteral",
"start": 280,
"end": 281,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 13
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
]
}
}
],
"kind": "const"
},
{
"type": "ExportDefaultDeclaration",
"start": 288,
"end": 4146,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 119,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 303,
"end": 4146,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 119,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 309,
"end": 319,
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 31
},
"identifierName": "Visualizer"
},
"name": "Visualizer"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 320,
"end": 4146,
"loc": {
"start": {
"line": 13,
"column": 32
},
"end": {
"line": 119,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 326,
"end": 745,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 23,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 326,
"end": 337,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 338,
"end": 346,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 24
},
"identifierName": "sketcher"
},
"name": "sketcher"
},
{
"type": "Identifier",
"start": 348,
"end": 356,
"loc": {
"start": {
"line": 14,
"column": 26
},
"end": {
"line": 14,
"column": 34
},
"identifierName": "textures"
},
"name": "textures"
}
],
"body": {
"type": "BlockStatement",
"start": 358,
"end": 745,
"loc": {
"start": {
"line": 14,
"column": 36
},
"end": {
"line": 23,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 368,
"end": 391,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 31
}
},
"expression": {
"type": "AssignmentExpression",
"start": 368,
"end": 390,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 30
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 368,
"end": 377,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 368,
"end": 372,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 373,
"end": 377,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 17
},
"identifierName": "mode"
},
"name": "mode"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 380,
"end": 390,
"loc": {
"start": {
"line": 15,
"column": 20
},
"end": {
"line": 15,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 380,
"end": 384,
"loc": {
"start": {
"line": 15,
"column": 20
},
"end": {
"line": 15,
"column": 24
},
"identifierName": "Mode"
},
"name": "Mode"
},
"property": {
"type": "Identifier",
"start": 385,
"end": 390,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 15,
"column": 30
},
"identifierName": "Hover"
},
"name": "Hover"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 400,
"end": 425,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 33
}
},
"expression": {
"type": "AssignmentExpression",
"start": 400,
"end": 424,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 32
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 400,
"end": 413,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 400,
"end": 404,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 405,
"end": 413,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 21
},
"identifierName": "sketcher"
},
"name": "sketcher"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 416,
"end": 424,
"loc": {
"start": {
"line": 16,
"column": 24
},
"end": {
"line": 16,
"column": 32
},
"identifierName": "sketcher"
},
"name": "sketcher"
}
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Set of constraint ids to avoid iterating and filtering sketch.children",
"start": 434,
"end": 507,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 81
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 516,
"end": 545,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 516,
"end": 544,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 516,
"end": 532,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 24
}
},
"object": {
"type": "ThisExpression",
"start": 516,
"end": 520,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 521,
"end": 532,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 24
},
"identifierName": "constraints"
},
"name": "constraints"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "NewExpression",
"start": 535,
"end": 544,
"loc": {
"start": {
"line": 18,
"column": 27
},
"end": {
"line": 18,
"column": 36
}
},
"callee": {
"type": "Identifier",
"start": 539,
"end": 542,
"loc": {
"start": {
"line": 18,
"column": 31
},
"end": {
"line": 18,
"column": 34
},
"identifierName": "Set"
},
"name": "Set"
},
"arguments": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Set of constraint ids to avoid iterating and filtering sketch.children",
"start": 434,
"end": 507,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 81
}
}
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " Reverse mapping from entities to constraints",
"start": 554,
"end": 601,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 55
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 610,
"end": 637,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 35
}
},
"expression": {
"type": "AssignmentExpression",
"start": 610,
"end": 636,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 34
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 610,
"end": 624,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 22
}
},
"object": {
"type": "ThisExpression",
"start": 610,
"end": 614,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 615,
"end": 624,
"loc": {
"start": {
"line": 20,
"column": 13
},
"end": {
"line": 20,
"column": 22
},
"identifierName": "entityFor"
},
"name": "entityFor"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "NewExpression",
"start": 627,
"end": 636,
"loc": {
"start": {
"line": 20,
"column": 25
},
"end": {
"line": 20,
"column": 34
}
},
"callee": {
"type": "Identifier",
"start": 631,
"end": 634,
"loc": {
"start": {
"line": 20,
"column": 29
},
"end": {
"line": 20,
"column": 32
},
"identifierName": "Map"
},
"name": "Map"
},
"arguments": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Reverse mapping from entities to constraints",
"start": 554,
"end": 601,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 55
}
}
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " Used to track constraint positions in all modes",
"start": 646,
"end": 696,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 58
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 705,
"end": 739,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 42
}
},
"expression": {
"type": "AssignmentExpression",
"start": 705,
"end": 738,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 41
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 705,
"end": 726,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 705,
"end": 709,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 710,
"end": 726,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 29
},
"identifierName": "visiblePositions"
},
"name": "visiblePositions"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "NewExpression",
"start": 729,
"end": 738,
"loc": {
"start": {
"line": 22,
"column": 32
},
"end": {
"line": 22,
"column": 41
}
},
"callee": {
"type": "Identifier",
"start": 733,
"end": 736,
"loc": {
"start": {
"line": 22,
"column": 36
},
"end": {
"line": 22,
"column": 39
},
"identifierName": "Set"
},
"name": "Set"
},
"arguments": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Used to track constraint positions in all modes",
"start": 646,
"end": 696,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 58
}
}
}
]
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 751,
"end": 1109,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 32,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 751,
"end": 764,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 17
},
"identifierName": "addConstraint"
},
"name": "addConstraint"
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 765,
"end": 775,
"loc": {
"start": {
"line"