# createSphere

#### createSphere

Creates a sphere primitive and adds it to the scene.

#### Signature

```typescript
createSphere(options?: CreatePrimitiveOptions): Promise<SceneObject>
```

#### Parameters

<table><thead><tr><th width="135.75">Parameter</th><th width="229.08984375">Type</th><th width="90.328125">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>options</code></td><td><a href="/pages/RZyW5ho4Rsef15nPuwB4#createprimitiveoptions"><mark style="color:blue;"><code>CreatePrimitiveOptions</code></mark></a></td><td>No</td><td>Transform and primitive-specific settings</td></tr></tbody></table>

#### PrimitiveSphereSettings fields

<table><thead><tr><th width="268.70703125">Field</th><th width="147.96484375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>sphereRadius</code></td><td><code>number</code></td><td>Radius of the sphere</td></tr><tr><td><code>sphereWidthSegments</code></td><td><code>number</code></td><td>Horizontal segments (longitude)</td></tr><tr><td><code>sphereHeightSegments</code></td><td><code>number</code></td><td>Vertical segments (latitude)</td></tr><tr><td><code>computeNormals</code></td><td><code>boolean</code></td><td>Recompute normals</td></tr></tbody></table>

#### Returns

`Promise<SceneObject>` - the created object.

#### Examples

```javascript
// Create with custom radius
const sphere = await api.createSphere({
  primitiveSettings: { sphereRadius: 2.5 },
});

// Create low-poly sphere
const sphere = await api.createSphere({
  name: "LowPolySphere",
  primitiveSettings: {
    sphereRadius: 1,
    sphereWidthSegments: 8,
    sphereHeightSegments: 6,
  },
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.vectary.com/api/model-api/api-reference/createsphere.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
