# createTorus

#### createTorus

Creates a torus primitive and adds it to the scene.

#### Signature

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

#### Parameters

<table><thead><tr><th width="122.1796875">Parameter</th><th width="218.5625">Type</th><th width="106.1875">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>

#### PrimitiveTorusSettings fields

| Field               | Type      | Description                                |
| ------------------- | --------- | ------------------------------------------ |
| `torusRingRadius`   | `number`  | Radius of the ring (center to tube center) |
| `torusTubeRadius`   | `number`  | Radius of the tube                         |
| `torusRingSegments` | `number`  | Segments along the ring                    |
| `torusTubeSegments` | `number`  | Segments along the tube                    |
| `computeNormals`    | `boolean` | Recompute normals                          |

#### Returns

`Promise<SceneObject>` - the created object.

#### Examples

```javascript
const torus = await api.createTorus({
  primitiveSettings: {
    torusRingRadius: 2,
    torusTubeRadius: 0.5,
    torusRingSegments: 48,
    torusTubeSegments: 24,
  },
});
```


---

# 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/createtorus.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.
