Editing Paths

Editing Paths

The shape of an object (including group objects), can be a geometric primitive, a free form path or a composite shape of multiple shapes. This section documents a number of tools used to edit free form paths.

If an object shape is a geometric primitive or a composite shape, use the Convert to Curves command to convert the shape to a free form path. The object shape may also be a vector text shape. The Convert to Curves will convert the text shape into a single object containing a set of paths as its shape, where each text glyph results in a path. The set of paths can be separated into objects using the Break Apart command.

A free form path may contain multiple sub-paths, each with a starting and ending node. A path may be open or closed. Paths and sub-paths are made of a sequence of segments that can be lines, quadratic or cubic curves. The type of a segment can be changed while editing a path. The node of a path (connection between the segments) can be of Cusp, Smooth or Symmetric type, determining how the tangent control nodes are handled at that node.

The Node Tool

The Node tool is used to edit geometric primitives and free form paths, depending on the selected objects. When a geometric primitive is selected, the function of the Node tool will depend on the type of the geometric primitive. The individual geometric primitive type editing is described in other sections of this chapter.

When a vector text shape is selected, the Node tool can be used to adjust the baseline shape of the text. Editing the text baseline shape as a free form path can be used to create various text on path effects. For more detailed description on the text on path features, see the Working with Text chapter.

When a free form path is selected, the Node tool can be used to edit the curves and nodes of the path.

Indicators

The path editor uses various indicator types to show the nodes, control points and node selection of a path. The size and color of the node and control point indicators can be customized in the application preferences.

Three free form path shapes with no selections.

When no nodes are selected, the normal node indicators are shown with green circles (by default). The start and end nodes are shows as triangles, pointing to the path direction.

Three examples of path node indicators: (A) a smooth node is selected and an inner location is highlighted indicating the curve direction. (B) a symmetric node is selected (tangent controls are of equal distance from the node). (C) a cusp node is selected.

When a node is selected, its tangent control points are also shown (for curves). When hovering over a line or curve segment, the direction of the path is shown with a triangle indicator. The selected node is shown with a different color (customizable in the preferences). The control point and line colors are also customizable.

Selecting Nodes

Clicking on a node will select the node. Holding the Command key and clicking on a node will add the node to the selection. Dragging the marquee (by default box) selector will select the nodes inside the marked area. The lasso selection tool can also be used to select multiple nodes inside an irregular area.

The curve segment can be selected at any internal location (not just the ending nodes) and dragged to change the curve. Selecting and dragging an internal location of a line, will change it to a curve.

Node and Segment Types

The Path panel.

Each node and segment of a path has a type specifying the mode of operation on that node. The type of the selected nodes and segments can be changed using the Path panel, the Properties panel or the Context tool bar.

The type of a node can be one of the following:

  • Cusp - at a cusp node the tangent controls of previous and next curve segments can be independently adjusted. Cusp nodes can be of any angle. Shape corners can be set only at cusp nodes.
  • Smooth - at a smooth node, the tangent controls of the previous and next curve segments are along the same line (but not the same distance). This means that the path is smooth at the node, and no shape corner can be set at this node.
  • Symmetric - at a symmetric node, the tangent controls are along the same line and distance from the node making the curve smooth at the node and of similar curvature before and after the node. Symmetric nodes cannot have shape corners.

The following segment types can be used in a curve:

  • Line - a straight line segment, with no control points. The starting and ending nodes can be cusp, smooth or symmetric. When the symmetric node type is used at a line segment end, the length of the tangent control will be half of the line.
  • Quadratic - a quadratic curve, having a single tangent control point. Quadratic curves are used for example in some of the TrueType and OpenType fonts, and provide an easy control over the curvature of a shape.
  • Cubic - a cubic curve, having two independent tangent control points. The tangent controls are used to set the direction of the curve at the start and end nodes. Cubic curves are the most common form of segments used in vector graphics.

Moving Nodes and Curves

The selected nodes can be moved, by holding the mouse over a selected node and dragging. Holding the Shift key will restrict the node movements to horizontal or vertical only (subject to the current view rotation).

While moving a single node at the end of a line segment, or moving a control point, holding the Command key will keep the length of the line (or distance of the control point from its node) fixed, and change the angle only.

A line or curve can be selected at any location along the segment. The selection is indicated by a triangle, showing the direction of the path. When selected at an inner location (not at the start or end nodes), a curve segment can be adjusted by moving that location. When moving an inner location of a line, the line is automatically converted to a curve segment.

Add and Remove Nodes

A new node can be created on any segment by first selecting an inner location along the segment and pressing the Plus key. This will break the segment into two segments, and create a new smooth node at the selected location. If the segment was a line, the node will be a cusp node.

