change helix to kw args (#5274)

* update

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

* updates

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

* remove old file

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

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-02-05 15:58:32 -08:00
committed by GitHub
parent c30b161e95
commit eb4048cd16
14 changed files with 1147 additions and 225 deletions

View File

@ -9,7 +9,7 @@ Create a helix.
```js
helix(data: HelixData) -> HelixValue
helix(revolutions: number, angle_start: number, ccw?: bool, radius: number, axis: Axis3dOrEdgeReference, length?: number) -> HelixValue
```
@ -17,7 +17,12 @@ helix(data: HelixData) -> HelixValue
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`HelixData`](/docs/kcl/types/HelixData) | Data for a helix. | Yes |
| `revolutions` | `number` | Number of revolutions. | Yes |
| `angle_start` | `number` | Start angle (in degrees). | Yes |
| `ccw` | `bool` | Is the helix rotation counter clockwise? The default is `false`. | No |
| `radius` | `number` | Radius of the helix. | Yes |
| `axis` | [`Axis3dOrEdgeReference`](/docs/kcl/types/Axis3dOrEdgeReference) | Axis to use for the helix. | Yes |
| `length` | `number` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
### Returns
@ -28,14 +33,7 @@ helix(data: HelixData) -> HelixValue
```js
// Create a helix around the Z axis.
helixPath = helix({
angleStart = 0,
ccw = true,
revolutions = 5,
length = 10,
radius = 5,
axis = 'Z'
})
helixPath = helix(angleStart = 0, ccw = true, revolutions = 5, length = 10, radius = 5, axis = 'Z')
// Create a spring by sweeping around the helix path.
springSketch = startSketchOn('YZ')
@ -51,14 +49,7 @@ helper001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line(end = [0, 10], tag = $edge001)
helixPath = helix({
angleStart = 0,
ccw = true,
revolutions = 5,
length = 10,
radius = 5,
axis = edge001
})
helixPath = helix(angleStart = 0, ccw = true, revolutions = 5, length = 10, radius = 5, axis = edge001)
// Create a spring by sweeping around the helix path.
springSketch = startSketchOn('XY')
@ -70,17 +61,10 @@ springSketch = startSketchOn('XY')
```js
// Create a helix around a custom axis.
helixPath = helix({
angleStart = 0,
ccw = true,
revolutions = 5,
length = 10,
radius = 5,
axis = {
custom = {
axis = [0, 0, 1.0],
origin = [0, 0.25, 0]
}
helixPath = helix(angleStart = 0, ccw = true, revolutions = 5, length = 10, radius = 5, axis = {
custom = {
axis = [0, 0, 1.0],
origin = [0, 0.25, 0]
}
})

File diff suppressed because it is too large Load Diff

View File

@ -57,14 +57,7 @@ sweepSketch = startSketchOn('XY')
// Create a helix around the Z axis.
helixPath = helix({
angleStart = 0,
ccw = true,
revolutions = 4,
length = 10,
radius = 5,
axis = 'Z'
})
helixPath = helix(angleStart = 0, ccw = true, revolutions = 4, length = 10, radius = 5, axis = 'Z')
// Create a spring by sweeping around the helix path.
springSketch = startSketchOn('YZ')

View File

@ -1,26 +0,0 @@
---
title: "HelixData"
excerpt: "Data for a helix."
layout: manual
---
Data for a helix.
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `revolutions` |`number`| Number of revolutions. | No |
| `angleStart` |`number`| Start angle (in degrees). | No |
| `ccw` |`boolean`| Is the helix rotation counter clockwise? The default is `false`. | No |
| `length` |`number`| Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `radius` |`number`| Radius of the helix. | No |
| `axis` |[`Axis3dOrEdgeReference`](/docs/kcl/types/Axis3dOrEdgeReference)| Axis to use as mirror. | No |