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.
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.
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.
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.
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.
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.