When a node is selected (a start or end of a segment), pressing the Plus key will create a new node at the center of the next segment (the segment after the selected node). To break multiple segments in the middle, select the nodes at the start of these segments, and press the Plus key.

The selected nodes can be deleted by pressing the Delete key. The selected nodes are removed, and the curvature of the path is adjusted to follow the original path as close as possible, but with less nodes and segments.

Path nodes can also be created or deleted using buttons from the Path panel, Properties panel or Context tool bar.

Scaling and Rotating Multiple Nodes

To scale or rotate a part of a path, select the nodes using the marquee tool or by clicking while holding the Command key. Once the nodes are selected, select the Scale or Rotate (Skew is also supported) tools from the toolbox.

When the Scale or Rotate tools are activated, while a set of path nodes are selected, the transform frame is displayed around the selected nodes only. Use the handles for scaling or rotating of the transform frame to adjust the selected nodes. Only the selected nodes and their control points are scaled or rotated, the rest of the path remains unchanged.

Trimming Self-Intersecting Points

Trimming self-intersecting points of a path with two clicks.

When drawing and merging multiple free form paths, it is quite common that separately drawn path ends don’t exactly match. Connecting the ends of such paths is possible using the Path panel, but it will result in undesirable movement of the control points and the curvature may change. Such scenarios occur especially when creating hand drawn line art, or manually tracing artwork.

The example captured in the figure, shows a path consisting of two sub-paths drawn by hand using the pencil tool. The paths were combined using the Combine - Merge command of the object menu. The problem here is that the start and end of these paths don’t exactly align to allow a proper joining into a single filled path.

The Node tool can be used to quickly cleanup such path intersections (including many other scenarios) using only a single click. Select the path object to be edited, and select the Node tool. Hold the Command key (without selecting any node), a larger (blue) circle will show. The circle indicates the area where self-intersecting points are cleaned (other parts of the path remain unchanged). Move the mouse over the self-intersecting point to be cleaned (the circle marquee center should be close to the point), while still holding the Command key. Click with the mouse over the self-intersecting point, and if the two short edges are correctly identified (i.e. they are not too long), a new node is created at the self-intersecting point, the short edges are removed and the path is joined at the new node.

The Simplify Tool

The Simplify Tool is used to simplify a selected part of a path, by removing nodes and smoothing the curvature of the path. Paths created in automatic image tracing, or when importing artwork from other file formats, may have too many nodes and are not easily editable. By simplifying such paths, curves can be smoothed and nodes removed to obtain an editable path.

Select a path to be simplified and select the Simplify Tool from the application toolbox. The existing nodes of the path are shown using the current node indicator style (customizable in the application preferences). Press the mouse (or tablet pencil) with the simplify tool at a location on the path and drag along the path to cover the part that should be simplified. Release the mouse and the painted path region is simplified using the current smoothness amount.

The smoothness amount used by the Simplify tool can be set in the Properties panel or in the Context tool bar.

Redraw Parts of a Path

The Pencil tool can be used to redraw part of a path. Select the object with the path shape. Select the Pencil tool and position the cursor at a location on the path, where the redrawing should start (sufficiently close to the path). Press the mouse (or tablet pencil) and paint the new path. Release the mouse at the location of the original path, where the redrawn part should end.

The part of the path between the starting and ending locations of the path is replaced with the newly drawn path.

Erase Parts of a Shape

Parts of a closed or open shape can be erased using the Eraser tool. Select the object with the shape that must be modified. Select the Eraser tool and start painting over the path. The regions of the path painted over with the current brush size and nib shape will be erased.

The Eraser tool options.

The erasing of shape regions uses the boolean shape operations to remove from the shape. The resulting path node set is simplified using the current smoothness value. If the selected shape was a geometric primitive or a vector text, it will be converted to curves, at the moment the eraser tool cuts into the shape.

If an open path is selected, the eraser tool can be used to remove parts of the path. If multiple objects are selected, the eraser tool will erase from all of the selected objects that are painted over.

The size of the brush and the nib shape used by the eraser tool can be set in the tool options view. To open the tool options view, double click the eraser tool.

The Brush Size field contains the size of the eraser brush. The Brush Stretch and Brush Angle fields edit the stretch and angle of a calligraphic brush nib shape.

The Knife Tool

The Knife tool can be used cut open or closed shapes into multiple pieces. To modify a shape (or shapes) with the knife tool, select the objects with the shape and select the knife tool. Paint the region of the path to be separated, with the knife tool. Typically, the painting starts and ends outside of the path, traversing the region of the path where the cutting occurs.

The result will be an object using the same fill and outline style of the original object, but containing multiple sub-paths. Use the Break Apart command to separate the object into multiple path objects.