Skip to main content

arc

arc() 

Draws a circular segment.

arc((0,0), start: 45deg, stop: 135deg)
arc((0,-0.5), start: 45deg, delta: 90deg, mode: "CLOSE")
arc((0,-1), stop: 135deg, delta: 90deg, mode: "PIE")

Note that two of the three angle arguments (start, stop and delta) must be set. The current position () gets updated to the arc's end coordinate (anchor arc-end).

position:

Position to place the arc at.

start:

Default: auto

The angle at which the arc should start. Remember that 0deg points directly towards the right and 90deg points up.

stop:

Default: auto

The angle at which the arc should stop.

delta:

Default: auto

The change in angle away start or stop.

Styling

Root: arc

radius:

Default: 1

The radius of the arc. An elliptical arc can be created by passing a tuple of numbers where the first element is the x radius and the second element is the y radius.

mode:

Default: "OPEN"

The options are: "OPEN" no additional lines are drawn so just the arc is shown; "CLOSE" a line is drawn from the start to the end of the arc creating a circular segment; "PIE" lines are drawn from the start and end of the arc to the origin creating a circular sector.

update-position:

Default: true

Update the current canvas position to the arc's end point (anchor "arc-end"). This overrides the default of true, that allows chaining of (arc) elements.

Anchors

Supports border and path anchors.

  • arc-start The position at which the arc's curve starts, this is the default.
  • arc-end The position of the arc's curve end.
  • arc-center The midpoint of the arc's curve.
  • center The center of the arc, this position changes depending on if the arc is closed or not.
  • chord-center Center of chord of the arc drawn between the start and end point.
  • origin The origin of the arc's circle.

arc-through

arc-through() 

Draws an arc that passes through three points a, b and c.

Note that all three points must not lie on a straight line, otherwise the function fails.

arc-through((0,1), (1,1), (1,0))

Start position of the arc

Position the arc passes through

End position of the arc

Styling

Root: arc

Uses the same styling as @@arc()

Anchors

For anchors see @@arc().