<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNCapsule/init(capRadius:height:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNCapsule(cm)capsuleWithCapRadius:height:"
  },
  "title" : "init(capRadius:height:)"
}
-->

# init(capRadius:height:)

Creates a capsule geometry with the specified radius and height.

```
convenience init(capRadius: CGFloat, height: CGFloat)
```

## Parameters

`capRadius`

The radius both of the capsule’s cylindrical body and of its hemispherical ends.

`height`

The height of the capsule along the y-axis of its local coordinate space.

## Return Value

A new capsule geometry.

## Discussion

The capsule is centered in its local coordinate system. For example, if you create a capsule whose cap radius is `5.0` and height is `20.0`, it extends from `-10.0` to `10.0` in the y-axis, and the circular cross section at the center of its body extends from `-5.0` to `5.0` along the x- and z-axes.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)