Files
modeling-app/docs/kcl/patternLinear2d.md
Nick Cameron a8b0e1a771 Use arrays for multiple geometry (#5770)
* Parse [T] instead of T[] for array types

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* homogenous arrays, type coercion, remove solid set and sketch set, etc

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-17 17:57:26 +13:00

64 KiB

title, excerpt, layout
title excerpt layout
patternLinear2d Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of distance between each repetition, some specified number of times. manual

Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of distance between each repetition, some specified number of times.

patternLinear2d(
  sketches: [Sketch],
  instances: integer,
  distance: number,
  axis: [number],
  useOriginal?: bool,
): [Sketch]

Arguments

Name Type Description Required
sketches [Sketch] 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]

Examples

exampleSketch = startSketchOn('XZ')
  |> circle(center = [0, 0], radius = 1)
  |> patternLinear2d(axis = [1, 0], instances = 7, distance = 4)

example = extrude(exampleSketch, length = 1)

Rendered example of patternLinear2d 0