# `GSPath segmentAndNodeRange(atNodeIndex:)`

*Instance Method*

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

## Declaration

```swift
func segmentAndNodeRange(atNodeIndex nodeIndex: Int) -> (segment: GSPathSegment, nodeRange: ClosedRange<Int>)?
```

## 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.

