* KCL: Show beautiful Miette errors when a KCL example test fails
Background: KCL example tests are generated from the stdlib KCL examples in the `#[stdlib]` macro in derive-docs.
Problem: When these tests fail, they output a really unhelpful error message like Kcl(Semantic(KclErrorDetails { source_ranges: [156, 160, 0], message: "Expected a sketch but found array" } )).
Solution: Use miette. Now the errors highlight the KCL code that failed and show exactly what went wrong, on which line, presenting nice diagnostics that look like cargo/rustc output.
* Update helix snapshots
44 lines
176 KiB
Markdown
44 lines
176 KiB
Markdown
---
|
|
title: "helix"
|
|
excerpt: "Create a helix on a cylinder."
|
|
layout: manual
|
|
---
|
|
|
|
Create a helix on a cylinder.
|
|
|
|
|
|
|
|
```js
|
|
helix(data: HelixData, solid: Solid) -> Solid
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `data` | [`HelixData`](/docs/kcl/types/HelixData) | Data for helices. | Yes |
|
|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`Solid`](/docs/kcl/types/Solid) - An solid is a collection of extrude surfaces.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
part001 = startSketchOn('XY')
|
|
|> circle({ center = [5, 5], radius = 10 }, %)
|
|
|> extrude(10, %)
|
|
|> helix({
|
|
angleStart = 0,
|
|
ccw = true,
|
|
revolutions = 16
|
|
}, %)
|
|
```
|
|
|
|

|
|
|
|
|