Skip to content

Commit 75b13d0

Browse files
adamchalmersfranknoirot
authored andcommitted
Point-and-click mode support for inner faces (#7807)
Quick follow-up to #7805, now you can select inner faces in point-and-click mode. https://github.com/user-attachments/assets/47fe3144-0748-4472-97ba-3d7b64a6fec2
1 parent 6c41c86 commit 75b13d0

File tree

72 files changed

+17919
-14526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+17919
-14526
lines changed
-1 Bytes
Loading

rust/kcl-lib/src/execution/artifact.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,13 @@ fn artifacts_to_update(
987987
let mut new_path = path.clone();
988988
new_path.sweep_id = Some(id);
989989
return_arr.push(Artifact::Path(new_path));
990+
if let Some(inner_path_id) = path.inner_path_id
991+
&& let Some(inner_path_artifact) = artifacts.get(&inner_path_id)
992+
&& let Artifact::Path(mut inner_path_artifact) = inner_path_artifact.clone()
993+
{
994+
inner_path_artifact.sweep_id = Some(id);
995+
return_arr.push(Artifact::Path(inner_path_artifact))
996+
}
990997
}
991998
return Ok(return_arr);
992999
}
@@ -1047,8 +1054,7 @@ fn artifacts_to_update(
10471054
// If the path doesn't have a sweep ID, check if it's a
10481055
// hole.
10491056
if path.outer_path_id.is_some() {
1050-
// This is a hole.
1051-
continue;
1057+
continue; // hole not handled
10521058
}
10531059
return Err(KclError::new_internal(KclErrorDetails::new(
10541060
format!(
@@ -1107,8 +1113,7 @@ fn artifacts_to_update(
11071113
// If the path doesn't have a sweep ID, check if it's a
11081114
// hole.
11091115
if path.outer_path_id.is_some() {
1110-
// This is a hole.
1111-
continue;
1116+
continue; // hole not handled
11121117
}
11131118
return Err(KclError::new_internal(KclErrorDetails::new(
11141119
format!(

rust/kcl-lib/tests/fillet-and-shell/artifact_graph_flowchart.snap.md

Lines changed: 172 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -44,59 +44,59 @@ flowchart LR
4444
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
4545
38[Solid2d]
4646
end
47-
subgraph path46 [Path]
48-
46["Path<br>[1339, 1364, 0]"]
47+
subgraph path49 [Path]
48+
49["Path<br>[1339, 1364, 0]"]
4949
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
5050
end
51-
subgraph path47 [Path]
52-
47["Path<br>[1372, 1409, 0]"]
51+
subgraph path50 [Path]
52+
50["Path<br>[1372, 1409, 0]"]
5353
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
54-
48["Segment<br>[1372, 1409, 0]"]
54+
51["Segment<br>[1372, 1409, 0]"]
5555
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
56-
49[Solid2d]
56+
52[Solid2d]
5757
end
58-
subgraph path50 [Path]
59-
50["Path<br>[1435, 1473, 0]"]
58+
subgraph path53 [Path]
59+
53["Path<br>[1435, 1473, 0]"]
6060
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
61-
51["Segment<br>[1435, 1473, 0]"]
61+
54["Segment<br>[1435, 1473, 0]"]
6262
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
63-
52[Solid2d]
63+
55[Solid2d]
6464
end
65-
subgraph path60 [Path]
66-
60["Path<br>[1339, 1364, 0]"]
65+
subgraph path66 [Path]
66+
66["Path<br>[1339, 1364, 0]"]
6767
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
6868
end
69-
subgraph path61 [Path]
70-
61["Path<br>[1372, 1409, 0]"]
69+
subgraph path67 [Path]
70+
67["Path<br>[1372, 1409, 0]"]
7171
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
72-
62["Segment<br>[1372, 1409, 0]"]
72+
68["Segment<br>[1372, 1409, 0]"]
7373
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
74-
63[Solid2d]
74+
69[Solid2d]
7575
end
76-
subgraph path64 [Path]
77-
64["Path<br>[1435, 1473, 0]"]
76+
subgraph path70 [Path]
77+
70["Path<br>[1435, 1473, 0]"]
7878
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
79-
65["Segment<br>[1435, 1473, 0]"]
79+
71["Segment<br>[1435, 1473, 0]"]
8080
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
81-
66[Solid2d]
81+
72[Solid2d]
8282
end
83-
subgraph path74 [Path]
84-
74["Path<br>[1339, 1364, 0]"]
83+
subgraph path83 [Path]
84+
83["Path<br>[1339, 1364, 0]"]
8585
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
8686
end
87-
subgraph path75 [Path]
88-
75["Path<br>[1372, 1409, 0]"]
87+
subgraph path84 [Path]
88+
84["Path<br>[1372, 1409, 0]"]
8989
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
90-
76["Segment<br>[1372, 1409, 0]"]
90+
85["Segment<br>[1372, 1409, 0]"]
9191
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
92-
77[Solid2d]
92+
86[Solid2d]
9393
end
94-
subgraph path78 [Path]
95-
78["Path<br>[1435, 1473, 0]"]
94+
subgraph path87 [Path]
95+
87["Path<br>[1435, 1473, 0]"]
9696
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
97-
79["Segment<br>[1435, 1473, 0]"]
97+
88["Segment<br>[1435, 1473, 0]"]
9898
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
99-
80[Solid2d]
99+
89[Solid2d]
100100
end
101101
1["Plane<br>[373, 390, 0]"]
102102
%% [ProgramBodyItem { index: 16 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
@@ -132,48 +132,64 @@ flowchart LR
132132
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
133133
40[Wall]
134134
%% face_code_ref=Missing NodePath
135-
41["Cap Start"]
135+
41[Wall]
136136
%% face_code_ref=Missing NodePath
137-
42["Cap End"]
137+
42["Cap Start"]
138138
%% face_code_ref=Missing NodePath
139-
43["SweepEdge Opposite"]
140-
44["SweepEdge Adjacent"]
141-
45["Plane<br>[1314, 1331, 0]"]
139+
43["Cap End"]
140+
%% face_code_ref=Missing NodePath
141+
44["SweepEdge Opposite"]
142+
45["SweepEdge Adjacent"]
143+
46["SweepEdge Opposite"]
144+
47["SweepEdge Adjacent"]
145+
48["Plane<br>[1314, 1331, 0]"]
142146
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
143-
53["Sweep Extrusion<br>[1482, 1506, 0]"]
147+
56["Sweep Extrusion<br>[1482, 1506, 0]"]
144148
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
145-
54[Wall]
149+
57[Wall]
150+
%% face_code_ref=Missing NodePath
151+
58[Wall]
146152
%% face_code_ref=Missing NodePath
147-
55["Cap Start"]
153+
59["Cap Start"]
148154
%% face_code_ref=Missing NodePath
149-
56["Cap End"]
155+
60["Cap End"]
150156
%% face_code_ref=Missing NodePath
151-
57["SweepEdge Opposite"]
152-
58["SweepEdge Adjacent"]
153-
59["Plane<br>[1314, 1331, 0]"]
157+
61["SweepEdge Opposite"]
158+
62["SweepEdge Adjacent"]
159+
63["SweepEdge Opposite"]
160+
64["SweepEdge Adjacent"]
161+
65["Plane<br>[1314, 1331, 0]"]
154162
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
155-
67["Sweep Extrusion<br>[1482, 1506, 0]"]
163+
73["Sweep Extrusion<br>[1482, 1506, 0]"]
156164
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
157-
68[Wall]
165+
74[Wall]
158166
%% face_code_ref=Missing NodePath
159-
69["Cap Start"]
167+
75[Wall]
160168
%% face_code_ref=Missing NodePath
161-
70["Cap End"]
169+
76["Cap Start"]
162170
%% face_code_ref=Missing NodePath
163-
71["SweepEdge Opposite"]
164-
72["SweepEdge Adjacent"]
165-
73["Plane<br>[1314, 1331, 0]"]
171+
77["Cap End"]
172+
%% face_code_ref=Missing NodePath
173+
78["SweepEdge Opposite"]
174+
79["SweepEdge Adjacent"]
175+
80["SweepEdge Opposite"]
176+
81["SweepEdge Adjacent"]
177+
82["Plane<br>[1314, 1331, 0]"]
166178
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
167-
81["Sweep Extrusion<br>[1482, 1506, 0]"]
179+
90["Sweep Extrusion<br>[1482, 1506, 0]"]
168180
%% [ProgramBodyItem { index: 18 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
169-
82[Wall]
181+
91[Wall]
182+
%% face_code_ref=Missing NodePath
183+
92[Wall]
170184
%% face_code_ref=Missing NodePath
171-
83["Cap Start"]
185+
93["Cap Start"]
172186
%% face_code_ref=Missing NodePath
173-
84["Cap End"]
187+
94["Cap End"]
174188
%% face_code_ref=Missing NodePath
175-
85["SweepEdge Opposite"]
176-
86["SweepEdge Adjacent"]
189+
95["SweepEdge Opposite"]
190+
96["SweepEdge Adjacent"]
191+
97["SweepEdge Opposite"]
192+
98["SweepEdge Adjacent"]
177193
1 --- 2
178194
2 --- 3
179195
2 --- 4
@@ -242,80 +258,124 @@ flowchart LR
242258
36 --- 33
243259
33 ---- 39
244260
34 --- 40
245-
34 x--> 41
246-
34 --- 43
261+
34 x--> 42
247262
34 --- 44
263+
34 --- 45
248264
36 --- 37
249265
36 --- 38
266+
36 x---> 39
267+
37 --- 41
268+
37 x--> 42
269+
37 --- 46
270+
37 --- 47
250271
39 --- 40
251272
39 --- 41
252273
39 --- 42
253274
39 --- 43
254275
39 --- 44
255-
40 --- 43
276+
39 --- 45
277+
39 --- 46
278+
39 --- 47
256279
40 --- 44
257-
43 <--x 42
258-
45 --- 46
259-
45 --- 47
260-
45 --- 50
261-
47 --- 48
262-
47 --- 49
263-
50 --- 47
264-
47 ---- 53
265-
48 --- 54
266-
48 x--> 55
267-
48 --- 57
268-
48 --- 58
280+
40 --- 45
281+
41 --- 46
282+
41 --- 47
283+
44 <--x 43
284+
46 <--x 43
285+
48 --- 49
286+
48 --- 50
287+
48 --- 53
269288
50 --- 51
270289
50 --- 52
290+
53 --- 50
291+
50 ---- 56
292+
51 --- 57
293+
51 x--> 59
294+
51 --- 61
295+
51 --- 62
271296
53 --- 54
272297
53 --- 55
273-
53 --- 56
274-
53 --- 57
275-
53 --- 58
276-
54 --- 57
298+
53 x---> 56
277299
54 --- 58
278-
57 <--x 56
279-
59 --- 60
280-
59 --- 61
281-
59 --- 64
282-
61 --- 62
283-
61 --- 63
284-
64 --- 61
285-
61 ---- 67
286-
62 --- 68
287-
62 x--> 69
288-
62 --- 71
289-
62 --- 72
290-
64 --- 65
291-
64 --- 66
300+
54 x--> 59
301+
54 --- 63
302+
54 --- 64
303+
56 --- 57
304+
56 --- 58
305+
56 --- 59
306+
56 --- 60
307+
56 --- 61
308+
56 --- 62
309+
56 --- 63
310+
56 --- 64
311+
57 --- 61
312+
57 --- 62
313+
58 --- 63
314+
58 --- 64
315+
61 <--x 60
316+
63 <--x 60
317+
65 --- 66
318+
65 --- 67
319+
65 --- 70
292320
67 --- 68
293321
67 --- 69
294-
67 --- 70
295-
67 --- 71
296-
67 --- 72
297-
68 --- 71
298-
68 --- 72
299-
71 <--x 70
322+
70 --- 67
323+
67 ---- 73
324+
68 --- 74
325+
68 x--> 76
326+
68 --- 78
327+
68 --- 79
328+
70 --- 71
329+
70 --- 72
330+
70 x---> 73
331+
71 --- 75
332+
71 x--> 76
333+
71 --- 80
334+
71 --- 81
300335
73 --- 74
301336
73 --- 75
337+
73 --- 76
338+
73 --- 77
302339
73 --- 78
303-
75 --- 76
304-
75 --- 77
305-
78 --- 75
306-
75 ---- 81
307-
76 --- 82
308-
76 x--> 83
309-
76 --- 85
310-
76 --- 86
311-
78 --- 79
312-
78 --- 80
313-
81 --- 82
314-
81 --- 83
315-
81 --- 84
316-
81 --- 85
317-
81 --- 86
318-
82 --- 85
319-
82 --- 86
320-
85 <--x 84
340+
73 --- 79
341+
73 --- 80
342+
73 --- 81
343+
74 --- 78
344+
74 --- 79
345+
75 --- 80
346+
75 --- 81
347+
78 <--x 77
348+
80 <--x 77
349+
82 --- 83
350+
82 --- 84
351+
82 --- 87
352+
84 --- 85
353+
84 --- 86
354+
87 --- 84
355+
84 ---- 90
356+
85 --- 91
357+
85 x--> 93
358+
85 --- 95
359+
85 --- 96
360+
87 --- 88
361+
87 --- 89
362+
87 x---> 90
363+
88 --- 92
364+
88 x--> 93
365+
88 --- 97
366+
88 --- 98
367+
90 --- 91
368+
90 --- 92
369+
90 --- 93
370+
90 --- 94
371+
90 --- 95
372+
90 --- 96
373+
90 --- 97
374+
90 --- 98
375+
91 --- 95
376+
91 --- 96
377+
92 --- 97
378+
92 --- 98
379+
95 <--x 94
380+
97 <--x 94
321381
```

0 commit comments

Comments
 (0)