transform after fillet bug fix (#5882)

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* rotate

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* its not jsut translate

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* its not jsut translate

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-19 12:28:56 -07:00
committed by GitHub
parent d19a7df7e8
commit e7d00f148b
30 changed files with 10177 additions and 9 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Artifact graph flowchart rotate_after_fillet.kcl
extension: md
snapshot_kind: binary
---

View File

@ -0,0 +1,134 @@
```mermaid
flowchart LR
subgraph path2 [Path]
2["Path<br>[347, 417, 0]"]
3["Segment<br>[347, 417, 0]"]
4[Solid2d]
end
subgraph path13 [Path]
13["Path<br>[655, 742, 0]"]
14["Segment<br>[750, 833, 0]"]
15["Segment<br>[841, 924, 0]"]
16["Segment<br>[932, 1015, 0]"]
17["Segment<br>[1023, 1105, 0]"]
18["Segment<br>[1113, 1195, 0]"]
19["Segment<br>[1203, 1210, 0]"]
20[Solid2d]
end
subgraph path41 [Path]
41["Path<br>[1311, 1380, 0]"]
42["Segment<br>[1311, 1380, 0]"]
43[Solid2d]
end
1["Plane<br>[320, 339, 0]"]
5["Sweep Extrusion<br>[425, 458, 0]"]
6[Wall]
7["Cap Start"]
8["Cap End"]
9["SweepEdge Opposite"]
10["SweepEdge Adjacent"]
11["EdgeCut Fillet<br>[466, 532, 0]"]
12["EdgeCut Fillet<br>[466, 532, 0]"]
21["Sweep Extrusion<br>[1218, 1258, 0]"]
22[Wall]
23[Wall]
24[Wall]
25[Wall]
26[Wall]
27[Wall]
28["Cap Start"]
29["SweepEdge Opposite"]
30["SweepEdge Adjacent"]
31["SweepEdge Opposite"]
32["SweepEdge Adjacent"]
33["SweepEdge Opposite"]
34["SweepEdge Adjacent"]
35["SweepEdge Opposite"]
36["SweepEdge Adjacent"]
37["SweepEdge Opposite"]
38["SweepEdge Adjacent"]
39["SweepEdge Opposite"]
40["SweepEdge Adjacent"]
44["Sweep Extrusion<br>[1388, 1416, 0]"]
45[Wall]
46["Cap End"]
47["SweepEdge Opposite"]
48["SweepEdge Adjacent"]
49["EdgeCut Fillet<br>[1424, 1483, 0]"]
50["StartSketchOnFace<br>[615, 647, 0]"]
51["StartSketchOnFace<br>[1273, 1303, 0]"]
1 --- 2
2 --- 3
2 ---- 5
2 --- 4
3 --- 6
3 --- 9
3 --- 10
3 --- 11
5 --- 6
5 --- 7
5 --- 8
5 --- 9
5 --- 10
7 --- 13
8 --- 41
9 <--x 12
13 --- 14
13 --- 15
13 --- 16
13 --- 17
13 --- 18
13 --- 19
13 ---- 21
13 --- 20
14 --- 27
14 --- 39
14 --- 40
15 --- 26
15 --- 37
15 --- 38
16 --- 25
16 --- 35
16 --- 36
17 --- 24
17 --- 33
17 --- 34
18 --- 23
18 --- 31
18 --- 32
19 --- 22
19 --- 29
19 --- 30
21 --- 22
21 --- 23
21 --- 24
21 --- 25
21 --- 26
21 --- 27
21 --- 28
21 --- 29
21 --- 30
21 --- 31
21 --- 32
21 --- 33
21 --- 34
21 --- 35
21 --- 36
21 --- 37
21 --- 38
21 --- 39
21 --- 40
41 --- 42
41 ---- 44
41 --- 43
42 --- 45
42 --- 47
42 --- 48
44 --- 45
44 --- 46
44 --- 47
44 --- 48
47 <--x 49
7 <--x 50
8 <--x 51
```

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
export boltDiameter = 0.625
export boltLength = 2.500
export boltHeadLength = boltDiameter
export boltHeadDiameter = 0.938
export boltHexDrive = 1 / 2
export boltHexFlatLength = boltHexDrive / (2 * cos(toRadians(30)))
export boltThreadLength = 1.75
export fn bolt() {
// Create the head of the cap screw
boltHead = startSketchOn('XZ')
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
|> extrude(length = -boltHeadLength)
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
// Define the sketch of the hex pattern on the screw head
hexPatternSketch = startSketchOn(boltHead, 'start')
|> startProfileAt([
boltHexDrive / 2,
boltHexFlatLength / 2
], %)
|> angledLine({
angle = 270,
length = boltHexFlatLength
}, %)
|> angledLine({
angle = 210,
length = boltHexFlatLength
}, %)
|> angledLine({
angle = 150,
length = boltHexFlatLength
}, %)
|> angledLine({
angle = 90,
length = boltHexFlatLength
}, %)
|> angledLine({
angle = 30,
length = boltHexFlatLength
}, %)
|> close()
|> extrude(length = -boltHeadLength * 0.75)
boltBody = startSketchOn(boltHead, 'end')
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|> extrude(length = boltLength)
|> fillet(radius = .020, tags = [getOppositeEdge(filletEdge)])
|> appearance(color = "#4dd043", metalness = 90, roughness = 90)
return boltBody
}
bolt()
|> rotate(roll = 3.14, pitch = 3.14, yaw = 3.14)
// https://www.mcmaster.com/91251a404/

View File

@ -0,0 +1,390 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Operations executed rotate_after_fillet.kcl
---
[
{
"type": "UserDefinedFunctionCall",
"name": "cos",
"functionSourceRange": [
0,
0,
0
],
"unlabeledArg": null,
"labeledArgs": {},
"sourceRange": [
198,
216,
0
]
},
{
"type": "UserDefinedFunctionReturn"
},
{
"type": "UserDefinedFunctionCall",
"name": "bolt",
"functionSourceRange": [
264,
1573,
0
],
"unlabeledArg": null,
"labeledArgs": {},
"sourceRange": [
1575,
1581,
0
]
},
{
"labeledArgs": {
"data": {
"value": {
"type": "String",
"value": "XZ"
},
"sourceRange": [
334,
338,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
320,
339,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -0.625,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
442,
457,
0
]
}
},
"name": "extrude",
"sourceRange": [
425,
458,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
425,
458,
0
]
}
},
{
"labeledArgs": {
"radius": {
"value": {
"type": "Number",
"value": 0.02,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
482,
487,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "topEdge",
"artifact_id": "[uuid]"
},
{
"type": "Uuid",
"value": "[uuid]"
}
]
},
"sourceRange": [
496,
531,
0
]
}
},
"name": "fillet",
"sourceRange": [
466,
532,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
466,
532,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
629,
637,
0
]
},
"tag": {
"value": {
"type": "String",
"value": "start"
},
"sourceRange": [
639,
646,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
615,
647,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -0.46875,
"ty": {
"type": "Unknown"
}
},
"sourceRange": [
1235,
1257,
0
]
}
},
"name": "extrude",
"sourceRange": [
1218,
1258,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1218,
1258,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1287,
1295,
0
]
},
"tag": {
"value": {
"type": "String",
"value": "end"
},
"sourceRange": [
1297,
1302,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
1273,
1303,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 2.5,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
1405,
1415,
0
]
}
},
"name": "extrude",
"sourceRange": [
1388,
1416,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1388,
1416,
0
]
}
},
{
"labeledArgs": {
"radius": {
"value": {
"type": "Number",
"value": 0.02,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
1440,
1444,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "Uuid",
"value": "[uuid]"
}
]
},
"sourceRange": [
1453,
1482,
0
]
}
},
"name": "fillet",
"sourceRange": [
1424,
1483,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1424,
1483,
0
]
}
},
{
"type": "UserDefinedFunctionReturn"
}
]

View File

@ -0,0 +1,93 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing rotate_after_fillet.kcl
---
{
"bolt": {
"type": "Function"
},
"boltDiameter": {
"type": "Number",
"value": 0.625,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"boltHeadDiameter": {
"type": "Number",
"value": 0.938,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"boltHeadLength": {
"type": "Number",
"value": 0.625,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"boltHexDrive": {
"type": "Number",
"value": 0.5,
"ty": {
"type": "Unknown"
}
},
"boltHexFlatLength": {
"type": "Number",
"value": 0.2887,
"ty": {
"type": "Unknown"
}
},
"boltLength": {
"type": "Number",
"value": 2.5,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"boltThreadLength": {
"type": "Number",
"value": 1.75,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"filletEdge": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "filletEdge"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB