<!--
{
  "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/ShapeExtrusionOptions/ExtrusionMethod-swift.enum/linear(depth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12MeshResourceC21ShapeExtrusionOptionsV0F6MethodO6linearyAGSf_tcAGmF"
  },
  "title" : "MeshResource.ShapeExtrusionOptions.ExtrusionMethod.linear(depth:)"
}
-->

# MeshResource.ShapeExtrusionOptions.ExtrusionMethod.linear(depth:)

Extrudes the shape with a linear extrusion in Z by the desired depth.

```
case linear(depth: Float)
```

## Discussion

For example an extrusion that has a linear depth of 0.6 meters:

```swift
var extrusionOptions = ShapeExtrusionOptions()
extrusionOptions.extrusionMethod = .linear(depth: 0.6)
```

![](images/com.apple.RealityKit/generateExtrudedShape-extrusionMethod-linear-red.jpg)

You can also use [`MeshResource.ShapeExtrusionOptions.ExtrusionMethod.tracePositions(_:)`](/documentation/RealityKit/MeshResource/ShapeExtrusionOptions/ExtrusionMethod-swift.enum/tracePositions(_:)) an equivalent way.

```swift
.tracePositions([
    [0, 0, -depth/2],
    [0, 0,  depth/2]
)
```

---

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)