Skip to content

Commit ae9dd62

Browse files
authored
Fix hole::blind diameter on simple holes (#8806)
* Fix hole::blind diameter on simple holes Fixes #8805 * Update test output
1 parent 05d43b2 commit ae9dd62

8 files changed

+214
-290
lines changed

rust/kcl-lib/std/hole.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export fn flat() {
177177
fn drawTop(@partialHoleProfile, body, holeType) {
178178
prof = if holeType.feature == holeTypeSimple {
179179
partialHoleProfile
180-
|> xLine(length = body.diameter)
180+
|> xLine(length = body.diameter / 2)
181181
} else if holeType.feature == holeTypeCounterbore {
182182
lip = (holeType.diameter - body.diameter) / 2
183183
partialHoleProfile

rust/kcl-lib/tests/holes_cube/artifact_commands.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ description: Artifact commands holes_cube.kcl
10691069
"segment": {
10701070
"type": "line",
10711071
"end": {
1072-
"x": 4.0,
1072+
"x": 2.0,
10731073
"y": 0.0,
10741074
"z": 0.0
10751075
},

rust/kcl-lib/tests/holes_cube/artifact_graph_flowchart.snap.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@ flowchart LR
1616
8[Solid2d]
1717
end
1818
subgraph path27 [Path]
19-
27["Path<br>[7981, 8031, 15]"]
20-
28["Segment<br>[8060, 8087, 15]"]
21-
29["Segment<br>[8113, 8154, 15]"]
22-
30["Segment<br>[6266, 6284, 15]"]
23-
31["Segment<br>[6294, 6312, 15]"]
24-
32["Segment<br>[6322, 6368, 15]"]
25-
33["Segment<br>[8222, 8254, 15]"]
26-
34["Segment<br>[8286, 8342, 15]"]
27-
35["Segment<br>[8350, 8357, 15]"]
19+
27["Path<br>[7985, 8035, 15]"]
20+
28["Segment<br>[8064, 8091, 15]"]
21+
29["Segment<br>[8117, 8158, 15]"]
22+
30["Segment<br>[6270, 6288, 15]"]
23+
31["Segment<br>[6298, 6316, 15]"]
24+
32["Segment<br>[6326, 6372, 15]"]
25+
33["Segment<br>[8226, 8258, 15]"]
26+
34["Segment<br>[8290, 8346, 15]"]
27+
35["Segment<br>[8354, 8361, 15]"]
2828
36[Solid2d]
2929
end
3030
subgraph path48 [Path]
31-
48["Path<br>[7981, 8031, 15]"]
32-
49["Segment<br>[8060, 8087, 15]"]
33-
50["Segment<br>[8113, 8154, 15]"]
34-
51["Segment<br>[5653, 5683, 15]"]
35-
52["Segment<br>[5693, 5730, 15]"]
36-
53["Segment<br>[5740, 5771, 15]"]
37-
54["Segment<br>[5781, 5801, 15]"]
38-
55["Segment<br>[8222, 8254, 15]"]
39-
56["Segment<br>[8286, 8342, 15]"]
40-
57["Segment<br>[8350, 8357, 15]"]
31+
48["Path<br>[7985, 8035, 15]"]
32+
49["Segment<br>[8064, 8091, 15]"]
33+
50["Segment<br>[8117, 8158, 15]"]
34+
51["Segment<br>[5657, 5687, 15]"]
35+
52["Segment<br>[5697, 5734, 15]"]
36+
53["Segment<br>[5744, 5775, 15]"]
37+
54["Segment<br>[5785, 5805, 15]"]
38+
55["Segment<br>[8226, 8258, 15]"]
39+
56["Segment<br>[8290, 8346, 15]"]
40+
57["Segment<br>[8354, 8361, 15]"]
4141
58[Solid2d]
4242
end
4343
subgraph path72 [Path]
44-
72["Path<br>[7981, 8031, 15]"]
45-
73["Segment<br>[8060, 8087, 15]"]
46-
74["Segment<br>[8113, 8154, 15]"]
47-
75["Segment<br>[5487, 5516, 15]"]
48-
76["Segment<br>[8222, 8254, 15]"]
49-
77["Segment<br>[8286, 8342, 15]"]
50-
78["Segment<br>[8350, 8357, 15]"]
44+
72["Path<br>[7985, 8035, 15]"]
45+
73["Segment<br>[8064, 8091, 15]"]
46+
74["Segment<br>[8117, 8158, 15]"]
47+
75["Segment<br>[5487, 5520, 15]"]
48+
76["Segment<br>[8226, 8258, 15]"]
49+
77["Segment<br>[8290, 8346, 15]"]
50+
78["Segment<br>[8354, 8361, 15]"]
5151
79[Solid2d]
5252
end
5353
1["Plane<br>[64, 81, 0]"]
@@ -76,9 +76,9 @@ flowchart LR
7676
23["SweepEdge Adjacent"]
7777
24["EdgeCut Fillet<br>[421, 890, 0]"]
7878
%% [ProgramBodyItem { index: 1 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
79-
25["PlaneOfFace<br>[8946, 9049, 15]"]
80-
26["Plane<br>[8946, 9049, 15]"]
81-
37["Sweep RevolveAboutEdge<br>[8637, 8657, 15]"]
79+
25["PlaneOfFace<br>[8950, 9053, 15]"]
80+
26["Plane<br>[8950, 9053, 15]"]
81+
37["Sweep RevolveAboutEdge<br>[8641, 8661, 15]"]
8282
38[Wall]
8383
%% face_code_ref=Missing NodePath
8484
39[Wall]
@@ -90,10 +90,10 @@ flowchart LR
9090
42["SweepEdge Adjacent"]
9191
43["SweepEdge Adjacent"]
9292
44["SweepEdge Adjacent"]
93-
45["CompositeSolid Subtract<br>[12000, 12034, 15]"]
94-
46["PlaneOfFace<br>[8946, 9049, 15]"]
95-
47["Plane<br>[8946, 9049, 15]"]
96-
59["Sweep RevolveAboutEdge<br>[8637, 8657, 15]"]
93+
45["CompositeSolid Subtract<br>[12004, 12038, 15]"]
94+
46["PlaneOfFace<br>[8950, 9053, 15]"]
95+
47["Plane<br>[8950, 9053, 15]"]
96+
59["Sweep RevolveAboutEdge<br>[8641, 8661, 15]"]
9797
60[Wall]
9898
%% face_code_ref=Missing NodePath
9999
61[Wall]
@@ -108,10 +108,10 @@ flowchart LR
108108
66["SweepEdge Adjacent"]
109109
67["SweepEdge Adjacent"]
110110
68["SweepEdge Adjacent"]
111-
69["CompositeSolid Subtract<br>[12000, 12034, 15]"]
112-
70["PlaneOfFace<br>[8946, 9049, 15]"]
113-
71["Plane<br>[8946, 9049, 15]"]
114-
80["Sweep RevolveAboutEdge<br>[8637, 8657, 15]"]
111+
69["CompositeSolid Subtract<br>[12004, 12038, 15]"]
112+
70["PlaneOfFace<br>[8950, 9053, 15]"]
113+
71["Plane<br>[8950, 9053, 15]"]
114+
80["Sweep RevolveAboutEdge<br>[8641, 8661, 15]"]
115115
81[Wall]
116116
%% face_code_ref=Missing NodePath
117117
82[Wall]
@@ -120,10 +120,10 @@ flowchart LR
120120
%% face_code_ref=Missing NodePath
121121
84["SweepEdge Adjacent"]
122122
85["SweepEdge Adjacent"]
123-
86["CompositeSolid Subtract<br>[12000, 12034, 15]"]
124-
87["StartSketchOnPlane<br>[8946, 9049, 15]"]
125-
88["StartSketchOnPlane<br>[8946, 9049, 15]"]
126-
89["StartSketchOnPlane<br>[8946, 9049, 15]"]
123+
86["CompositeSolid Subtract<br>[12004, 12038, 15]"]
124+
87["StartSketchOnPlane<br>[8950, 9053, 15]"]
125+
88["StartSketchOnPlane<br>[8950, 9053, 15]"]
126+
89["StartSketchOnPlane<br>[8950, 9053, 15]"]
127127
1 --- 2
128128
2 --- 3
129129
2 --- 4
2 Bytes
Loading

rust/kcl-lib/tests/outputs/models/serial_test_example_fn_std-hole-drill0_output.gltf

Lines changed: 92 additions & 92 deletions
Large diffs are not rendered by default.

rust/kcl-lib/tests/outputs/models/serial_test_example_fn_std-hole-flat0_output.gltf

Lines changed: 79 additions & 155 deletions
Large diffs are not rendered by default.
-17.1 KB
Loading
-11 KB
Loading

0 commit comments

Comments
 (0)