# `GSPath circleWithRect:`

*Initializer*

Creates a closed cubic path approximating an ellipse inside the rectangle.

## Declaration

```swift
convenience init?(ellipseIn theRect: NSRect)
```

```objc
+ (instancetype) circleWithRect:(NSRect) theRect;
```

```python
circleWithRect_(theRect: NSRect) -> GSPath
```

## Discussion

Returns `nil` when the rectangle is empty or null.

## See Also

### Creating a Path

- [`GSPath initWithDict:format:`](/Core/GlyphsCore/GSPath/initWithDict:format:) — Creates a path from a Glyphs file dictionary representation.
- [`GSPath initWithGlyphsParser:format:`](/Core/GlyphsCore/GSPath/initWithGlyphsParser:format:) — Creates a path from the Glyphs file representation at the current parser position.
- [`GSPath pathWithString:isClosed:`](/Core/GlyphsCore/GSPath/pathWithString:isClosed:) — Creates a path from a sequence of node element strings.
- [`GSPath pathWithRect:`](/Core/GlyphsCore/GSPath/pathWithRect:) — Creates a closed rectangular path enclosing the rectangle.
- [`GSPath circleWithCenter:radius:`](/Core/GlyphsCore/GSPath/circleWithCenter:radius:) — Creates a closed cubic path approximating a circle.
- [`GSPath ellipseWithCenter:radius1:radius2:angle:`](/Core/GlyphsCore/GSPath/ellipseWithCenter:radius1:radius2:angle:) — Creates a closed cubic path approximating an ellipse.

