kcl-stdfunctionsrectangle

rectangleFunction in std::sketch

Sketch a rectangle.

rectangle(
  @sketchOrSurface: Sketch | Plane | Face,
  width: number(Length),
  height: number(Length),
  center?: Point2d,
  corner?: Point2d,
): Sketch

Arguments

NameTypeDescriptionRequired
sketchOrSurfaceSketch or Plane or FaceSketch to extend, or plane or surface to sketch on.Yes
widthnumber(Length)Rectangle's width along X axis.Yes
heightnumber(Length)Rectangle's height along Y axis.Yes
centerPoint2dThe center of the rectangle. Incompatible with corner.No
cornerPoint2dThe corner of the rectangle. Incompatible with center. This will be the corner which is most negative on both X and Y axes.No

Returns

Sketch - A sketch is a collection of paths.

Examples

exampleSketch = startSketchOn(-XZ)
  |> rectangle(center = [0, 0], width = 10, height = 5)

Rendered example of rectangle 0

exampleSketch = startSketchOn(-XZ)
  |> rectangle(corner = [0, 0], width = 10, height = 5)

Rendered example of rectangle 1

Found a typo?