# `GSLayer closeOpenPaths:`

*Instance Method*

Connects the nearest endpoints of a collection of open paths.

## Declaration

```swift
func closeOpenPaths(_ paths: [GSPath])
```

```objc
- (void) closeOpenPaths:(NSArray<GSPath *> *) paths;
```

```python
closeOpenPaths_(paths: list[GSPath])
```

## See Also

### Connecting Paths

- [`GSLayer connectPathsWithNode:andNode:`](/Core/GlyphsCore/GSLayer/connectPathsWithNode:andNode:) — Connects two path endpoints.
- [`GSLayer connectPathsWithNode:andNode:extendPath:`](/Core/GlyphsCore/GSLayer/connectPathsWithNode:andNode:extendPath:) — Connects two path endpoints and optionally adjusts their adjacent segments.
- [`GSLayer dividePathAtNode:`](/Core/GlyphsCore/GSLayer/dividePathAtNode:) — Opens or divides the path at a node.
- [`GSLayer reconnectNodesAtNode1:node2:offset:`](/Core/GlyphsCore/GSLayer/reconnectNodesAtNode1:node2:offset:) — Divides paths at two on-curve nodes and reconnects the resulting endpoints crosswise.
- [`GSLayer reconnectNodes:`](/Core/GlyphsCore/GSLayer/reconnectNodes:) — Reconnects four on-curve nodes according to their tangent directions.
- [`GSLayer connectAllOpenPaths`](/Core/GlyphsCore/GSLayer/connectAllOpenPaths) — Connects coincident endpoints of open paths.

