Change unit conversion functions to operate on input rather than return a conversion factor (#6181)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-04-08 14:21:23 +12:00
committed by GitHub
parent 6a5b23f848
commit 5b653fb558
39 changed files with 1551 additions and 1452 deletions

View File

@ -267,7 +267,7 @@ description: Artifact commands i-beam.kcl
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 72.00000000000001,
"distance": 72.0,
"faces": null
}
},

View File

@ -1,15 +1,15 @@
```mermaid
flowchart LR
subgraph path2 [Path]
2["Path<br>[462, 500, 0]"]
3["Segment<br>[506, 537, 0]"]
4["Segment<br>[543, 575, 0]"]
5["Segment<br>[581, 631, 0]"]
6["Segment<br>[637, 691, 0]"]
7["Segment<br>[697, 719, 0]"]
2["Path<br>[463, 501, 0]"]
3["Segment<br>[507, 538, 0]"]
4["Segment<br>[544, 576, 0]"]
5["Segment<br>[582, 632, 0]"]
6["Segment<br>[638, 692, 0]"]
7["Segment<br>[698, 720, 0]"]
end
1["Plane<br>[438, 456, 0]"]
8["Sweep Extrusion<br>[773, 801, 0]"]
1["Plane<br>[439, 457, 0]"]
8["Sweep Extrusion<br>[774, 802, 0]"]
1 --- 2
2 --- 3
2 --- 4

View File

@ -18,47 +18,40 @@ description: Result of parsing i-beam.kcl
"type": "Identifier"
},
"init": {
"commentStart": 0,
"end": 0,
"left": {
"commentStart": 0,
"end": 0,
"raw": "6",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"arguments": [],
"callee": {
"abs_path": false,
"arguments": [
{
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "ft",
"start": 0,
"type": "Identifier"
},
"path": [],
"raw": "6",
"start": 0,
"type": "Name"
},
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.0,
"suffix": "None"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "fromFt",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
"type": "Name"
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "VariableDeclarator"

View File

@ -23,7 +23,7 @@ description: Operations executed i-beam.kcl
"length": {
"value": {
"type": "Number",
"value": 72.00000000000001,
"value": 72.0,
"ty": {
"type": "Default",
"len": {

View File

@ -220,7 +220,7 @@ description: Variables in memory after executing i-beam.kcl
"type": "Inches"
}
},
"height": 72.00000000000001,
"height": 72.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {