Skip to content

Commit

Permalink
change helix to kw args (#5274)
Browse files Browse the repository at this point in the history
* update

Signed-off-by: Jess Frazelle <[email protected]>

* updates

Signed-off-by: Jess Frazelle <[email protected]>

* remove old file

Signed-off-by: Jess Frazelle <[email protected]>

* updates

Signed-off-by: Jess Frazelle <[email protected]>

---------

Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz authored Feb 5, 2025
1 parent c30b161 commit eb4048c
Show file tree
Hide file tree
Showing 14 changed files with 1,136 additions and 214 deletions.
42 changes: 13 additions & 29 deletions docs/kcl/helix.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ Create a helix.


```js
helix(data: HelixData) -> HelixValue
helix(revolutions: number, angle_start: number, ccw?: bool, radius: number, axis: Axis3dOrEdgeReference, length?: number) -> HelixValue
```


### Arguments

| 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

Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -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]
}
})

Expand Down
Loading

0 comments on commit eb4048c

Please sign in to comment.