kcl library referencestdsketchbezierCurve

bezierCurveFunction in std::sketch

Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape.

bezierCurve(
  @sketch: Sketch,
  control1: Point2d,
  control2: Point2d,
  end: Point2d,
  tag?: TagDeclarator,
): Sketch

Arguments

NameTypeDescriptionRequired
sketchSketchWhich sketch should this path be added to?Yes
control1Point2dFirst control point for the cubicYes
control2Point2dSecond control point for the cubicYes
endPoint2dHow far away (along the X and Y axes) should this line go?Yes
tagTagDeclaratorCreate a new tag which refers to this lineNo

Returns

Sketch - A sketch is a collection of paths.

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> line(end = [0, 10])
  |> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
  |> line(endAbsolute = [10, 0])
  |> close()

example = extrude(exampleSketch, length = 10)

Rendered example of bezierCurve 0