# `GSGuide calculateIntersectionsForLayer:`

*Instance Method*

Calculates the intersections between the guide and a layer’s outlines.

## Declaration

```swift
func calculateIntersections(for layer: GSLayer)
```

```objc
- (void) calculateIntersectionsForLayer:(GSLayer *) layer;
```

```python
calculateIntersectionsForLayer_(layer: GSLayer)
```

## Parameters

- `layer` — The layer whose outlines to intersect.

## Discussion

Components are decomposed for the calculation. The result replaces [`GSGuide.intersections`](/Core/GlyphsCore/GSGuide/intersections). If the layer has no bounds or the guide does not cross its bounds, [`GSGuide.intersections`](/Core/GlyphsCore/GSGuide/intersections) is set to `nil`.

## See Also

### Measurements and Grid

- [`GSGuide.showMeasurement`](/Core/GlyphsCore/GSGuide/showMeasurement) — Whether distances between consecutive outline intersections are displayed.
- [`GSGuide.grid`](/Core/GlyphsCore/GSGuide/grid) — The distance in font units between tick marks along a line guide.
- [`GSGuide.intersections`](/Core/GlyphsCore/GSGuide/intersections) — The outline intersections calculated for the most recently supplied layer.

