<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RoomPlan",
  "identifier" : "/documentation/RoomPlan/StructureBuilder/capturedStructure(from:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RoomPlan"
    ],
    "preciseIdentifier" : "s:8RoomPlan16StructureBuilderC08capturedC04fromAA08CapturedC0VSayAA0gA0VG_tYaKF"
  },
  "title" : "capturedStructure(from:)"
}
-->

# capturedStructure(from:)

Combines the argument captured rooms into a single unit.

```
func capturedStructure(from rooms: [CapturedRoom]) async throws -> CapturedStructure
```

## Parameters

`rooms`

An array of captured room objects the app generates by performing multiple room-capture sessions in the same physical vicinity.

## Return Value

An object that consists of all of the captured room data across one or more scan sessions.

## Discussion

Each captured room in the argument array represents the post-processed result of a single scan session. This function succeeds when all of the captured rooms share compatible world space; otherwise, the function fails with an error. [`CapturedRoom`](/documentation/RoomPlan/CapturedRoom) instances share compatible world space if they reside in the same physical vicinity (they connect to form a larger structure), such as different rooms in the same building.

There are two ways to ensure the captured rooms share compatible world space. You continue a single AR session by:

- Passing the same <doc://com.apple.documentation/documentation/ARKit/ARSession> instance to the [`RoomCaptureSession`](/documentation/RoomPlan/RoomCaptureSession) objects that each produce a captured room. Be sure to pause the `ARSession` by calling [`stop(pauseARSession:)`](/documentation/RoomPlan/RoomCaptureSession/stop(pauseARSession:)) with an argument of `false` before handing it to a subsequent room-capture session.
- Loading a previously saved <doc://com.apple.documentation/documentation/ARKit/ARWorldMap> to create an `ARSession` in compatible world space with previous scans.

> Note: After loading a previously saved `ARWorldMap`, wait for <doc://com.apple.documentation/documentation/ARKit/ARCamera/TrackingState-swift.enum> to change from `relocalizing` to `normal`. For this change to take effect, the system needs to observe through the camera some portion of the recently scanned area. To guide the user accordingly, you can present a UI that instructs the user to return to the previous room before beginning the next room-capture session.

For information about saving and loading world maps to restore an <doc://com.apple.documentation/documentation/ARKit/ARSession>, see <doc://com.apple.documentation/documentation/ARKit/saving-and-loading-world-data>.

---

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)