---
title: "generateCone(height:radius:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/meshresource/generatecone(height:radius:)"
---

# generateCone(height:radius:)

Creates a new cone mesh with the specified dimensions.

## Declaration

```swift
@MainActor @preconcurrency static func generateCone(height: Float, radius: Float) -> MeshResource
```

## Parameters

- `height`: The height of the cone, in meters, along the y-axis.
- `radius`: The base radius of the cone, in meters.

## Discussion

Discussion The cone is centered at the local origin with its axis aligned along the y-axis.

## See Also

### Creating a primitive shape

- [generateSphere(radius:)](realitykit/meshresource/generatesphere(radius:).md)
- [generateCylinder(height:radius:)](realitykit/meshresource/generatecylinder(height:radius:).md)
