Do multiple chamfer/fillet in one API call (#6750)

KCL's `fillet` function takes an array of edges to fillet. Previously this would do `n` fillet API commands, one per edge. This PR combines them all into one call, which should improve performance. You can see the effect in the  artifact_commands snapshots, e.g. `rust/kcl-lib/tests/kcl_samples/axial-fan/artifact_commands.snap` 

Besides performance, this should fix a bug where some KCL fillets would fail, when they should have succeeded. Example from @max-mrgrsk:

```kcl
sketch001 = startSketchOn(XY)
  |> startProfile(at = [-12, -6])
  |> line(end = [0, 12], tag = $seg04)
  |> line(end = [24, 0], tag = $seg03)
  |> line(end = [0, -12], tag = $seg02)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01)
  |> close()
extrude001 = extrude(
       sketch001,
       length = 12,
       tagEnd = $capEnd001,
       tagStart = $capStart001,
     )
  |> fillet(
       radius = 5,
       tags = [
         getCommonEdge(faces = [seg02, capEnd001]),
         getCommonEdge(faces = [seg01, capEnd001]),
         getCommonEdge(faces = [seg03, capEnd001]),
         getCommonEdge(faces = [seg04, capEnd001])
       ],
     )
```

This program fails on main, but succeeds on this branch.
This commit is contained in:
Adam Chalmers
2025-05-22 16:25:55 -05:00
committed by GitHub
parent 4e2deca5d8
commit 85ccc6900c
58 changed files with 419 additions and 2499 deletions

View File

@ -198,30 +198,16 @@ description: Artifact commands socket-head-cap-screw.kcl
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"[uuid]",
"[uuid]"
],
"radius": 0.508,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "solid3d_fillet_edge",
"object_id": "[uuid]",
"edge_id": null,
"edge_ids": [
"extra_face_ids": [
"[uuid]"
],
"radius": 0.508,
"tolerance": 0.0000001,
"cut_type": "fillet",
"strategy": "automatic",
"extra_face_ids": []
]
}
},
{

View File

@ -85,9 +85,7 @@ flowchart LR
48["SweepEdge Adjacent"]
49["EdgeCut Fillet<br>[798, 864, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
50["EdgeCut Fillet<br>[798, 864, 0]"]
%% [ProgramBodyItem { index: 6 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
51["EdgeCut Fillet<br>[1571, 1630, 0]"]
50["EdgeCut Fillet<br>[1571, 1630, 0]"]
%% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
1 --- 4
29 x--> 2
@ -112,7 +110,7 @@ flowchart LR
7 x--> 31
7 --- 40
7 --- 48
7 --- 50
7 --- 49
8 --- 26
8 x--> 29
8 --- 39
@ -199,6 +197,5 @@ flowchart LR
38 <--x 30
39 <--x 30
33 <--x 32
33 <--x 51
40 <--x 49
33 <--x 50
```