# `GSPath segmentAtNodeIndex:segmentStartIndex:segmentEndIndex:`

*Instance Method*

The segment associated with a node index and the node index range it covers.

## Declaration

```objc
- (GSPathSegment *) segmentAtNodeIndex:(NSInteger) idx segmentStartIndex:(NSInteger *) segmentStartIdx segmentEndIndex:(NSInteger *) segmentEndIdx;
```

```python
segmentAtNodeIndex_segmentStartIndex_segmentEndIndex_(idx: int, segmentStartIdx: int, segmentEndIdx: int) -> GSPathSegment
```

## Parameters

- `segmentStartIdx` — On return, the index of the first node in the segment.
- `segmentEndIdx` — On return, the index of the ending on-curve node.

## Discussion

Off-curve node indices resolve to the following on-curve node.

Returns `nil` when no segment can be resolved for the index.

## See Also

### Segments

- [`GSPath.segments`](/Core/GlyphsCore/GSPath/segments) — The path represented as path segments.
- [`GSPath.segmentsFast`](/Core/GlyphsCore/GSPath/segmentsFast) — The path represented as path segments without collecting path object information.
- [`GSPath segmentAtNodeIndex:`](/Core/GlyphsCore/GSPath/segmentAtNodeIndex:) — The segment associated with a node index.

