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

# MeshResource.ShapeExtrusionOptions.ExtrusionMethod.tracePositions(_:)

Extrudes the shape by sweeping it along a piecewise-linear curve.

```
case tracePositions([SIMD3<Float>])
```

## Discussion

The curve is defined as the set of line segments
For each edge in the provided curve, the swept shape (e.g. the 2D path provided in
`MeshResource(extruding: Path)`, or text) will be instantiated at the edge’s endpoints.
Each instance of the swept shape will be joined together by a strip of geometry.

The positions are traced in such a way as to avoid twist in the generated 3D shape.  When possible,
the local y-axis of the swept (2D) shape will be aligned with the y-axis of the generated 3D shape.

For example, extrude a rounded square along the z-axis, while zig-zagging in the y-axis:

```swift
// Positions in a zig-zag pattern.
let positions: [SIMD3<Float>] = [
    [0,    0,   0],
    [0, -0.1, 0.2],
    [0,    0, 0.4],
    [0, -0.1, 0.6]
]

var extrusionOptions = ShapeExtrusionOptions()
extrusionOptions.extrusionMethod = .tracePositions(positions)
```

![](images/com.apple.RealityKit/generateExtrudedShape-extrusionMethod-tracePositions-red.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)