Declaration

class GSPath

Declaration

@interface GSPath : GSShape

Declaration

class GSPath(GSShape)

Overview

A path describes one continuous outline contour; it is not divided into separate subpaths.

The nodes are stored in drawing order. On-curve nodes lie on the contour and define segment endpoints. Off-curve nodes control the shape of curve segments.

A segment runs from one on-curve node to the next on-curve node. The on-curve node type describes the segment ending at that node. A path time identifies a position within a segment by combining the ending on-curve node integer index with a fractional segment position.

Closed paths connect the final node to the first node. Open paths do not wrap at their ends. Navigation path APIs wrap indices for closed paths and reject out-of-range indices for open paths.

A path is expected to contain nodes during normal use. Empty paths can exist immediately after creation, but many path operations assume a populated path. Paths without on-curve nodes are interpreted as using quadratic path segments with implicit on-curve nodes.

Topics

Creating a Path

Closed/Open

Path Direction

Nodes

  • An on-curve or off-curve point of a path.

  • The ordered nodes describing the path.

  • Replaces all nodes without registering undo or notifying the layer.

  • The number of nodes.

Inserting Nodes

Removing Nodes

Node Navigation

Path Time

Editing Nodes

Segments

Geometry

Tangents

Convenience

Representations

Cleanup

Curve Conversion

Checking Path Contents

Layer API

Encoding

Equality and Comparison

  • Whether another path has the same closed state, node count, and node positions.

  • A geometric hash for matching paths with the same node structure.

  • Enumerates matching node positions for a geometric hash.

  • A transform that maps a geometric hash to the matching position on the path.

Instance Methods

  • same as checkConnections but without notifying and undo. Good when loading the path

  • The position at a node index, or nil when the index does not match a node.

  • same as ``setClosed:``` but without notifying and undo. Good when loading the path

Topics

Creating a Path

Closed/Open

Path Direction

Nodes

Inserting Nodes

Removing Nodes

Node Navigation

Path Time

Editing Nodes

Segments

Geometry

Tangents

Convenience

Representations

Cleanup

Curve Conversion

Checking Path Contents

Layer API

Encoding

Equality and Comparison

Instance Methods

Relationships

Inherits From

Conforms To

Relationships

Inherits From

Conforms To

See Also

Shapes

  • An abstract base class for graphical elements stored in a glyph layer.

  • A reference to another glyph placed as a shape in a glyph layer.

  • A shape group combines zero or more shapes into a single shape, forming a shape tree.