kcl

patternTransform2d

Just like patternTransform, but works on 2D sketches not 3D solids.

patternTransform2d(total_instances: u32, transform_function: FunctionParam, solid_set: SketchSet) -> [Sketch]

Arguments

NameTypeDescriptionRequired
total_instancesu32Yes
transform_functionFunctionParamYes
solid_setSketchSetA sketch or a group of sketches.Yes

Returns

[Sketch]

Examples

// 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(4, transform, %)

Rendered example of patternTransform2d 0