---
title: SCNPyramid
framework: scenekit
role: symbol
role_heading: Class
path: scenekit/scnpyramid
---

# SCNPyramid

A right rectangular pyramid geometry.

## Declaration

```swift
class SCNPyramid
```

## Overview

Overview

A pyramid defines the surface of a solid whose base is a rectangle, and whose four triangular side faces converge at a point centered above its base. Define the shape of the pyramid’s base in the x- and z-axis dimensions of its local coordinate space with the width and length properties, and its extent in the y-axis dimension with the height property. To position and orient a pyramid in a scene, attach it to the geometry property of an SCNNode object. Control the level of detail with the widthSegmentCount, lengthSegmentCount, and heightSegmentCount 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. A pyramid contains five SCNGeometryElement objects, corresponding to its base and each of its four sides. SceneKit can render each element using a different material. For details, see the materials property in SCNGeometry.

## Topics

### Creating a Pyramid

- [init(width:height:length:)](scenekit/scnpyramid/init(width:height:length:).md)

### Adjusting a Pyramid’s Dimensions

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

### Adjusting Geometric Detail

- [widthSegmentCount](scenekit/scnpyramid/widthsegmentcount.md)
- [heightSegmentCount](scenekit/scnpyramid/heightsegmentcount.md)
- [lengthSegmentCount](scenekit/scnpyramid/lengthsegmentcount.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)
- [SCNBox](scenekit/scnbox.md)
- [SCNCapsule](scenekit/scncapsule.md)
- [SCNCone](scenekit/scncone.md)
- [SCNCylinder](scenekit/scncylinder.md)
- [SCNPlane](scenekit/scnplane.md)
- [SCNSphere](scenekit/scnsphere.md)
- [SCNTorus](scenekit/scntorus.md)
- [SCNTube](scenekit/scntube.md)
