<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNBox",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNBox"
  },
  "title" : "SCNBox"
}
-->

# SCNBox

A six-sided polyhedron geometry whose faces are all rectangles, optionally with rounded edges and corners.

```
class SCNBox
```

## Overview

![](images/com.apple.scenekit/media-2929807@2x.png)

Define the shape of the box in the x-, y-, and z-axis dimensions of its local coordinate space by setting its [`width`](/documentation/SceneKit/SCNBox/width), [`height`](/documentation/SceneKit/SCNBox/height), and [`length`](/documentation/SceneKit/SCNBox/length) properties. Add rounded edges and corners to a box with its [`chamferRadius`](/documentation/SceneKit/SCNBox/chamferRadius) property. To position and orient a box in a scene, attach it to the [`geometry`](/documentation/SceneKit/SCNNode/geometry) property of an [`SCNNode`](/documentation/SceneKit/SCNNode) object.

Control the level of detail with the [`widthSegmentCount`](/documentation/SceneKit/SCNBox/widthSegmentCount), [`heightSegmentCount`](/documentation/SceneKit/SCNBox/heightSegmentCount), [`lengthSegmentCount`](/documentation/SceneKit/SCNBox/lengthSegmentCount), and [`chamferSegmentCount`](/documentation/SceneKit/SCNBox/chamferSegmentCount) properties. A higher segment count produces more vertices, which can improve rendering quality for certain lighting models or custom shader effects, but at a cost to rendering performance.

You can assign up to six [`SCNMaterial`](/documentation/SceneKit/SCNMaterial) instances to a box—one for each side—with its [`materials`](/documentation/SceneKit/SCNGeometry/materials) property. The [`SCNBox`](/documentation/SceneKit/SCNBox) class automatically creates [`SCNGeometryElement`](/documentation/SceneKit/SCNGeometryElement) objects as needed to handle the number of materials.

## Topics

### Creating a Box

[`init(width:height:length:chamferRadius:)`](/documentation/SceneKit/SCNBox/init(width:height:length:chamferRadius:))

Creates a box geometry with the specified width, height, length, and chamfer radius.

### Adjusting a Box’s Dimensions

[`width`](/documentation/SceneKit/SCNBox/width)

The extent of the box along its x-axis. Animatable.

[`height`](/documentation/SceneKit/SCNBox/height)

The extent of the box along its y-axis. Animatable.

[`length`](/documentation/SceneKit/SCNBox/length)

The extent of the box along its z-axis. Animatable.

### Configuring Box Properties

[`widthSegmentCount`](/documentation/SceneKit/SCNBox/widthSegmentCount)

The number of subdivisions in each face of the box along its x-axis. Animatable.

[`heightSegmentCount`](/documentation/SceneKit/SCNBox/heightSegmentCount)

The number of subdivisions in each face of the box along its y-axis. Animatable.

[`lengthSegmentCount`](/documentation/SceneKit/SCNBox/lengthSegmentCount)

The number of subdivisions in each face of the box along its z-axis. Animatable.

### Adding Rounded Edges and Corners

[`chamferRadius`](/documentation/SceneKit/SCNBox/chamferRadius)

The radius of curvature for the edges and corners of the box. Animatable.

[`chamferSegmentCount`](/documentation/SceneKit/SCNBox/chamferSegmentCount)

The number of line segments used to create each rounded edge of the box. Animatable.



---

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)