Icons & Vector

The pen and paths

A path is an outline that goes through a list of anchors. Between two anchors it runs straight, or bends by the handles the anchors carry. The pen puts anchors down one at a time. Everything you cannot make from a rectangle or an ellipse is a path: an icon, a logo, a ribbon, the hill behind a HUD.

An open path of five anchors, two of them smooth
An open path of five anchors, two of them smooth

Draw with the pen#

By hand
  1. Press P for the Pen. Its strip at the top left of the canvas sets the line's color, its width (1, 2, 4 or 8) and its opacity.
  2. Click to put down a corner anchor. A line runs from the last anchor to the pointer, so you see the next piece before you place it.
  3. Press and drag to put down a smooth anchor: the drag pulls out its handles and bends the outline through it.
  4. To close the path, click the first anchor. Its mark grows as the pointer comes near. A closed path is filled.
  5. To leave the path open, press Return or double-click.

The whole path is one step to undo. Nothing is in the document until the first anchor is down.

Anchors and handles#

Double-click a path with the Move tool (V) to edit its points. The anchors are drawn over it.

ToDo this
Select an anchorClick it. ⇧ adds to the selection or takes out. Drag on empty space for a marquee
Move anchorsDrag a selected one. ⇧ keeps the move to one axis
Bend the outlineDrag a handle of a selected anchor. The other handle stays opposite, so the curve stays smooth
Break a smooth anchorHold ⌥ while you drag one handle. The other stays where it is
Add an anchorClick on the outline. The outline does not change shape
Turn a corner into a bend, or backDouble-click the anchor
Remove anchorsSelect them and press Delete
LeavePress Esc, or click away from the path

Double-click a rectangle or an ellipse and it shows its points too. It stays a rectangle or an ellipse until you change one of them, and then becomes a path.

Use as few anchors as the shape allows. A curve with an anchor at each end and one at each extreme is smooth. A curve with ten anchors has ten places to go lumpy.

Round corners without redrawing#

A corner between two straight pieces can be rounded by a number, and the anchor stays where it is. You can change the number later or take it away. This is better than drawing the curve by hand: the corner stays a true arc, and the path keeps its simple points.

Five anchors: sharp, with two radii, and left open
Five anchors: sharp, with two radii, and left open
By hand
  1. Select the path. The bar of vector actions appears at the top left of the canvas.
  2. Click Radius, type a number and press Return. Every corner of the path is rounded.
  3. To round only some corners, double-click the path, select those anchors, and type the Radius then.

Radius says Mixed where the corners differ. Type 0 to take the rounding away. A corner is rounded by no more than half the shorter of its two sides.

Open and closed paths#

  • A closed path ends where it began. It has an inside, so it takes a fill, and its last corner is joined like the others.
  • An open path has two ends. It is a line: give it a stroke and no fill. How its ends are drawn is the stroke's Ends: Butt, Round or Square.

An open path whose two ends almost meet looks closed until the stroke gets thick, and then shows a notch. Close it properly: the agent's check_icon reports such a path.

Paths through the tools: points and path#

An agent gives a path in one of two ways.

PropertyWhat it isUse it when
pointsA list of anchors, as the pen puts them down. Each has x and y, and may have in and out (its handles, as [dx, dy] from the anchor) and radius (its corner). closed: true joins the last to the firstThe shape is one outline. It is easier to get exactly right, and its corners stay corners
pathSVG path data, the d of a <path>, such as M2 12 L9 19 L22 5You already have SVG data, or the shape has several outlines, such as a ring

Coordinates are relative to the node's x and y. For a smooth anchor, in is out turned around.

With an agent

Describe the shape by its corners and say which to round.

Draw a price tag, 160 × 100, pointing right: a rectangle whose right side comes
to a point. Round the two left corners by 16 and the point by 10. Fill #5B5BF0.

The agent calls create_nodes with:

{
  "nodes": [
    {
      "kind": "path",
      "name": "Tag",
      "x": 0,
      "y": 300,
      "points": [
        { "x": 0, "y": 0, "radius": 16 },
        { "x": 110, "y": 0 },
        { "x": 160, "y": 50, "radius": 10 },
        { "x": 110, "y": 100 },
        { "x": 0, "y": 100, "radius": 16 }
      ],
      "closed": true,
      "fills": ["#5B5BF0"]
    }
  ]
}

To change the corners later, the agent sets corner_radii on the path with update_nodes: one number for every corner, or a list with one for each anchor.

{
  "changes": [
    { "id": "7:29", "corner_radii": [16, 0, 10, 0, 16] }
  ]
}

A curve is given by handles. This open path is a wave through three anchors:

{
  "nodes": [
    {
      "kind": "path",
      "name": "Wave",
      "x": 400,
      "y": 0,
      "points": [
        { "x": 0, "y": 20, "out": [10, -20] },
        { "x": 40, "y": 20, "in": [-10, 20], "out": [10, -20] },
        { "x": 80, "y": 20, "in": [-10, 20] }
      ],
      "fills": [],
      "stroke": "#111318",
      "stroke_width": 2
    }
  ]
}

The bar of vector actions#

In Design, with the Move tool in hand, the bar shows whenever you select a path, a line or a combined shape, edit a path's points, or work inside an icon's frame. It takes the place of a tool's strip at the top left of the canvas.

The bar of vector actions, with a path selected
The bar of vector actions, with a path selected

From the left:

  • Pen, Rectangle, Ellipse, Polygon, Star, Line. Each takes that tool in hand.
  • Union, Subtract, Intersect, Exclude, Flatten, Outline Stroke. See Boolean shapes.
  • Radius. The corners of the path, or of the anchors you have selected.
  • Ends and Joins. Each says the way in use and goes to the next at a click: Butt, Round, Square, and Miter, Round, Bevel.
  • Flip Horizontal, Flip Vertical, Center to Keyline. The last is for icons: see The icon grid and keylines.

What cannot be done with the selection is dimmed and stays in its place, so nothing moves under the pointer. Every action in the bar is also in the menus.