kcl-std → functions → conic

conicFunction in std::sketch

Add a conic section to an existing sketch.

conic(
  @sketch: Sketch,
  interiorAbsolute?: Point2d,
  endAbsolute?: Point2d,
  interior?: Point2d,
  end?: Point2d,
  coefficients?: [number; 6],
  startTangent?: Point2d,
  endTangent?: Point2d,
  tag?: tag,
): Sketch

Arguments

NameTypeDescriptionRequired
sketchSketchWhich sketch should this path be added to?Yes
interiorAbsolutePoint2dAny point between the segment's start and end. Requires endAbsolute. Incompatible with interior or end.No
endAbsolutePoint2dWhere should this segment end? Requires interiorAbsolute. Incompatible with interior or end.No
interiorPoint2dAny point between the segment's start and end. This point is relative to the start point. Requires end. Incompatible with interiorAbsolute or endAbsolute.No
endPoint2dWhere should this segment end? This point is relative to the start point. Requires interior. Incompatible with interiorAbsolute or endAbsolute.No
coefficients[number; 6]The coefficients [a, b, c, d, e, f] of the generic conic equation ax^2 + by^2 + cxy + dx + ey + f = 0. If provided the start and end tangents will be calculated using this equation. Incompatible with startTangent and endTangent.No
startTangentPoint2dThe tangent of the conic section at the start. If not provided the tangent of the previous path segment is used. Incompatible with coefficients.No
endTangentPoint2dThe tangent of the conic section at the end. Incompatible with coefficients.No
tagtagCreate a new tag which refers to this segment.No

Returns

Sketch - A sketch is a collection of paths.

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> conic(
       end = [20, 0],
       endTangent = [1, 1],
       interior = [5, 5],
       startTangent = [0, -1],
     )
  |> close()
example = extrude(exampleSketch, length = 10)

Rendered example of conic 0

Found a typo?