Change KCL stdlib floating-point results to not be platform dependent (#7499)

* Add libm dependency

* Change to use libm for trig functions

* Remove redactions for floating point

* Update output

* Use clippy to prevent stdlib math sneaking back in

---------

Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
This commit is contained in:
Jonathan Tran
2025-06-16 21:34:50 -04:00
committed by GitHub
parent 1a4a030671
commit 7486d25cf1
433 changed files with 24677 additions and 24672 deletions

View File

@ -246,7 +246,7 @@ description: Artifact commands gear-rack.kcl
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": -49.432,
"x": -49.432328,
"y": 10.875,
"z": 0.0
}
@ -268,8 +268,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "tangential_arc_to",
"to": {
"x": 0.158,
"y": 0.11,
"x": 0.157636,
"y": 0.110378,
"z": 0.0
},
"angle_snap_increment": null
@ -285,8 +285,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "line",
"end": {
"x": 0.329,
"y": 0.904,
"x": 0.329118,
"y": 0.904244,
"z": 0.0
},
"relative": true
@ -302,8 +302,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "tangential_arc_to",
"to": {
"x": 0.158,
"y": 0.11,
"x": 0.157636,
"y": 0.110378,
"z": 0.0
},
"angle_snap_increment": null
@ -319,7 +319,7 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "line",
"end": {
"x": 0.187,
"x": 0.186505,
"y": 0.0,
"z": 0.0
},
@ -336,8 +336,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "tangential_arc_to",
"to": {
"x": 0.158,
"y": -0.11,
"x": 0.157636,
"y": -0.110378,
"z": 0.0
},
"angle_snap_increment": null
@ -353,8 +353,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "line",
"end": {
"x": 0.329,
"y": -0.904,
"x": 0.329118,
"y": -0.904244,
"z": 0.0
},
"relative": true
@ -370,8 +370,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "tangential_arc_to",
"to": {
"x": 0.158,
"y": -0.11,
"x": 0.157636,
"y": -0.110378,
"z": 0.0
},
"angle_snap_increment": null
@ -457,7 +457,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 1.571,
"x": 1.570796,
"y": 0.0,
"z": 0.0
},
@ -486,7 +486,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 3.142,
"x": 3.141592,
"y": 0.0,
"z": 0.0
},
@ -515,7 +515,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 4.712,
"x": 4.712388000000001,
"y": 0.0,
"z": 0.0
},
@ -544,7 +544,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 6.283,
"x": 6.283184,
"y": 0.0,
"z": 0.0
},
@ -573,7 +573,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 7.854,
"x": 7.85398,
"y": 0.0,
"z": 0.0
},
@ -602,7 +602,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 9.425,
"x": 9.424776000000001,
"y": 0.0,
"z": 0.0
},
@ -631,7 +631,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 10.996,
"x": 10.995572000000001,
"y": 0.0,
"z": 0.0
},
@ -660,7 +660,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 12.566,
"x": 12.566368,
"y": 0.0,
"z": 0.0
},
@ -689,7 +689,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 14.137,
"x": 14.137164,
"y": 0.0,
"z": 0.0
},
@ -718,7 +718,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 15.708,
"x": 15.70796,
"y": 0.0,
"z": 0.0
},
@ -747,7 +747,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 17.279,
"x": 17.278756,
"y": 0.0,
"z": 0.0
},
@ -776,7 +776,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 18.85,
"x": 18.849552000000003,
"y": 0.0,
"z": 0.0
},
@ -805,7 +805,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 20.42,
"x": 20.420348,
"y": 0.0,
"z": 0.0
},
@ -834,7 +834,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 21.991,
"x": 21.991144000000002,
"y": 0.0,
"z": 0.0
},
@ -863,7 +863,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 23.562,
"x": 23.56194,
"y": 0.0,
"z": 0.0
},
@ -892,7 +892,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 25.133,
"x": 25.132736,
"y": 0.0,
"z": 0.0
},
@ -921,7 +921,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 26.704,
"x": 26.703532000000003,
"y": 0.0,
"z": 0.0
},
@ -950,7 +950,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 28.274,
"x": 28.274328,
"y": 0.0,
"z": 0.0
},
@ -979,7 +979,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 29.845,
"x": 29.845124000000002,
"y": 0.0,
"z": 0.0
},
@ -1008,7 +1008,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 31.416,
"x": 31.41592,
"y": 0.0,
"z": 0.0
},
@ -1037,7 +1037,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 32.987,
"x": 32.986716,
"y": 0.0,
"z": 0.0
},
@ -1066,7 +1066,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 34.558,
"x": 34.557512,
"y": 0.0,
"z": 0.0
},
@ -1095,7 +1095,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 36.128,
"x": 36.128308000000004,
"y": 0.0,
"z": 0.0
},
@ -1124,7 +1124,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 37.699,
"x": 37.699104000000005,
"y": 0.0,
"z": 0.0
},
@ -1153,7 +1153,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 39.27,
"x": 39.2699,
"y": 0.0,
"z": 0.0
},
@ -1182,7 +1182,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 40.841,
"x": 40.840696,
"y": 0.0,
"z": 0.0
},
@ -1211,7 +1211,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 42.411,
"x": 42.411492,
"y": 0.0,
"z": 0.0
},
@ -1240,7 +1240,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 43.982,
"x": 43.982288000000004,
"y": 0.0,
"z": 0.0
},
@ -1269,7 +1269,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 45.553,
"x": 45.553084000000005,
"y": 0.0,
"z": 0.0
},
@ -1298,7 +1298,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 47.124,
"x": 47.12388,
"y": 0.0,
"z": 0.0
},
@ -1327,7 +1327,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 48.695,
"x": 48.694676,
"y": 0.0,
"z": 0.0
},
@ -1356,7 +1356,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 50.265,
"x": 50.265472,
"y": 0.0,
"z": 0.0
},
@ -1385,7 +1385,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 51.836,
"x": 51.836268000000004,
"y": 0.0,
"z": 0.0
},
@ -1414,7 +1414,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 53.407,
"x": 53.407064000000005,
"y": 0.0,
"z": 0.0
},
@ -1443,7 +1443,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 54.978,
"x": 54.97786,
"y": 0.0,
"z": 0.0
},
@ -1472,7 +1472,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 56.549,
"x": 56.548656,
"y": 0.0,
"z": 0.0
},
@ -1501,7 +1501,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 58.119,
"x": 58.119452,
"y": 0.0,
"z": 0.0
},
@ -1530,7 +1530,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 59.69,
"x": 59.690248000000004,
"y": 0.0,
"z": 0.0
},
@ -1559,7 +1559,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 61.261,
"x": 61.261044000000005,
"y": 0.0,
"z": 0.0
},
@ -1588,7 +1588,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 62.832,
"x": 62.83184,
"y": 0.0,
"z": 0.0
},
@ -1617,7 +1617,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 64.403,
"x": 64.402636,
"y": 0.0,
"z": 0.0
},
@ -1646,7 +1646,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 65.973,
"x": 65.973432,
"y": 0.0,
"z": 0.0
},
@ -1675,7 +1675,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 67.544,
"x": 67.544228,
"y": 0.0,
"z": 0.0
},
@ -1704,7 +1704,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 69.115,
"x": 69.115024,
"y": 0.0,
"z": 0.0
},
@ -1733,7 +1733,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 70.686,
"x": 70.68582,
"y": 0.0,
"z": 0.0
},
@ -1762,7 +1762,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 72.257,
"x": 72.25661600000001,
"y": 0.0,
"z": 0.0
},
@ -1791,7 +1791,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 73.827,
"x": 73.82741200000001,
"y": 0.0,
"z": 0.0
},
@ -1820,7 +1820,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 75.398,
"x": 75.39820800000001,
"y": 0.0,
"z": 0.0
},
@ -1849,7 +1849,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 76.969,
"x": 76.969004,
"y": 0.0,
"z": 0.0
},
@ -1878,7 +1878,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 78.54,
"x": 78.5398,
"y": 0.0,
"z": 0.0
},
@ -1907,7 +1907,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 80.111,
"x": 80.110596,
"y": 0.0,
"z": 0.0
},
@ -1936,7 +1936,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 81.681,
"x": 81.681392,
"y": 0.0,
"z": 0.0
},
@ -1965,7 +1965,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 83.252,
"x": 83.252188,
"y": 0.0,
"z": 0.0
},
@ -1994,7 +1994,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 84.823,
"x": 84.822984,
"y": 0.0,
"z": 0.0
},
@ -2023,7 +2023,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 86.394,
"x": 86.39378,
"y": 0.0,
"z": 0.0
},
@ -2052,7 +2052,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 87.965,
"x": 87.96457600000001,
"y": 0.0,
"z": 0.0
},
@ -2081,7 +2081,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 89.535,
"x": 89.53537200000001,
"y": 0.0,
"z": 0.0
},
@ -2110,7 +2110,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 91.106,
"x": 91.10616800000001,
"y": 0.0,
"z": 0.0
},
@ -2139,7 +2139,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 92.677,
"x": 92.676964,
"y": 0.0,
"z": 0.0
},
@ -2168,7 +2168,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 94.248,
"x": 94.24776,
"y": 0.0,
"z": 0.0
},
@ -2197,7 +2197,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 95.819,
"x": 95.818556,
"y": 0.0,
"z": 0.0
},
@ -2226,7 +2226,7 @@ description: Artifact commands gear-rack.kcl
[
{
"translate": {
"x": 97.389,
"x": 97.389352,
"y": 0.0,
"z": 0.0
},
@ -2311,7 +2311,7 @@ description: Artifact commands gear-rack.kcl
"path": "[uuid]",
"to": {
"x": -50.0,
"y": 11.85,
"y": 11.849525,
"z": 0.0
}
}
@ -2332,8 +2332,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "line",
"end": {
"x": 0.315,
"y": -0.864,
"x": 0.314524,
"y": -0.864147,
"z": 0.0
},
"relative": true
@ -2349,8 +2349,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "tangential_arc_to",
"to": {
"x": 0.158,
"y": -0.11,
"x": 0.157636,
"y": -0.110378,
"z": 0.0
},
"angle_snap_increment": null
@ -2498,7 +2498,7 @@ description: Artifact commands gear-rack.kcl
"path": "[uuid]",
"to": {
"x": 50.0,
"y": 11.85,
"y": 11.849525,
"z": 0.0
}
}
@ -2519,8 +2519,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "line",
"end": {
"x": -0.315,
"y": -0.864,
"x": -0.314524,
"y": -0.864147,
"z": 0.0
},
"relative": true
@ -2536,8 +2536,8 @@ description: Artifact commands gear-rack.kcl
"segment": {
"type": "tangential_arc_to",
"to": {
"x": -0.158,
"y": -0.11,
"x": -0.157636,
"y": -0.110378,
"z": 0.0
},
"angle_snap_increment": null

View File

@ -452,7 +452,7 @@ description: Operations executed gear-rack.kcl
"distance": {
"value": {
"type": "Number",
"value": 1.571,
"value": 1.570796,
"ty": {
"type": "Default",
"len": {
@ -668,7 +668,7 @@ description: Operations executed gear-rack.kcl
"name": "PI",
"value": {
"type": "Number",
"value": 3.142,
"value": 3.141592653589793,
"ty": {
"type": "Unknown"
}
@ -684,7 +684,7 @@ description: Operations executed gear-rack.kcl
"name": "E",
"value": {
"type": "Number",
"value": 2.718,
"value": 2.718281828459045,
"ty": {
"type": "Known",
"type": "Count"
@ -701,7 +701,7 @@ description: Operations executed gear-rack.kcl
"name": "TAU",
"value": {
"type": "Number",
"value": 6.283,
"value": 6.283185307179586,
"ty": {
"type": "Known",
"type": "Count"

File diff suppressed because it is too large Load Diff