Previously, `xLine`, `xLineTo`, `yLine` and `yLineTo` used positional arguments. Now: - `xLineTo` and `yLineTo` have been removed - `xLine` and `yLine` both use keyword arguments: - `length`, optional (i.e. a relative distance along the X or Y axis) - `endAbsolute` optional (i.e. an absolute point along the X or Y axis) - `tag` optional - Exactly one of `length` or `endAbsolute` must be given. Not both, not neither. For example: ``` // Old way |> xLine(6.04, %) |> yLineTo(20, %, $base) // New way |> xLine(length = 6.04) |> yLine(endAbsolute = 20, tag = $base) ``` This also improves some of the general-purpose keyword arguments code in modeling app's TS codebase.
		
			
				
	
	
		
			396 lines
		
	
	
		
			6.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			396 lines
		
	
	
		
			6.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
---
 | 
						|
source: kcl/src/simulation_tests.rs
 | 
						|
description: Operations executed sketch-on-chamfer-two-times.kcl
 | 
						|
---
 | 
						|
[
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "data": {
 | 
						|
        "value": {
 | 
						|
          "type": "String",
 | 
						|
          "value": "XZ"
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          26,
 | 
						|
          30,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "startSketchOn",
 | 
						|
    "sourceRange": [
 | 
						|
      12,
 | 
						|
      31,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": null
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "length": {
 | 
						|
        "value": {
 | 
						|
          "type": "Number",
 | 
						|
          "value": 100.0,
 | 
						|
          "ty": {
 | 
						|
            "type": "Default",
 | 
						|
            "len": {
 | 
						|
              "type": "Mm"
 | 
						|
            },
 | 
						|
            "angle": {
 | 
						|
              "type": "Degrees"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          482,
 | 
						|
          485,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "extrude",
 | 
						|
    "sourceRange": [
 | 
						|
      454,
 | 
						|
      486,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": {
 | 
						|
      "value": {
 | 
						|
        "type": "Sketch",
 | 
						|
        "value": {
 | 
						|
          "artifactId": "[uuid]"
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "sourceRange": [
 | 
						|
        462,
 | 
						|
        471,
 | 
						|
        0
 | 
						|
      ]
 | 
						|
    }
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "radius": {
 | 
						|
        "value": {
 | 
						|
          "type": "Number",
 | 
						|
          "value": 20.0,
 | 
						|
          "ty": {
 | 
						|
            "type": "Default",
 | 
						|
            "len": {
 | 
						|
              "type": "Mm"
 | 
						|
            },
 | 
						|
            "angle": {
 | 
						|
              "type": "Degrees"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          508,
 | 
						|
          510,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tags": {
 | 
						|
        "value": {
 | 
						|
          "type": "Array",
 | 
						|
          "value": [
 | 
						|
            {
 | 
						|
              "type": "TagIdentifier",
 | 
						|
              "value": "seg01",
 | 
						|
              "artifact_id": "[uuid]"
 | 
						|
            }
 | 
						|
          ]
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          519,
 | 
						|
          526,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "fillet",
 | 
						|
    "sourceRange": [
 | 
						|
      492,
 | 
						|
      527,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": {
 | 
						|
      "value": {
 | 
						|
        "type": "Solid",
 | 
						|
        "value": {
 | 
						|
          "artifactId": "[uuid]"
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "sourceRange": [
 | 
						|
        0,
 | 
						|
        0,
 | 
						|
        0
 | 
						|
      ]
 | 
						|
    }
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "length": {
 | 
						|
        "value": {
 | 
						|
          "type": "Number",
 | 
						|
          "value": 50.0,
 | 
						|
          "ty": {
 | 
						|
            "type": "Default",
 | 
						|
            "len": {
 | 
						|
              "type": "Mm"
 | 
						|
            },
 | 
						|
            "angle": {
 | 
						|
              "type": "Degrees"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          550,
 | 
						|
          552,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tag": {
 | 
						|
        "value": {
 | 
						|
          "type": "TagDeclarator",
 | 
						|
          "name": "seg04"
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          576,
 | 
						|
          582,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tags": {
 | 
						|
        "value": {
 | 
						|
          "type": "Array",
 | 
						|
          "value": [
 | 
						|
            {
 | 
						|
              "type": "TagIdentifier",
 | 
						|
              "value": "seg02",
 | 
						|
              "artifact_id": "[uuid]"
 | 
						|
            }
 | 
						|
          ]
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          561,
 | 
						|
          568,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "chamfer",
 | 
						|
    "sourceRange": [
 | 
						|
      533,
 | 
						|
      583,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": {
 | 
						|
      "value": {
 | 
						|
        "type": "Solid",
 | 
						|
        "value": {
 | 
						|
          "artifactId": "[uuid]"
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "sourceRange": [
 | 
						|
        0,
 | 
						|
        0,
 | 
						|
        0
 | 
						|
      ]
 | 
						|
    }
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "length": {
 | 
						|
        "value": {
 | 
						|
          "type": "Number",
 | 
						|
          "value": 50.0,
 | 
						|
          "ty": {
 | 
						|
            "type": "Default",
 | 
						|
            "len": {
 | 
						|
              "type": "Mm"
 | 
						|
            },
 | 
						|
            "angle": {
 | 
						|
              "type": "Degrees"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          606,
 | 
						|
          608,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tag": {
 | 
						|
        "value": {
 | 
						|
          "type": "TagDeclarator",
 | 
						|
          "name": "seg03"
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          649,
 | 
						|
          655,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tags": {
 | 
						|
        "value": {
 | 
						|
          "type": "Array",
 | 
						|
          "value": [
 | 
						|
            {
 | 
						|
              "type": "Uuid",
 | 
						|
              "value": "[uuid]"
 | 
						|
            }
 | 
						|
          ]
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          617,
 | 
						|
          641,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "chamfer",
 | 
						|
    "sourceRange": [
 | 
						|
      589,
 | 
						|
      656,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": {
 | 
						|
      "value": {
 | 
						|
        "type": "Solid",
 | 
						|
        "value": {
 | 
						|
          "artifactId": "[uuid]"
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "sourceRange": [
 | 
						|
        0,
 | 
						|
        0,
 | 
						|
        0
 | 
						|
      ]
 | 
						|
    }
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "data": {
 | 
						|
        "value": {
 | 
						|
          "type": "Solid",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          684,
 | 
						|
          694,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tag": {
 | 
						|
        "value": {
 | 
						|
          "type": "TagIdentifier",
 | 
						|
          "value": "seg04",
 | 
						|
          "artifact_id": "[uuid]"
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          696,
 | 
						|
          701,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "startSketchOn",
 | 
						|
    "sourceRange": [
 | 
						|
      670,
 | 
						|
      702,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": null
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "data": {
 | 
						|
        "value": {
 | 
						|
          "type": "Solid",
 | 
						|
          "value": {
 | 
						|
            "artifactId": "[uuid]"
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          1132,
 | 
						|
          1142,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "tag": {
 | 
						|
        "value": {
 | 
						|
          "type": "TagIdentifier",
 | 
						|
          "value": "seg03",
 | 
						|
          "artifact_id": "[uuid]"
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          1144,
 | 
						|
          1149,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "startSketchOn",
 | 
						|
    "sourceRange": [
 | 
						|
      1118,
 | 
						|
      1150,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": null
 | 
						|
  },
 | 
						|
  {
 | 
						|
    "labeledArgs": {
 | 
						|
      "length": {
 | 
						|
        "value": {
 | 
						|
          "type": "Number",
 | 
						|
          "value": 50.0,
 | 
						|
          "ty": {
 | 
						|
            "type": "Default",
 | 
						|
            "len": {
 | 
						|
              "type": "Mm"
 | 
						|
            },
 | 
						|
            "angle": {
 | 
						|
              "type": "Degrees"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        },
 | 
						|
        "sourceRange": [
 | 
						|
          1597,
 | 
						|
          1599,
 | 
						|
          0
 | 
						|
        ]
 | 
						|
      }
 | 
						|
    },
 | 
						|
    "name": "extrude",
 | 
						|
    "sourceRange": [
 | 
						|
      1569,
 | 
						|
      1600,
 | 
						|
      0
 | 
						|
    ],
 | 
						|
    "type": "StdLibCall",
 | 
						|
    "unlabeledArg": {
 | 
						|
      "value": {
 | 
						|
        "type": "Sketch",
 | 
						|
        "value": {
 | 
						|
          "artifactId": "[uuid]"
 | 
						|
        }
 | 
						|
      },
 | 
						|
      "sourceRange": [
 | 
						|
        1577,
 | 
						|
        1586,
 | 
						|
        0
 | 
						|
      ]
 | 
						|
    }
 | 
						|
  }
 | 
						|
]
 |