* Change so that operations are stored per module * Refactor so that all modeling commands go through ExecState * Remove unneeded PartialOrd implementations * Remove artifact_commands from KclError since it was only for debugging --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
		
			
				
	
	
		
			657 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			657 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
---
 | 
						|
source: kcl-lib/src/simulation_tests.rs
 | 
						|
description: Operations executed countersunk-plate.kcl
 | 
						|
---
 | 
						|
{
 | 
						|
  "public/kcl-samples/countersunk-plate/main.kcl": [
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "startSketchOn",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Plane",
 | 
						|
          "artifact_id": "[uuid]"
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {},
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 9
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 0
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "GroupBegin",
 | 
						|
      "group": {
 | 
						|
        "type": "FunctionCall",
 | 
						|
        "name": "polar",
 | 
						|
        "functionSourceRange": [],
 | 
						|
        "unlabeledArg": null,
 | 
						|
        "labeledArgs": {
 | 
						|
          "angle": {
 | 
						|
            "value": {
 | 
						|
              "type": "Number",
 | 
						|
              "value": 1.197,
 | 
						|
              "ty": {
 | 
						|
                "type": "Known",
 | 
						|
                "type": "Angle",
 | 
						|
                "type": "Radians"
 | 
						|
              }
 | 
						|
            },
 | 
						|
            "sourceRange": []
 | 
						|
          },
 | 
						|
          "length": {
 | 
						|
            "value": {
 | 
						|
              "type": "Number",
 | 
						|
              "value": 1.663,
 | 
						|
              "ty": {
 | 
						|
                "type": "Default",
 | 
						|
                "len": {
 | 
						|
                  "type": "Inches"
 | 
						|
                },
 | 
						|
                "angle": {
 | 
						|
                  "type": "Degrees"
 | 
						|
                }
 | 
						|
              }
 | 
						|
            },
 | 
						|
            "sourceRange": []
 | 
						|
          }
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 9
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 1
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "CallKwArg",
 | 
						|
            "index": 0
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "GroupEnd"
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "subtract2d",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Sketch",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "tool": {
 | 
						|
          "value": {
 | 
						|
            "type": "Sketch",
 | 
						|
            "value": {
 | 
						|
              "artifactId": "[uuid]"
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 9
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 11
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "extrude",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Sketch",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "length": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": 0.375,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 9
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 12
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "GroupBegin",
 | 
						|
      "group": {
 | 
						|
        "type": "FunctionCall",
 | 
						|
        "name": "countersink",
 | 
						|
        "functionSourceRange": [],
 | 
						|
        "unlabeledArg": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": -2.5,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        },
 | 
						|
        "labeledArgs": {}
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 11
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "startSketchOn",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Solid",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "face": {
 | 
						|
          "value": {
 | 
						|
            "type": "String",
 | 
						|
            "value": "end"
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 10
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBody"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBodyItem",
 | 
						|
            "index": 0
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 0
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "extrude",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Sketch",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "length": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": -0.375,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 10
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBody"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBodyItem",
 | 
						|
            "index": 0
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 2
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "chamfer",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Solid",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "length": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": 0.25,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        },
 | 
						|
        "tags": {
 | 
						|
          "value": {
 | 
						|
            "type": "Array",
 | 
						|
            "value": [
 | 
						|
              {
 | 
						|
                "type": "TagIdentifier",
 | 
						|
                "value": "hole01",
 | 
						|
                "artifact_id": "[uuid]"
 | 
						|
              }
 | 
						|
            ]
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 10
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBody"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBodyItem",
 | 
						|
            "index": 0
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 3
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "GroupEnd"
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "GroupBegin",
 | 
						|
      "group": {
 | 
						|
        "type": "FunctionCall",
 | 
						|
        "name": "countersink",
 | 
						|
        "functionSourceRange": [],
 | 
						|
        "unlabeledArg": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": 2.5,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        },
 | 
						|
        "labeledArgs": {}
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 12
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "startSketchOn",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Solid",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "face": {
 | 
						|
          "value": {
 | 
						|
            "type": "String",
 | 
						|
            "value": "end"
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 10
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBody"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBodyItem",
 | 
						|
            "index": 0
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 0
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "extrude",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Sketch",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "length": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": -0.375,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 10
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBody"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBodyItem",
 | 
						|
            "index": 0
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 2
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "StdLibCall",
 | 
						|
      "name": "chamfer",
 | 
						|
      "unlabeledArg": {
 | 
						|
        "value": {
 | 
						|
          "type": "Solid",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": []
 | 
						|
      },
 | 
						|
      "labeledArgs": {
 | 
						|
        "length": {
 | 
						|
          "value": {
 | 
						|
            "type": "Number",
 | 
						|
            "value": 0.25,
 | 
						|
            "ty": {
 | 
						|
              "type": "Default",
 | 
						|
              "len": {
 | 
						|
                "type": "Inches"
 | 
						|
              },
 | 
						|
              "angle": {
 | 
						|
                "type": "Degrees"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        },
 | 
						|
        "tags": {
 | 
						|
          "value": {
 | 
						|
            "type": "Array",
 | 
						|
            "value": [
 | 
						|
              {
 | 
						|
                "type": "TagIdentifier",
 | 
						|
                "value": "hole01",
 | 
						|
                "artifact_id": "[uuid]"
 | 
						|
              }
 | 
						|
            ]
 | 
						|
          },
 | 
						|
          "sourceRange": []
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "nodePath": {
 | 
						|
        "steps": [
 | 
						|
          {
 | 
						|
            "type": "ProgramBodyItem",
 | 
						|
            "index": 10
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationDeclaration"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "VariableDeclarationInit"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBody"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "FunctionExpressionBodyItem",
 | 
						|
            "index": 0
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "ExpressionStatementExpr"
 | 
						|
          },
 | 
						|
          {
 | 
						|
            "type": "PipeBodyItem",
 | 
						|
            "index": 3
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "sourceRange": []
 | 
						|
    },
 | 
						|
    {
 | 
						|
      "type": "GroupEnd"
 | 
						|
    }
 | 
						|
  ],
 | 
						|
  "std::appearance": [],
 | 
						|
  "std::array": [],
 | 
						|
  "std::math": [],
 | 
						|
  "std::prelude": [],
 | 
						|
  "std::sketch": [],
 | 
						|
  "std::solid": [],
 | 
						|
  "std::sweep": [],
 | 
						|
  "std::transform": [],
 | 
						|
  "std::turns": [],
 | 
						|
  "std::types": [],
 | 
						|
  "std::units": []
 | 
						|
}
 |