One Logo Pool Ball
RoomPlan · IOS API REFERENCE

CapturedRoom.ModelProvider

struct · iOS 17.0+ · SDK 27.1

struct ModelProvider

A structure that assigns detailed 3D models to captured objects for an export. This structure provides a way for your app to assign detailed shape to specific areas within a captured room. RoomPlan approximates the size and shape of objects it observes in a scan by using bounding boxes. In iOS 17 and later, the framework categorizes those objects that it recognizes by tagging them with specific attributes (<doc:captured-object-attributes>). `ModelProvider` enables your app to export the categorized objects with unique 3D models. For example, you can assign a specific 3D model to a combination of attributes, such as all `.stool` objects with a `.star` base.

Members (7)

method · iOS 17.0+

setModelFileURL

TypeScript
setModelFileURLFor(url: (string) | null, category: CapturedRoom_Object_Category): void
Swift declaration
mutating func setModelFileURL(_ url: URL?, for category: CapturedRoom.Object.Category) throws

Associates a URL to the given object category. This function throws ``CapturedRoom/ModelProvider/Error/nonExistingFile(url:)`` if a 3D model doesn't exist at the given URL. - parameter url: A URL to a 3D model. - parameter category: The object type associated with the model URL.

method · iOS 17.0+

setModelFileURL

TypeScript
setModelFileURLFor64378(url: (string) | null, attributes: Array<SDKHandle>): void
Swift declaration
mutating func setModelFileURL(_ url: URL?, for attributes: [any CapturedRoomAttribute]) throws

Associates a URL to the given attributes. In error conditions, this function throws: - ``CapturedRoom/ModelProvider/Error/nonExistingFile(url:)`` if a 3D model doesn't exist at the given URL. - ``CapturedRoom/ModelProvider/Error/attributeCombinationNotSupported`` if no object category supports all of the argument attributes. Query ``CapturedRoom/Object/Category-swift.enum/supportedCombinations`` to check the attributes that a category supports. - parameter url: A URL to a 3D model. - parameter attributes: An array of attributes that represents a unique combination to which to associate the URL.

method · iOS 17.0+

modelFileURL

TypeScript
modelFileURLFor(category: CapturedRoom_Object_Category): (string) | null
Swift declaration
func modelFileURL(for category: CapturedRoom.Object.Category) throws -> URL?

Provides a URL to the 3D model for the given category. This function throws ``CapturedRoom/ModelProvider/Error/nonExistingFile(url:)`` if a 3D model doesn't exist at the given URL. - Returns: The 3D model that the app associates to the given object's category via ``CapturedRoom/ModelProvider/setModelFileURL(_:for:)-4law9``; or, `nil` if no 3D model URL associates to the given category. - parameter category: An object type that represents criteria for the model-URL query.

method · iOS 17.0+

modelFileURL

TypeScript
modelFileURLFor12765(object: CapturedRoom_Object): (string) | null
Swift declaration
func modelFileURL(for object: CapturedRoom.Object) throws -> URL?

Provides a URL to a 3D model based on the given object's attributes or category. In error conditions, this function throws: - ``CapturedRoom/ModelProvider/Error/nonExistingFile(url:)`` if a 3D model doesn't exist at the given URL. - ``CapturedRoom/ModelProvider/Error/attributeCombinationNotSupported`` if no object category supports all of the argument attributes. Query ``CapturedRoom/Object/Category-swift.enum/supportedCombinations`` to check the attributes that an object category supports. - Returns: The 3D model that the app associates to the given object's attributes via ``CapturedRoom/ModelProvider/setModelFileURL(_:for:)-8xio`` or its category via ``CapturedRoom/ModelProvider/setModelFileURL(_:for:)-4law9``; or, `nil` if no 3D model URL associates to the given object's category or combination of attributes. - parameter object: The object whose attributes and category represent criteria for the model-URL query.

method · iOS 17.0+

modelFileURL

TypeScript
modelFileURLFor298(attributes: Array<SDKHandle>): (string) | null
Swift declaration
func modelFileURL(for attributes: [any CapturedRoomAttribute]) throws -> URL?

Provides a URL to the 3D model for the given attributes. In error conditions, this function throws: - ``CapturedRoom/ModelProvider/Error/nonExistingFile(url:)`` if a 3D model doesn't exist at the given URL. - ``CapturedRoom/ModelProvider/Error/attributeCombinationNotSupported`` if no object category supports all of the argument attributes. Query ``CapturedRoom/Object/Category-swift.enum/supportedCombinations`` to check the attributes that an object category supports. - Returns: The 3D model that the app associates to the given object's attributes via ``CapturedRoom/ModelProvider/setModelFileURL(_:for:)-8xio``. If no 3D model URL associates to the given attribute combination, this function returns `nil`. - parameter attributes: An array of attributes that represent criteria for the model-URL query.

get · iOS 17.0+

modelFileURLs

TypeScript
get modelFileURLs(): Array<string>
Swift declaration
var modelFileURLs: [URL] { get }

An array of URLs to 3D models for all categories and attributes.

init · iOS 17.0+

init

TypeScript
static init(): CapturedRoom_ModelProvider
Swift declaration
init()

Creates a model provider.

Skipped declarations

No declarations were skipped in this snapshot.

All RoomPlan types →