Files
modeling-app/docs/kcl-std/patternCircular2d.md
Adam Chalmers f3e9d110c0 KCL: Default circular pattern rotateDuplicates=true, arcDegrees=360 (#7052)
KCL: Default circular pattern rotateDuplicates=true, arcDeg=360

Seems like most users would want these.
2025-05-19 14:46:00 +12:00

55 KiB

title, subtitle, excerpt, layout
title subtitle excerpt layout
patternCircular2d Function in std::sketch Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained. manual

Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orientation of the solid with respect to the center of the circle is maintained.

patternCircular2d(
  @sketchSet: [Sketch],
  instances: number,
  center: Point2d,
  arcDegrees?: number,
  rotateDuplicates?: bool,
  useOriginal?: bool,
): [Sketch]

Arguments

Name Type Description Required
sketchSet [Sketch] Which sketch(es) to pattern Yes
instances number 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
center Point2d The center about which to make the pattern. This is a 2D vector. Yes
arcDegrees number The arc angle (in degrees) to place the repetitions. Must be greater than 0. Defaults to 360. No
rotateDuplicates bool Whether or not to rotate the duplicates as they are copied. Defaults to true. No
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)
  |> startProfile(at = [.5, 25])
  |> line(end = [0, 5])
  |> line(end = [-1, 0])
  |> line(end = [0, -5])
  |> close()
  |> patternCircular2d(
       center = [0, 0],
       instances = 13,
       arcDegrees = 360,
       rotateDuplicates = true,
     )

example = extrude(exampleSketch, length = 1)

Rendered example of patternCircular2d 0