<!--
{
  "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/SCNPyramid",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPyramid"
  },
  "title" : "SCNPyramid"
}
-->

# SCNPyramid

A right rectangular pyramid geometry.

```
class SCNPyramid
```

## Overview

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

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`](/documentation/SceneKit/SCNPyramid/width) and [`length`](/documentation/SceneKit/SCNPyramid/length) properties, and its extent in the y-axis dimension with the [`height`](/documentation/SceneKit/SCNPyramid/height) property. To position and orient a pyramid 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/SCNPyramid/widthSegmentCount), [`lengthSegmentCount`](/documentation/SceneKit/SCNPyramid/lengthSegmentCount), and [`heightSegmentCount`](/documentation/SceneKit/SCNPyramid/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`](/documentation/SceneKit/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`](/documentation/SceneKit/SCNGeometry/materials) property in [`SCNGeometry`](/documentation/SceneKit/SCNGeometry).

## Topics

### Creating a Pyramid

[`+  pyramidWithWidth:height:length:`](/documentation/SceneKit/SCNPyramid/init(width:height:length:))

Creates a pyramid geometry with the specified width, height, and length.

### Adjusting a Pyramid’s Dimensions

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

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

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

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

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

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

### Adjusting Geometric Detail

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

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

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

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

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

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

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SCNBoundingVolume`](/documentation/SceneKit/SCNBoundingVolume)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SCNShadable`](/documentation/SceneKit/SCNShadable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SCNAnimatable`](/documentation/SceneKit/SCNAnimatable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`SCNGeometry`](/documentation/SceneKit/SCNGeometry)

---

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)