Files
modeling-app/docs/kcl/patternLinear3d.md
2025-02-20 19:33:21 +13:00

58 KiB

title, excerpt, layout
title excerpt layout
patternLinear3d Repeat a 3-dimensional solid along a linear path, with a dynamic amount manual

Repeat a 3-dimensional solid along a linear path, with a dynamic amount

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

patternLinear3d(solid_set: SolidSet, instances: integer, distance: number, axis: [number], use_original?: bool) -> [Solid]

Arguments

Name Type Description Required
solid_set SolidSet The solid(s) 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
use_original 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

[Solid]

Examples

exampleSketch = startSketchOn('XZ')
  |> startProfileAt([0, 0], %)
  |> line(end = [0, 2])
  |> line(end = [3, 1])
  |> line(end = [0, -4])
  |> close()

example = extrude(exampleSketch, length = 1)
  |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)

Rendered example of patternLinear3d 0