<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ClothMeshResource/sphere(radius:targetEdgeLength:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth0C12MeshResourceC6sphere6radius16targetEdgeLengthACXDSf_SftKFZ"
  },
  "title" : "sphere(radius:targetEdgeLength:)"
}
-->

# sphere(radius:targetEdgeLength:)

Creates a sphere mesh with a topology suitable for cloth simulation.

```
@MainActor static func sphere(radius: Float, targetEdgeLength: Float = defaultTargetEdgeLength) throws -> Self
```

## Return Value

The generated sphere mesh resource.

## Discussion

- radius: The radius of the generated sphere, in meters.
- targetEdgeLength: The targeted average edge length for the generated mesh, in meters.
  The generated mesh will contain edges with a length as close as possible to this.

---

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)