<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshResource/init(extruding:textOptions:extrusionOptions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12MeshResourceC9extruding11textOptions09extrusionG0AC0B016AttributedStringV_AC012GenerateTextG0VAC014ShapeExtrusionG0VtKcfc::OverloadGroup"
  },
  "title" : "init(extruding:textOptions:extrusionOptions:)"
}
-->

# init(extruding:textOptions:extrusionOptions:)

Synchronously generates a 3D mesh from a string,
with options for text layout and custom extrusions.

```
@MainActor @preconcurrency convenience init(extruding string: AttributedString, textOptions: MeshResource.GenerateTextOptions = GenerateTextOptions(), extrusionOptions: MeshResource.ShapeExtrusionOptions = ShapeExtrusionOptions()) throws
```

## Parameters

`string`

A string that contains text for the 3D mesh geometry.

`textOptions`

A configuration for rendering the text in 2D, before extrusion.

`extrusionOptions`

A configuration for extruding the text in 3D.

## Discussion

You can use the method to make a 3D mesh of a string,
control the text’s layout, chamfers, materials,
and how to extrude the shape into 3D.

The generated text is scaled at a ratio of 72 points per meter.

![A screenshot of a living room scene with 3D text in the center that reads “Hello, World!”, which is primarily a teal color with chamfered, gray edges around the text’s faces that face the camera.](images/com.apple.RealityKit/meshResource-generateText-extrusion.jpg)

---

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)