---
title: SCNBox
framework: scenekit
role: symbol
role_heading: Class
path: scenekit/scnbox
---

# SCNBox

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

## Declaration

```swift
class SCNBox
```

## Overview

Overview

Define the shape of the box in the x-, y-, and z-axis dimensions of its local coordinate space by setting its width, height, and length properties. Add rounded edges and corners to a box with its chamferRadius property. To position and orient a box in a scene, attach it to the geometry property of an SCNNode object. Control the level of detail with the widthSegmentCount, heightSegmentCount, lengthSegmentCount, and 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 instances to a box—one for each side—with its materials property. The SCNBox class automatically creates SCNGeometryElement objects as needed to handle the number of materials.

## Topics

### Creating a Box

- [init(width:height:length:chamferRadius:)](scenekit/scnbox/init(width:height:length:chamferradius:).md)

### Adjusting a Box’s Dimensions

- [width](scenekit/scnbox/width.md)
- [height](scenekit/scnbox/height.md)
- [length](scenekit/scnbox/length.md)

### Configuring Box Properties

- [widthSegmentCount](scenekit/scnbox/widthsegmentcount.md)
- [heightSegmentCount](scenekit/scnbox/heightsegmentcount.md)
- [lengthSegmentCount](scenekit/scnbox/lengthsegmentcount.md)

### Adding Rounded Edges and Corners

- [chamferRadius](scenekit/scnbox/chamferradius.md)
- [chamferSegmentCount](scenekit/scnbox/chamfersegmentcount.md)

## Relationships

### Inherits From

- [SCNGeometry](scenekit/scngeometry.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [SCNAnimatable](scenekit/scnanimatable.md)
- [SCNBoundingVolume](scenekit/scnboundingvolume.md)
- [SCNShadable](scenekit/scnshadable.md)

## See Also

### Basic Shapes

- [SCNFloor](scenekit/scnfloor.md)
- [SCNCapsule](scenekit/scncapsule.md)
- [SCNCone](scenekit/scncone.md)
- [SCNCylinder](scenekit/scncylinder.md)
- [SCNPlane](scenekit/scnplane.md)
- [SCNPyramid](scenekit/scnpyramid.md)
- [SCNSphere](scenekit/scnsphere.md)
- [SCNTorus](scenekit/scntorus.md)
- [SCNTube](scenekit/scntube.md)
