Kwargs: startProfileAt (#6424)

Previous:

```
startProfileAt([x, y], %)
startProfileAt([x, y], sketch001)
```

New:
```
startProfile(%, at = [x, y])
startProfile(sketch001, at = [x, y])
```
This commit is contained in:
Adam Chalmers
2025-04-25 16:01:35 -05:00
committed by GitHub
parent 9547e95e9d
commit ffbe20b586
573 changed files with 19805 additions and 16552 deletions

View File

@ -214,13 +214,13 @@ flowchart LR
218[Solid2d]
end
subgraph path220 [Path]
220["Path<br>[2309, 2409, 0]"]
221["Segment<br>[2415, 2442, 0]"]
222["Segment<br>[2448, 2476, 0]"]
223["Segment<br>[2482, 2510, 0]"]
224["Segment<br>[2516, 2632, 0]"]
225["Segment<br>[2638, 2743, 0]"]
226["Segment<br>[2749, 2756, 0]"]
220["Path<br>[2309, 2388, 0]"]
221["Segment<br>[2394, 2421, 0]"]
222["Segment<br>[2427, 2455, 0]"]
223["Segment<br>[2461, 2489, 0]"]
224["Segment<br>[2495, 2611, 0]"]
225["Segment<br>[2617, 2722, 0]"]
226["Segment<br>[2728, 2735, 0]"]
227[Solid2d]
end
1["Plane<br>[168, 185, 0]"]
@ -233,7 +233,7 @@ flowchart LR
11["SweepEdge Adjacent"]
12["Plane<br>[1565, 1582, 0]"]
219["Sweep Extrusion<br>[1834, 1862, 0]"]
228["Sweep Extrusion<br>[2762, 2791, 0]"]
228["Sweep Extrusion<br>[2741, 2770, 0]"]
229[Wall]
230[Wall]
231[Wall]

View File

@ -3053,76 +3053,79 @@ description: Result of parsing import_async.kcl
{
"arguments": [
{
"commentStart": 0,
"elements": [
{
"commentStart": 0,
"computed": false,
"end": 0,
"object": {
"type": "LabeledArg",
"label": {
"commentStart": 0,
"end": 0,
"name": "at",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 0,
"elements": [
{
"commentStart": 0,
"computed": false,
"end": 0,
"name": "xs",
"object": {
"commentStart": 0,
"end": 0,
"name": "xs",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"commentStart": 0,
"end": 0,
"raw": "101",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 101.0,
"suffix": "None"
}
},
"start": 0,
"type": "Identifier",
"type": "Identifier"
"type": "MemberExpression",
"type": "MemberExpression"
},
"property": {
{
"commentStart": 0,
"computed": false,
"end": 0,
"raw": "101",
"object": {
"commentStart": 0,
"end": 0,
"name": "ys",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"commentStart": 0,
"end": 0,
"raw": "101",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 101.0,
"suffix": "None"
}
},
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 101.0,
"suffix": "None"
}
},
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
},
{
"commentStart": 0,
"computed": false,
"end": 0,
"object": {
"commentStart": 0,
"end": 0,
"name": "ys",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"commentStart": 0,
"end": 0,
"raw": "101",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 101.0,
"suffix": "None"
}
},
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"commentStart": 0,
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
"type": "MemberExpression",
"type": "MemberExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
@ -3132,7 +3135,7 @@ description: Result of parsing import_async.kcl
"name": {
"commentStart": 0,
"end": 0,
"name": "startProfileAt",
"name": "startProfile",
"start": 0,
"type": "Identifier"
},
@ -3143,8 +3146,9 @@ description: Result of parsing import_async.kcl
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 0,
@ -4121,148 +4125,151 @@ description: Result of parsing import_async.kcl
{
"arguments": [
{
"commentStart": 0,
"elements": [
{
"commentStart": 0,
"end": 0,
"left": {
"abs_path": false,
"type": "LabeledArg",
"label": {
"commentStart": 0,
"end": 0,
"name": "at",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 0,
"elements": [
{
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "holeRadius",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "*",
"right": {
"arguments": [
{
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "startAngle",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
],
"callee": {
"left": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "cos",
"name": "holeRadius",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 0,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "holeRadius",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "*",
"right": {
"arguments": [
{
"operator": "*",
"right": {
"arguments": [
{
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "startAngle",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
],
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "startAngle",
"name": "cos",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
],
"callee": {
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"commentStart": 0,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "sin",
"name": "holeRadius",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 0,
"end": 0,
"operator": "*",
"right": {
"arguments": [
{
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "startAngle",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
],
"callee": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "sin",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"commentStart": 0,
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
@ -4272,7 +4279,7 @@ description: Result of parsing import_async.kcl
"name": {
"commentStart": 0,
"end": 0,
"name": "startProfileAt",
"name": "startProfile",
"start": 0,
"type": "Identifier"
},
@ -4283,8 +4290,9 @@ description: Result of parsing import_async.kcl
"commentStart": 0,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [

View File

@ -66,7 +66,7 @@ fn rightInvolute(i, sg) {
// Draw gear teeth
start = startSketchOn(XY)
|> startProfileAt([xs[101], ys[101]], %)
|> startProfile(at = [xs[101], ys[101]])
teeth = reduce([0..100], start, leftInvolute)
|> arc(
angleStart = 0,
@ -93,10 +93,7 @@ startAngle = asin(keywayWidth / 2 / holeRadius)
// Sketch the keyway and center hole and extrude
keyWay = startSketchOn(body, face = END)
|> startProfileAt([
holeRadius * cos(startAngle),
holeRadius * sin(startAngle)
], %)
|> startProfile(at = [holeRadius * cos(startAngle), holeRadius * sin(startAngle)])
|> xLine(length = keywayDepth)
|> yLine(length = -keywayWidth)
|> xLine(length = -keywayDepth)

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,7 @@ fn rightInvolute(i, sg) {
// Draw gear teeth
start = startSketchOn(XY)
|> startProfileAt([xs[101], ys[101]], %)
|> startProfile(at = [xs[101], ys[101]])
teeth = reduce([0..100], start, leftInvolute)
|> arc(angleStart = 0, angleEnd = toothAngle, radius = baseDiameter / 2)
|> reduce([1..101], %, rightInvolute)
@ -92,10 +92,10 @@ startAngle = asin(keywayWidth / 2 / holeRadius)
// Sketch the keyway and center hole and extrude
keyWay = startSketchOn(body, face = END)
|> startProfileAt([
|> startProfile(at = [
holeRadius * cos(startAngle),
holeRadius * sin(startAngle)
], %)
])
|> xLine(length = keywayDepth)
|> yLine(length = -keywayWidth)
|> xLine(length = -keywayDepth)