Overview
/
KCL Standard Library
/
Functions
/
patternLinear2d

patternLinear2dFunction in std::sketch

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

Currently, KCL's type system limitations make the type signature here misleading. This function works with Regions from the new sketch blocks (that use constraint solvers), or the old, deprecated, imperative sketch/profile syntax from older versions of KCL. It does not work as expected with sketch blocks, only with the regions that can be created from sketch blocks. In the following examples, a region is passed into the pattern function, which creates new regions in a pattern. You should not pass a sketch block in.

Arguments

NameTypeDescriptionRequired
sketches[Sketch; 1+]The sketch(es) to duplicate.Yes
instancesnumber(_)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
distancenumber(Length)Distance between each repetition. Also known as 'spacing'.Yes
axisAxis2d or Point2dThe axis of the pattern. A 2D vector.Yes
useOriginalboolIf the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid.No

Returns

[Sketch; 1+]

Examples