Files
modeling-app/rust/kcl-lib/tests/kcl_samples/pipe-flange-assembly/artifact_graph_flowchart.snap.md
Adam Chalmers 85ccc6900c 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.
2025-05-22 21:25:55 +00:00

15 KiB

flowchart LR
  subgraph path23 [Path]
    23["Path<br>[440, 502, 2]"]
    46["Segment<br>[440, 502, 2]"]
    97[Solid2d]
  end
  subgraph path24 [Path]
    24["Path<br>[640, 700, 2]"]
    47["Segment<br>[640, 700, 2]"]
    80[Solid2d]
  end
  subgraph path25 [Path]
    25["Path<br>[613, 706, 3]"]
    49["Segment<br>[613, 706, 3]"]
    90[Solid2d]
  end
  subgraph path26 [Path]
    26["Path<br>[613, 706, 3]"]
    48["Segment<br>[613, 706, 3]"]
    98[Solid2d]
  end
  subgraph path27 [Path]
    27["Path<br>[935, 990, 3]"]
    51["Segment<br>[935, 990, 3]"]
    84[Solid2d]
  end
  subgraph path28 [Path]
    28["Path<br>[935, 990, 3]"]
    50["Segment<br>[935, 990, 3]"]
    88[Solid2d]
  end
  subgraph path29 [Path]
    29["Path<br>[1220, 1279, 3]"]
    53["Segment<br>[1220, 1279, 3]"]
    83[Solid2d]
  end
  subgraph path30 [Path]
    30["Path<br>[1220, 1279, 3]"]
    52["Segment<br>[1220, 1279, 3]"]
    87[Solid2d]
  end
  subgraph path31 [Path]
    31["Path<br>[1386, 1446, 3]"]
    54["Segment<br>[1386, 1446, 3]"]
    91[Solid2d]
  end
  subgraph path32 [Path]
    32["Path<br>[1386, 1446, 3]"]
    55["Segment<br>[1386, 1446, 3]"]
    95[Solid2d]
  end
  subgraph path33 [Path]
    33["Path<br>[1608, 1661, 3]"]
    56["Segment<br>[1608, 1661, 3]"]
    86[Solid2d]
  end
  subgraph path34 [Path]
    34["Path<br>[1608, 1661, 3]"]
    57["Segment<br>[1608, 1661, 3]"]
    93[Solid2d]
  end
  subgraph path35 [Path]
    35["Path<br>[429, 481, 4]"]
    58["Segment<br>[429, 481, 4]"]
    96[Solid2d]
  end
  subgraph path36 [Path]
    36["Path<br>[619, 671, 4]"]
    59["Segment<br>[619, 671, 4]"]
    99[Solid2d]
  end
  subgraph path37 [Path]
    37["Path<br>[457, 527, 5]"]
    60["Segment<br>[457, 527, 5]"]
    79[Solid2d]
  end
  subgraph path38 [Path]
    38["Path<br>[796, 883, 5]"]
    61["Segment<br>[891, 942, 5]"]
    62["Segment<br>[950, 1001, 5]"]
    63["Segment<br>[1009, 1060, 5]"]
    64["Segment<br>[1068, 1118, 5]"]
    65["Segment<br>[1126, 1176, 5]"]
    66["Segment<br>[1184, 1191, 5]"]
    100[Solid2d]
  end
  subgraph path39 [Path]
    39["Path<br>[1330, 1399, 5]"]
    67["Segment<br>[1330, 1399, 5]"]
    82[Solid2d]
  end
  subgraph path40 [Path]
    40["Path<br>[443, 533, 6]"]
    68["Segment<br>[541, 591, 6]"]
    69["Segment<br>[599, 649, 6]"]
    70["Segment<br>[657, 707, 6]"]
    71["Segment<br>[715, 764, 6]"]
    72["Segment<br>[772, 821, 6]"]
    73["Segment<br>[829, 836, 6]"]
    81[Solid2d]
  end
  subgraph path41 [Path]
    41["Path<br>[985, 1037, 6]"]
    74["Segment<br>[985, 1037, 6]"]
    101[Solid2d]
  end
  subgraph path42 [Path]
    42["Path<br>[343, 401, 7]"]
    75["Segment<br>[343, 401, 7]"]
    89[Solid2d]
  end
  subgraph path43 [Path]
    43["Path<br>[343, 401, 7]"]
    76["Segment<br>[343, 401, 7]"]
    94[Solid2d]
  end
  subgraph path44 [Path]
    44["Path<br>[545, 600, 7]"]
    77["Segment<br>[545, 600, 7]"]
    85[Solid2d]
  end
  subgraph path45 [Path]
    45["Path<br>[545, 600, 7]"]
    78["Segment<br>[545, 600, 7]"]
    92[Solid2d]
  end
  1["Plane<br>[417, 434, 2]"]
  2["Plane<br>[588, 605, 3]"]
  3["Plane<br>[588, 605, 3]"]
  4["Plane<br>[910, 927, 3]"]
  5["Plane<br>[910, 927, 3]"]
  6["Plane<br>[404, 421, 4]"]
  7["Plane<br>[432, 449, 5]"]
  8["Plane<br>[418, 435, 6]"]
  9["Plane<br>[318, 335, 7]"]
  10["Plane<br>[318, 335, 7]"]
  11["StartSketchOnFace<br>[940, 977, 6]"]
  12["StartSketchOnFace<br>[1341, 1378, 3]"]
  13["StartSketchOnFace<br>[502, 537, 7]"]
  14["StartSketchOnFace<br>[502, 537, 7]"]
  15["StartSketchOnFace<br>[1173, 1212, 3]"]
  16["StartSketchOnFace<br>[574, 611, 4]"]
  17["StartSketchOnFace<br>[751, 788, 5]"]
  18["StartSketchOnFace<br>[1562, 1600, 3]"]
  19["StartSketchOnFace<br>[1562, 1600, 3]"]
  20["StartSketchOnFace<br>[1341, 1378, 3]"]
  21["StartSketchOnFace<br>[1287, 1322, 5]"]
  22["StartSketchOnFace<br>[1173, 1212, 3]"]
  102["Sweep Extrusion<br>[508, 544, 2]"]
  103["Sweep Extrusion<br>[706, 743, 2]"]
  104["Sweep Extrusion<br>[1038, 1078, 3]"]
  105["Sweep Extrusion<br>[1038, 1078, 3]"]
  106["Sweep Extrusion<br>[1287, 1324, 3]"]
  107["Sweep Extrusion<br>[1287, 1324, 3]"]
  108["Sweep Extrusion<br>[1454, 1492, 3]"]
  109["Sweep Extrusion<br>[1454, 1492, 3]"]
  110["Sweep Extrusion<br>[1669, 1711, 3]"]
  111["Sweep Extrusion<br>[1669, 1711, 3]"]
  112["Sweep Extrusion<br>[489, 522, 4]"]
  113["Sweep Extrusion<br>[679, 716, 4]"]
  114["Sweep Extrusion<br>[535, 568, 5]"]
  115["Sweep Extrusion<br>[1199, 1239, 5]"]
  116["Sweep Extrusion<br>[1407, 1435, 5]"]
  117["Sweep Extrusion<br>[844, 877, 6]"]
  118["Sweep Extrusion<br>[1045, 1082, 6]"]
  119["Sweep Extrusion<br>[409, 440, 7]"]
  120["Sweep Extrusion<br>[409, 440, 7]"]
  121["Sweep Extrusion<br>[608, 640, 7]"]
  122["Sweep Extrusion<br>[608, 640, 7]"]
  123[Wall]
    %% face_code_ref=Missing NodePath
  124[Wall]
    %% face_code_ref=Missing NodePath
  125[Wall]
    %% face_code_ref=Missing NodePath
  126[Wall]
    %% face_code_ref=Missing NodePath
  127[Wall]
    %% face_code_ref=Missing NodePath
  128[Wall]
    %% face_code_ref=Missing NodePath
  129[Wall]
    %% face_code_ref=Missing NodePath
  130[Wall]
    %% face_code_ref=Missing NodePath
  131[Wall]
    %% face_code_ref=Missing NodePath
  132[Wall]
    %% face_code_ref=Missing NodePath
  133[Wall]
    %% face_code_ref=Missing NodePath
  134[Wall]
    %% face_code_ref=Missing NodePath
  135[Wall]
    %% face_code_ref=Missing NodePath
  136[Wall]
    %% face_code_ref=Missing NodePath
  137[Wall]
    %% face_code_ref=Missing NodePath
  138[Wall]
    %% face_code_ref=Missing NodePath
  139[Wall]
    %% face_code_ref=Missing NodePath
  140[Wall]
    %% face_code_ref=Missing NodePath
  141[Wall]
    %% face_code_ref=Missing NodePath
  142[Wall]
    %% face_code_ref=Missing NodePath
  143[Wall]
    %% face_code_ref=Missing NodePath
  144[Wall]
    %% face_code_ref=Missing NodePath
  145[Wall]
    %% face_code_ref=Missing NodePath
  146[Wall]
    %% face_code_ref=Missing NodePath
  147[Wall]
    %% face_code_ref=Missing NodePath
  148[Wall]
    %% face_code_ref=Missing NodePath
  149[Wall]
    %% face_code_ref=Missing NodePath
  150[Wall]
    %% face_code_ref=Missing NodePath
  151[Wall]
    %% face_code_ref=Missing NodePath
  152[Wall]
    %% face_code_ref=Missing NodePath
  153[Wall]
    %% face_code_ref=Missing NodePath
  154["Cap Start"]
  155["Cap Start"]
    %% face_code_ref=Missing NodePath
  156["Cap Start"]
    %% face_code_ref=Missing NodePath
  157["Cap Start"]
  158["Cap Start"]
    %% face_code_ref=Missing NodePath
  159["Cap Start"]
    %% face_code_ref=Missing NodePath
  160["Cap Start"]
  161["Cap Start"]
    %% face_code_ref=Missing NodePath
  162["Cap Start"]
    %% face_code_ref=Missing NodePath
  163["Cap End"]
  164["Cap End"]
    %% face_code_ref=Missing NodePath
  165["Cap End"]
  166["Cap End"]
  167["Cap End"]
    %% face_code_ref=Missing NodePath
  168["Cap End"]
  169["Cap End"]
  170["Cap End"]
  171["Cap End"]
    %% face_code_ref=Missing NodePath
  172["Cap End"]
  173["Cap End"]
  174["Cap End"]
    %% face_code_ref=Missing NodePath
  175["Cap End"]
  176["SweepEdge Opposite"]
  177["SweepEdge Opposite"]
  178["SweepEdge Opposite"]
  179["SweepEdge Opposite"]
  180["SweepEdge Opposite"]
  181["SweepEdge Opposite"]
  182["SweepEdge Opposite"]
  183["SweepEdge Opposite"]
  184["SweepEdge Opposite"]
  185["SweepEdge Opposite"]
  186["SweepEdge Opposite"]
  187["SweepEdge Opposite"]
  188["SweepEdge Opposite"]
  189["SweepEdge Opposite"]
  190["SweepEdge Opposite"]
  191["SweepEdge Opposite"]
  192["SweepEdge Opposite"]
  193["SweepEdge Opposite"]
  194["SweepEdge Opposite"]
  195["SweepEdge Opposite"]
  196["SweepEdge Opposite"]
  197["SweepEdge Opposite"]
  198["SweepEdge Opposite"]
  199["SweepEdge Opposite"]
  200["SweepEdge Opposite"]
  201["SweepEdge Opposite"]
  202["SweepEdge Opposite"]
  203["SweepEdge Opposite"]
  204["SweepEdge Opposite"]
  205["SweepEdge Opposite"]
  206["SweepEdge Opposite"]
  207["SweepEdge Adjacent"]
  208["SweepEdge Adjacent"]
  209["SweepEdge Adjacent"]
  210["SweepEdge Adjacent"]
  211["SweepEdge Adjacent"]
  212["SweepEdge Adjacent"]
  213["SweepEdge Adjacent"]
  214["SweepEdge Adjacent"]
  215["SweepEdge Adjacent"]
  216["SweepEdge Adjacent"]
  217["SweepEdge Adjacent"]
  218["SweepEdge Adjacent"]
  219["SweepEdge Adjacent"]
  220["SweepEdge Adjacent"]
  221["SweepEdge Adjacent"]
  222["SweepEdge Adjacent"]
  223["SweepEdge Adjacent"]
  224["SweepEdge Adjacent"]
  225["SweepEdge Adjacent"]
  226["SweepEdge Adjacent"]
  227["SweepEdge Adjacent"]
  228["SweepEdge Adjacent"]
  229["SweepEdge Adjacent"]
  230["SweepEdge Adjacent"]
  231["SweepEdge Adjacent"]
  232["SweepEdge Adjacent"]
  233["SweepEdge Adjacent"]
  234["SweepEdge Adjacent"]
  235["SweepEdge Adjacent"]
  236["SweepEdge Adjacent"]
  237["SweepEdge Adjacent"]
  238["EdgeCut Fillet<br>[576, 642, 5]"]
  1 --- 23
  2 --- 26
  3 --- 25
  4 --- 28
  5 --- 27
  6 --- 35
  7 --- 37
  8 --- 40
  9 --- 42
  10 --- 43
  165 x--> 11
  163 x--> 12
  173 x--> 13
  169 x--> 14
  160 x--> 15
  175 x--> 16
  157 x--> 17
  166 x--> 18
  170 x--> 19
  172 x--> 20
  168 x--> 21
  154 x--> 22
  23 --- 46
  23 --- 97
  23 ---- 102
  24 --- 47
  24 --- 80
  24 ---- 103
  164 --- 24
  25 --- 49
  25 --- 90
  26 --- 48
  26 --- 98
  27 --- 51
  27 --- 84
  27 ---- 105
  28 --- 50
  28 --- 88
  28 ---- 104
  29 --- 53
  29 --- 83
  29 ---- 106
  160 --- 29
  30 --- 52
  30 --- 87
  30 ---- 107
  154 --- 30
  31 --- 54
  31 --- 91
  31 ---- 109
  172 --- 31
  32 --- 55
  32 --- 95
  32 ---- 108
  163 --- 32
  33 --- 56
  33 --- 86
  33 ---- 110
  166 --- 33
  34 --- 57
  34 --- 93
  34 ---- 111
  170 --- 34
  35 --- 58
  35 --- 96
  35 ---- 112
  36 --- 59
  36 --- 99
  36 ---- 113
  175 --- 36
  37 --- 60
  37 --- 79
  37 ---- 114
  38 --- 61
  38 --- 62
  38 --- 63
  38 --- 64
  38 --- 65
  38 --- 66
  38 --- 100
  38 ---- 115
  157 --- 38
  39 --- 67
  39 --- 82
  39 ---- 116
  168 --- 39
  40 --- 68
  40 --- 69
  40 --- 70
  40 --- 71
  40 --- 72
  40 --- 73
  40 --- 81
  40 ---- 117
  41 --- 74
  41 --- 101
  41 ---- 118
  165 --- 41
  42 --- 75
  42 --- 89
  42 ---- 119
  43 --- 76
  43 --- 94
  43 ---- 120
  44 --- 77
  44 --- 85
  44 ---- 122
  169 --- 44
  45 --- 78
  45 --- 92
  45 ---- 121
  173 --- 45
  46 --- 135
  46 x--> 155
  46 --- 188
  46 --- 219
  47 --- 134
  47 x--> 164
  47 --- 187
  47 --- 218
  50 --- 127
  50 x--> 154
  50 --- 180
  50 --- 211
  51 --- 128
  51 x--> 160
  51 --- 181
  51 --- 212
  52 --- 124
  52 x--> 154
  52 --- 177
  52 --- 208
  53 --- 123
  53 x--> 160
  53 --- 176
  53 --- 207
  54 --- 153
  54 x--> 172
  54 --- 206
  54 --- 237
  55 --- 138
  55 x--> 163
  55 --- 191
  55 --- 222
  56 --- 137
  56 x--> 166
  56 --- 190
  56 --- 221
  57 --- 152
  57 x--> 170
  57 --- 205
  57 --- 236
  58 --- 131
  58 x--> 162
  58 --- 184
  58 --- 215
  59 --- 130
  59 x--> 175
  59 --- 183
  59 --- 214
  60 --- 132
  60 x--> 168
  60 --- 185
  60 --- 216
  60 --- 238
  61 --- 140
  61 x--> 157
  61 --- 197
  61 --- 228
  62 --- 139
  62 x--> 157
  62 --- 196
  62 --- 227
  63 --- 143
  63 x--> 157
  63 --- 195
  63 --- 226
  64 --- 142
  64 x--> 157
  64 --- 194
  64 --- 225
  65 --- 144
  65 x--> 157
  65 --- 193
  65 --- 224
  66 --- 141
  66 x--> 157
  66 --- 192
  66 --- 223
  67 --- 126
  67 x--> 168
  67 --- 179
  67 --- 210
  68 --- 148
  68 x--> 156
  68 --- 203
  68 --- 234
  69 --- 146
  69 x--> 156
  69 --- 202
  69 --- 233
  70 --- 150
  70 x--> 156
  70 --- 201
  70 --- 232
  71 --- 149
  71 x--> 156
  71 --- 200
  71 --- 231
  72 --- 147
  72 x--> 156
  72 --- 199
  72 --- 230
  73 --- 145
  73 x--> 156
  73 --- 198
  73 --- 229
  74 --- 136
  74 x--> 165
  74 --- 189
  74 --- 220
  75 --- 125
  75 x--> 158
  75 --- 178
  75 --- 209
  76 --- 129
  76 x--> 161
  76 --- 182
  76 --- 213
  77 --- 151
  77 x--> 169
  77 --- 204
  77 --- 235
  78 --- 133
  78 x--> 173
  78 --- 186
  78 --- 217
  102 --- 135
  102 --- 155
  102 --- 164
  102 --- 188
  102 --- 219
  103 --- 134
  103 --- 187
  103 --- 218
  104 --- 127
  104 --- 154
  104 --- 163
  104 --- 180
  104 --- 211
  105 --- 128
  105 --- 160
  105 --- 172
  105 --- 181
  105 --- 212
  106 --- 123
  106 --- 171
  106 --- 176
  106 --- 207
  107 --- 124
  107 --- 174
  107 --- 177
  107 --- 208
  108 --- 138
  108 --- 170
  108 --- 191
  108 --- 222
  109 --- 153
  109 --- 166
  109 --- 206
  109 --- 237
  110 --- 137
  110 --- 190
  110 --- 221
  111 --- 152
  111 --- 205
  111 --- 236
  112 --- 131
  112 --- 162
  112 --- 175
  112 --- 184
  112 --- 215
  113 --- 130
  113 --- 183
  113 --- 214
  114 --- 132
  114 --- 157
  114 --- 168
  114 --- 185
  114 --- 216
  115 --- 139
  115 --- 140
  115 --- 141
  115 --- 142
  115 --- 143
  115 --- 144
  115 --- 159
  115 --- 192
  115 --- 193
  115 --- 194
  115 --- 195
  115 --- 196
  115 --- 197
  115 --- 223
  115 --- 224
  115 --- 225
  115 --- 226
  115 --- 227
  115 --- 228
  116 --- 126
  116 --- 167
  116 --- 179
  116 --- 210
  117 --- 145
  117 --- 146
  117 --- 147
  117 --- 148
  117 --- 149
  117 --- 150
  117 --- 156
  117 --- 165
  117 --- 198
  117 --- 199
  117 --- 200
  117 --- 201
  117 --- 202
  117 --- 203
  117 --- 229
  117 --- 230
  117 --- 231
  117 --- 232
  117 --- 233
  117 --- 234
  118 --- 136
  118 --- 189
  118 --- 220
  119 --- 125
  119 --- 158
  119 --- 169
  119 --- 178
  119 --- 209
  120 --- 129
  120 --- 161
  120 --- 173
  120 --- 182
  120 --- 213
  121 --- 133
  121 --- 186
  121 --- 217
  122 --- 151
  122 --- 204
  122 --- 235
  123 --- 176
  123 --- 207
  124 --- 177
  124 --- 208
  125 --- 178
  125 --- 209
  126 --- 179
  126 --- 210
  127 --- 180
  127 --- 211
  128 --- 181
  128 --- 212
  129 --- 182
  129 --- 213
  130 --- 183
  130 --- 214
  131 --- 184
  131 --- 215
  132 --- 185
  132 --- 216
  133 --- 186
  133 --- 217
  134 --- 187
  134 --- 218
  135 --- 188
  135 --- 219
  136 --- 189
  136 --- 220
  137 --- 190
  137 --- 221
  138 --- 191
  138 --- 222
  139 --- 196
  139 --- 227
  228 <--x 139
  140 --- 197
  223 <--x 140
  140 --- 228
  141 --- 192
  141 --- 223
  224 <--x 141
  142 --- 194
  142 --- 225
  226 <--x 142
  143 --- 195
  143 --- 226
  227 <--x 143
  144 --- 193
  144 --- 224
  225 <--x 144
  145 --- 198
  145 --- 229
  230 <--x 145
  146 --- 202
  146 --- 233
  234 <--x 146
  147 --- 199
  147 --- 230
  231 <--x 147
  148 --- 203
  229 <--x 148
  148 --- 234
  149 --- 200
  149 --- 231
  232 <--x 149
  150 --- 201
  150 --- 232
  233 <--x 150
  151 --- 204
  151 --- 235
  152 --- 205
  152 --- 236
  153 --- 206
  153 --- 237
  187 <--x 155
  189 <--x 156
  185 <--x 157
  204 <--x 158
  192 <--x 159
  193 <--x 159
  194 <--x 159
  195 <--x 159
  196 <--x 159
  197 <--x 159
  186 <--x 161
  183 <--x 162
  180 <--x 163
  188 <--x 164
  198 <--x 165
  199 <--x 165
  200 <--x 165
  201 <--x 165
  202 <--x 165
  203 <--x 165
  206 <--x 166
  179 <--x 167
  178 <--x 169
  191 <--x 170
  176 <--x 171
  190 <--x 171
  181 <--x 172
  182 <--x 173
  177 <--x 174
  205 <--x 174
  184 <--x 175