awv3
Version:
⚡ AWV3 embedded CAD
1,677 lines (1,676 loc) • 1.98 MB
JSON
{
"type": "File",
"start": 0,
"end": 9906,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 262,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 9906,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 262,
"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": "FunctionDeclaration",
"start": 288,
"end": 369,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 15,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 297,
"end": 305,
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 17
},
"identifierName": "uniNorm2"
},
"name": "uniNorm2"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 306,
"end": 309,
"loc": {
"start": {
"line": 13,
"column": 18
},
"end": {
"line": 13,
"column": 21
},
"identifierName": "vec"
},
"name": "vec"
}
],
"body": {
"type": "BlockStatement",
"start": 311,
"end": 369,
"loc": {
"start": {
"line": 13,
"column": 23
},
"end": {
"line": 15,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 317,
"end": 367,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 54
}
},
"argument": {
"type": "CallExpression",
"start": 324,
"end": 366,
"loc": {
"start": {
"line": 14,
"column": 11
},
"end": {
"line": 14,
"column": 53
}
},
"callee": {
"type": "MemberExpression",
"start": 324,
"end": 332,
"loc": {
"start": {
"line": 14,
"column": 11
},
"end": {
"line": 14,
"column": 19
}
},
"object": {
"type": "Identifier",
"start": 324,
"end": 328,
"loc": {
"start": {
"line": 14,
"column": 11
},
"end": {
"line": 14,
"column": 15
},
"identifierName": "Math"
},
"name": "Math"
},
"property": {
"type": "Identifier",
"start": 329,
"end": 332,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 19
},
"identifierName": "max"
},
"name": "max"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 333,
"end": 348,
"loc": {
"start": {
"line": 14,
"column": 20
},
"end": {
"line": 14,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 333,
"end": 341,
"loc": {
"start": {
"line": 14,
"column": 20
},
"end": {
"line": 14,
"column": 28
}
},
"object": {
"type": "Identifier",
"start": 333,
"end": 337,
"loc": {
"start": {
"line": 14,
"column": 20
},
"end": {
"line": 14,
"column": 24
},
"identifierName": "Math"
},
"name": "Math"
},
"property": {
"type": "Identifier",
"start": 338,
"end": 341,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 28
},
"identifierName": "abs"
},
"name": "abs"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 342,
"end": 347,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 342,
"end": 345,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 32
},
"identifierName": "vec"
},
"name": "vec"
},
"property": {
"type": "Identifier",
"start": 346,
"end": 347,
"loc": {
"start": {
"line": 14,
"column": 33
},
"end": {
"line": 14,
"column": 34
},
"identifierName": "x"
},
"name": "x"
},
"computed": false
}
]
},
{
"type": "CallExpression",
"start": 350,
"end": 365,
"loc": {
"start": {
"line": 14,
"column": 37
},
"end": {
"line": 14,
"column": 52
}
},
"callee": {
"type": "MemberExpression",
"start": 350,
"end": 358,
"loc": {
"start": {
"line": 14,
"column": 37
},
"end": {
"line": 14,
"column": 45
}
},
"object": {
"type": "Identifier",
"start": 350,
"end": 354,
"loc": {
"start": {
"line": 14,
"column": 37
},
"end": {
"line": 14,
"column": 41
},
"identifierName": "Math"
},
"name": "Math"
},
"property": {
"type": "Identifier",
"start": 355,
"end": 358,
"loc": {
"start": {
"line": 14,
"column": 42
},
"end": {
"line": 14,
"column": 45
},
"identifierName": "abs"
},
"name": "abs"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 359,
"end": 364,
"loc": {
"start": {
"line": 14,
"column": 46
},
"end": {
"line": 14,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 359,
"end": 362,
"loc": {
"start": {
"line": 14,
"column": 46
},
"end": {
"line": 14,
"column": 49
},
"identifierName": "vec"
},
"name": "vec"
},
"property": {
"type": "Identifier",
"start": 363,
"end": 364,
"loc": {
"start": {
"line": 14,
"column": 50
},
"end": {
"line": 14,
"column": 51
},
"identifierName": "y"
},
"name": "y"
},
"computed": false
}
]
}
]
}
}
],
"directives": []
}
},
{
"type": "FunctionDeclaration",
"start": 370,
"end": 407,
"loc": {
"start": {
"line": 16,
"column": 0
},
"end": {
"line": 18,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 379,
"end": 382,
"loc": {
"start": {
"line": 16,
"column": 9
},
"end": {
"line": 16,
"column": 12
},
"identifierName": "sqr"
},
"name": "sqr"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 383,
"end": 384,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 14
},
"identifierName": "x"
},
"name": "x"
}
],
"body": {
"type": "BlockStatement",
"start": 386,
"end": 407,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 18,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 392,
"end": 405,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 17
}
},
"argument": {
"type": "BinaryExpression",
"start": 399,
"end": 404,
"loc": {
"start": {
"line": 17,
"column": 11
},
"end": {
"line": 17,
"column": 16
}
},
"left": {
"type": "Identifier",
"start": 399,
"end": 400,
"loc": {
"start": {
"line": 17,
"column": 11
},
"end": {
"line": 17,
"column": 12
},
"identifierName": "x"
},
"name": "x"
},
"operator": "*",
"right": {
"type": "Identifier",
"start": 403,
"end": 404,
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 16
},
"identifierName": "x"
},
"name": "x"
}
}
}
],
"directives": []
}
},
{
"type": "ExportDefaultDeclaration",
"start": 409,
"end": 9905,
"loc": {
"start": {
"line": 20,
"column": 0
},
"end": {
"line": 261,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 424,
"end": 9905,
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 261,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 430,
"end": 440,
"loc": {
"start": {
"line": 20,
"column": 21
},
"end": {
"line": 20,
"column": 31
},
"identifierName": "Visualizer"
},
"name": "Visualizer"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 441,
"end": 9905,
"loc": {
"start": {
"line": 20,
"column": 32
},
"end": {
"line": 261,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 447,
"end": 996,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 32,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 447,
"end": 458,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 21,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 459,
"end": 467,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,
"column": 24
},
"identifierName": "sketcher"
},
"name": "sketcher"
},
{
"type": "Identifier",
"start": 469,
"end": 477,
"loc": {
"start": {
"line": 21,
"column": 26
},
"end": {
"line": 21,
"column": 34
},
"identifierName": "textures"
},
"name": "textures"
}
],
"body": {
"type": "BlockStatement",
"start": 479,
"end": 996,
"loc": {
"start": {
"line": 21,
"column": 36
},
"end": {
"line": 32,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 489,
"end": 512,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 31
}
},
"expression": {
"type": "AssignmentExpression",
"start": 489,
"end": 511,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 30
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 489,
"end": 498,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 489,
"end": 493,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 22,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 494,
"end": 498,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 17
},
"identifierName": "mode"
},
"name": "mode"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 501,
"end": 511,
"loc": {
"start": {
"line": 22,
"column": 20
},
"end": {
"line": 22,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 501,
"end": 505,
"loc": {
"start": {
"line": 22,
"column": 20
},
"end": {
"line": 22,
"column": 24
},
"identifierName": "Mode"
},
"name": "Mode"
},
"property": {
"type": "Identifier",
"start": 506,
"end": 511,
"loc": {
"start": {
"line": 22,
"column": 25
},
"end": {
"line": 22,
"column": 30
},
"identifierName": "Hover"
},
"name": "Hover"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 521,
"end": 546,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 33
}
},
"expression": {
"type": "AssignmentExpression",
"start": 521,
"end": 545,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 32
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 521,
"end": 534,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 521,
"end": 525,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 526,
"end": 534,
"loc": {
"start": {
"line": 23,
"column": 13
},
"end": {
"line": 23,
"column": 21
},
"identifierName": "sketcher"
},
"name": "sketcher"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 537,
"end": 545,
"loc": {
"start": {
"line": 23,
"column": 24
},
"end": {
"line": 23,
"column": 32
},
"identifierName": "sketcher"
},
"name": "sketcher"
}
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Set of constraint ids to avoid iterating and filtering sketch.children",
"start": 555,
"end": 628,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 81
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 637,
"end": 666,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 637,
"end": 665,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 637,
"end": 653,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 24
}
},
"object": {
"type": "ThisExpression",
"start": 637,
"end": 641,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 642,
"end": 653,
"loc": {
"start": {
"line": 25,
"column": 13