---
title: "init(mdlSubmesh:indexType:geometryType:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlsubmesh/init(mdlsubmesh:indextype:geometrytype:)-4czyc"
---

# init(mdlSubmesh:indexType:geometryType:)

Initializes a submesh by copying or converting another submesh.

## Declaration

```swift
init?(mdlSubmesh submesh: MDLSubmesh, indexType: MDLIndexBitDepth, geometryType: MDLGeometryType)
```

## Parameters

- `submesh`: The submesh to copy or convert from.
- `indexType`: The data type of each index for the new submesh’s index buffer.
- `geometryType`: The type of geometric primitives for the new submesh’s index buffer.

## Return Value

Return Value A new submesh object.

## Discussion

Discussion If the indexType or geometryType parameter does not match the corresponding property of the object in the submesh parameter, this method creates a new index buffer by converting the submesh’s index buffer to the described format while preserving shape and topology. For example, you can use this method to convert a quad mesh to a triangle mesh for rendering using GPUs that do not support quad primitives, or to convert a triangle mesh to triangle strips to create a smaller index buffer. If the indexType and geometryType parameters match the corresponding properties of the input submesh, this method simply copies that submesh’s index buffer to create the new submesh.

## See Also

### Creating a Submesh

- [init(indexBuffer:indexCount:indexType:geometryType:material:)](modelio/mdlsubmesh/init(indexbuffer:indexcount:indextype:geometrytype:material:).md)
- [init(name:indexBuffer:indexCount:indexType:geometryType:material:)](modelio/mdlsubmesh/init(name:indexbuffer:indexcount:indextype:geometrytype:material:).md)
- [init(name:indexBuffer:indexCount:indexType:geometryType:material:topology:)](modelio/mdlsubmesh/init(name:indexbuffer:indexcount:indextype:geometrytype:material:topology:).md)
