Make the function signature less prominent, add an early example to docs

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-06-19 17:08:46 +12:00
parent 6358eed7e4
commit ff1be99351
99 changed files with 2137 additions and 686 deletions

View File

@ -8,16 +8,18 @@ layout: manual
Just like `patternTransform`, but works on 2D sketches not 3D solids.
```kcl
patternTransform2d(
@sketches: [Sketch; 1+],
instances: number(_),
transform: fn(number(_)): { },
useOriginal?: boolean,
): [Sketch; 1+]
// Each instance will be shifted along the X axis.
fn transform(@id) {
return { translate = [4 * id, 0] }
}
// Sketch 4 circles.
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 2)
|> patternTransform2d(instances = 4, transform = transform)
```
### Arguments
| Name | Type | Description | Required |
@ -32,6 +34,17 @@ patternTransform2d(
[`[Sketch; 1+]`](/docs/kcl-std/types/std-types-Sketch)
### Function signature
```kcl
patternTransform2d(
@sketches: [Sketch; 1+],
instances: number(_),
transform: fn(number(_)): { },
useOriginal?: boolean,
): [Sketch; 1+]
```
### Examples
```kcl