<!--
{
  "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/SCNGeometryElement/init(indices:primitiveType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "s:So18SCNGeometryElementC8SceneKitE7indices13primitiveTypeABSayxG_So0a9PrimitiveG0Vtcs17FixedWidthIntegerRzlufc"
  },
  "title" : "init(indices:primitiveType:)"
}
-->

# init(indices:primitiveType:)

Creates a geometry element from the specified array of index values.

```
convenience init<IndexType>(indices: [IndexType], primitiveType: SCNGeometryPrimitiveType) where IndexType : FixedWidthInteger
```

## Parameters

`indices`

An array of index values, each of which identifies a vertex in a geometry source.

`primitiveType`

The drawing primitive that connects vertices when rendering the geometry element. For possible values, see [`SCNGeometryPrimitiveType`](/documentation/SceneKit/SCNGeometryPrimitiveType).

## Discussion

SceneKit connects the vertices in the order specified by the `indices` array, arranged according to the `primitiveType` parameter.This initializer is equivalent to the [`init(data:primitiveType:primitiveCount:bytesPerIndex:)`](/documentation/SceneKit/SCNGeometryElement/init(data:primitiveType:primitiveCount:bytesPerIndex:)) initializer, but does not require an intermediary <doc://com.apple.documentation/documentation/Foundation/Data> object; instead, it automatically infers the necessary allocation size and [`bytesPerIndex`](/documentation/SceneKit/SCNGeometryElement/bytesPerIndex) values based on the contents of the `indices` array.

To create a custom [`SCNGeometry`](/documentation/SceneKit/SCNGeometry) object from the geometry element, use the [`init(sources:elements:)`](/documentation/SceneKit/SCNGeometry/init(sources:elements:)) initializer.

---

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)