<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RoomPlan",
  "identifier" : "/documentation/RoomPlan/CapturedRoom/Surface",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RoomPlan"
    ],
    "preciseIdentifier" : "s:8RoomPlan08CapturedA0V7SurfaceV"
  },
  "title" : "CapturedRoom.Surface"
}
-->

# CapturedRoom.Surface

A 2D area in a room that the framework identifies as a surface.

```
struct Surface
```

## Overview

A captured room ([`CapturedRoom`](/documentation/RoomPlan/CapturedRoom)) contains an arrays of surfaces that it identifies in a scan,
such as its [`doors`](/documentation/RoomPlan/CapturedRoom/doors), [`openings`](/documentation/RoomPlan/CapturedRoom/openings), [`walls`](/documentation/RoomPlan/CapturedRoom/walls), and
[`windows`](/documentation/RoomPlan/CapturedRoom/windows).

## Topics

### Creating a surface

[`init(from: any Decoder) throws`](/documentation/RoomPlan/CapturedRoom/Surface/init(from:))

Creates a surface by deserializing the specified decoder.

### Identifying a surface

[`var identifier: UUID`](/documentation/RoomPlan/CapturedRoom/Surface/identifier)

A unique alphanumeric value that the framework assigns the surface.

[`var parentIdentifier: UUID?`](/documentation/RoomPlan/CapturedRoom/Surface/parentIdentifier)

A unique alphanumeric value that identifies a surface’s parent surface.

[`var category: CapturedRoom.Surface.Category`](/documentation/RoomPlan/CapturedRoom/Surface/category-swift.property)

A classification that the captured room assigns the surface.

[`enum Category`](/documentation/RoomPlan/CapturedRoom/Surface/Category-swift.enum)

Classifications of a surface in a captured room.

[`var confidence: CapturedRoom.Confidence`](/documentation/RoomPlan/CapturedRoom/Surface/confidence)

A level of certainty in the surface’s category.

### Positioning and sizing a surface

[`var transform: simd_float4x4`](/documentation/RoomPlan/CapturedRoom/Surface/transform)

A matrix that defines the surface’s position and orientation in the scene.

[`var dimensions: simd_float3`](/documentation/RoomPlan/CapturedRoom/Surface/dimensions)

A bounding box that contains the surface.

[`var story: Int`](/documentation/RoomPlan/CapturedRoom/Surface/story)

indicator for which story, level, or floor

### Shaping a surface

[`var completedEdges: Set<CapturedRoom.Surface.Edge>`](/documentation/RoomPlan/CapturedRoom/Surface/completedEdges)

An array of edges that outline the surface.

[`enum Edge`](/documentation/RoomPlan/CapturedRoom/Surface/Edge)

An object that represents a single edge of a surface.

[`var curve: CapturedRoom.Surface.Curve?`](/documentation/RoomPlan/CapturedRoom/Surface/curve-swift.property)

An object that represents the curve of a surface.

[`struct Curve`](/documentation/RoomPlan/CapturedRoom/Surface/Curve-swift.struct)

An object that represents a single curve of a surface.

[`var polygonCorners: [simd_float3]`](/documentation/RoomPlan/CapturedRoom/Surface/polygonCorners)

A 2D polygon that represents nonuniform wall heights and floor shapes.

### Serializing a surface

[`func encode(to: any Encoder) throws`](/documentation/RoomPlan/CapturedRoom/Surface/encode(to:))

Serializes a surface to the specified encoder.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Encodable`](/documentation/Swift/Encodable)

---

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)