* rust side of circle args Signed-off-by: Jess Frazelle <github@jessfraz.com> * change circle in all test js files Signed-off-by: Jess Frazelle <github@jessfraz.com> * more js side Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> * ud[ates Signed-off-by: Jess Frazelle <github@jessfraz.com> * ud[ates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
50 lines
64 KiB
Markdown
50 lines
64 KiB
Markdown
---
|
|
title: "patternLinear2d"
|
|
excerpt: "Repeat a 2-dimensional sketch along some dimension, with a dynamic amount"
|
|
layout: manual
|
|
---
|
|
|
|
Repeat a 2-dimensional sketch along some dimension, with a dynamic amount
|
|
|
|
of distance between each repetition, some specified number of times.
|
|
|
|
```js
|
|
patternLinear2d(
|
|
sketchSet: SketchSet,
|
|
instances: integer,
|
|
distance: number,
|
|
axis: [number],
|
|
useOriginal?: bool,
|
|
) -> [Sketch]
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | The sketch(es) to duplicate | Yes |
|
|
| `instances` | `integer` | The number of total instances. Must be greater than or equal to 1. This includes the original entity. For example, if instances is 2, there will be two copies -- the original, and one new copy. If instances is 1, this has no effect. | Yes |
|
|
| `distance` | `number` | Distance between each repetition. Also known as 'spacing'. | Yes |
|
|
| `axis` | `[number]` | The axis of the pattern. A 2D vector. | Yes |
|
|
| `useOriginal` | `bool` | If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. Defaults to false. | No |
|
|
|
|
### Returns
|
|
|
|
[`[Sketch]`](/docs/kcl/types/Sketch)
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
exampleSketch = startSketchOn('XZ')
|
|
|> circle(center = [0, 0], radius = 1)
|
|
|> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)
|
|
|
|
example = extrude(exampleSketch, length = 1)
|
|
```
|
|
|
|

|
|
|
|
|