<!--
{
  "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/SCNGeometry/init(sources:elements:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNGeometry(cm)geometryWithSources:elements:"
  },
  "title" : "init(sources:elements:)"
}
-->

# init(sources:elements:)

Creates a new geometry built from the specified geometry sources and elements.

```
convenience init(sources: [SCNGeometrySource], elements: [SCNGeometryElement]?)
```

## Parameters

`sources`

An array of [`SCNGeometrySource`](/documentation/SceneKit/SCNGeometrySource) objects describing vertices in the geometry and their attributes.

`elements`

An array of [`SCNGeometryElement`](/documentation/SceneKit/SCNGeometryElement) objects describing how to connect the geometry’s vertices.

## Discussion

A geometry’s visible content comes from the combination of geometry sources, which contain data describing its vertices, with geometry elements, which contain data describing how the vertices connect to form a surface.

Each [`SCNGeometrySource`](/documentation/SceneKit/SCNGeometrySource) object describes an attribute of all vertices in the geometry (vertex position, surface normal vector, color, or texture mapping coordinates) identified by the source’s [`semantic`](/documentation/SceneKit/SCNGeometrySource/semantic-swift.property) property. To create a custom geometry you must provide at least one source, for the [`vertex`](/documentation/SceneKit/SCNGeometrySource/Semantic-swift.struct/vertex) semantic. Typically, you also provide sources for normals and texture coordinates for use in lighting and shading.

Sources for the vertex, normal, and color semantics must be unique—if multiple objects in the `sources` array have the same semantic, SceneKit uses only the first. A geometry may have multiple sources for the [`texcoord`](/documentation/SceneKit/SCNGeometrySource/Semantic-swift.struct/texcoord) semantic—the order of texture coordinate sources in the `sources` array determines the value to use for the [`mappingChannel`](/documentation/SceneKit/SCNMaterialProperty/mappingChannel) property when attaching materials.

Each [`SCNGeometryElement`](/documentation/SceneKit/SCNGeometryElement) object describes how vertices from the geometry sources are combined into polygons to create the geometry’s shape. Creating a custom geometry requires at least one element. If the `elements` array contains multiple objects, their order determines the arrangement of the geometry’s materials—for details, see the discussion of the [`materials`](/documentation/SceneKit/SCNGeometry/materials) property.

---

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)