96 lines
731 KiB
Markdown
96 lines
731 KiB
Markdown
---
|
|
title: "helix"
|
|
excerpt: "Create a helix."
|
|
layout: manual
|
|
---
|
|
|
|
Create a helix.
|
|
|
|
|
|
|
|
```js
|
|
helix(data: HelixData) -> HelixValue
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `data` | [`HelixData`](/docs/kcl/types/HelixData) | Data for a helix. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`HelixValue`](/docs/kcl/types/HelixValue) - A helix.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
// Create a helix around the Z axis.
|
|
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')
|
|
|> circle({ center = [0, 0], radius = 0.5 }, %)
|
|
|> sweep({ path = helixPath }, %)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
// Create a helix around an edge.
|
|
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
|
|
})
|
|
|
|
// Create a spring by sweeping around the helix path.
|
|
springSketch = startSketchOn('XY')
|
|
|> circle({ center = [0, 0], radius = 0.5 }, %)
|
|
|> sweep({ path = helixPath }, %)
|
|
```
|
|
|
|

|
|
|
|
```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]
|
|
}
|
|
}
|
|
})
|
|
|
|
// Create a spring by sweeping around the helix path.
|
|
springSketch = startSketchOn('XY')
|
|
|> circle({ center = [0, 0], radius = 1 }, %)
|
|
|> sweep({ path = helixPath }, %)
|
|
```
|
|
|
|

|
|
|
|
|