# createBox

#### createBox

Creates a box primitive and adds it to the scene.

#### Signature

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

#### Parameters

<table><thead><tr><th width="121.6875">Parameter</th><th width="226.94140625">Type</th><th width="84.25">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>

#### PrimitiveBoxSettings fields

<table><thead><tr><th width="234.8203125">Field</th><th width="252.08984375">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>boxDimensions</code></td><td><code>{ x: number; y: number; z: number }</code></td><td>Box size on each axis</td></tr><tr><td><code>boxSegments</code></td><td><code>{ x: number; y: number; z: number }</code></td><td>Subdivision segments per axis</td></tr><tr><td><code>roundnessEnabled</code></td><td><code>boolean</code></td><td>Enable rounded corners</td></tr><tr><td><code>roundnessRadius</code></td><td><code>number</code></td><td>Corner radius</td></tr><tr><td><code>roundnessRadiusSegments</code></td><td><code>number</code></td><td>Segments for roundness curve</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 defaults
const box = await api.createBox();

// Create at a specific position with a name
const box = await api.createBox({
  name: "MyBox",
  position: { x: 0, y: 1, z: 0 },
});

// Create with custom dimensions and roundness
const box = await api.createBox({
  name: "RoundedBox",
  primitiveSettings: {
    boxDimensions: { x: 2, y: 1, z: 3 },
    roundnessEnabled: true,
    roundnessRadius: 0.1,
  },
});
```


---

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