Files
modeling-app/docs/kcl/patternLinear2d.md
Adam Chalmers 0c478680cb KCL: No 'let' or 'const' required when declaring vars (#4063)
Previously variable declaration required a keyword, e.g.

```kcl
let x = 4
const x = 4
var x = 4
```

These were all valid, and did the exact same thing. As of this PR, they're all still valid, but the KCL formatter will change them all to just:

```kcl
x = 4
```

which is the new preferred way to declare a constant. 

But the formatter will remove the var/let/const keywords.

Closes https://github.com/KittyCAD/modeling-app/issues/3985
2024-10-02 14:19:40 -05:00

63 KiB

title, excerpt, layout
title excerpt layout
patternLinear2d Repeat a 2-dimensional sketch along some dimension, with a dynamic amount manual

Repeat a 2-dimensional sketch along some dimension, with a dynamic amount

of distance between each repetition, some specified number of times.

patternLinear2d(data: LinearPattern2dData, sketch_set: SketchSet) -> [Sketch]

Arguments

Name Type Description Required
data LinearPattern2dData Data for a linear pattern on a 2D sketch. Yes
sketch_set SketchSet A sketch or a group of sketches. Yes

Returns

[Sketch]

Examples

exampleSketch = startSketchOn('XZ')
  |> circle({ center: [0, 0], radius: 1 }, %)
  |> patternLinear2d({
       axis: [1, 0],
       repetitions: 6,
       distance: 4
     }, %)

example = extrude(1, exampleSketch)

Rendered example of patternLinear2d 0