Providing custom models for captured rooms and structure exports
At a glance
| Item | Summary |
|---|---|
| Purpose | Enhance the look of an exported 3D model by substituting object bounding boxes with detailed 3D renditions. |
| App architecture | A Swift sample bundle with entry-bearing project variants RoomPlanCatalogGenerator, RoomPlanExporter, each leading to RoomPlan APIs. |
| Main patterns | No named application pattern supported by the extracted structure |
| Project style | 5 scanned source file(s) across Swift, organized around ranked entry, type, and file boundaries. |
| Execution model | No structured execution marker indexed; callback threading requires source review. |
| State/event model | Source-visible mechanisms: SwiftUI state property wrapper. |
| Key frameworks/packages | Foundation, RoomPlan, os, SwiftUI, ArgumentParser; these are source dependencies, not architecture labels. |
Project structure
Source bundle/
├── RoomPlanCatalogGenerator/
│ ├── RoomPlanCatalogGenerator.swift
│ ├── RoomPlanCatalog.swift
│ └── URL+CatalogExtensions.swift
├── RoomPlanExporter/
│ ├── RoomPlanExporterApp.swift
│ ├── ContentView.swift
│ └── RoomPlanCatalog.bundle/
│ └── catalog.plist
├── Configuration/
│ └── SampleCode.xcconfig
└── RoomPlanCatalogGenerator.xcodeproj/
├── .xcodesamplecode.plist
└── project.pbxproj
Structure observations
- Architecturally prominent files are ranked from entry points and role-named declarations; resource-only paths are omitted.
- Primary languages: Swift.
- The verified tree contains 4 project/configuration file(s) and 14 source declaration(s).
Overall architecture
flowchart LR
Bundle["Sample bundle"]
V1["RoomPlanCatalogGenerator"]
V2["RoomPlanExporter"]
Boundary["RoomPlan APIs"]
Bundle --> V1
V1 --> Boundary
Bundle --> V2
V2 --> Boundary
Reference code
RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift:14 — architecture anchor
@main
struct RoomPlanCatalogGenerator: ParsableCommand {
static let configuration = CommandConfiguration(commandName: "RoomPlanCatalogGenerator",
abstract: "RoomPlan Catalog Generator",
subcommands: [CreateFolderHierarchy.self,
GenerateCatalog.self,
ConvertRoom.self])
}Interpretation
The branches represent separate entry-bearing project variants in the downloaded bundle, not runtime calls between those variants. Each branch is intentionally collapsed at the documented framework boundary; the detailed target-local flow remains in the cited files. Ownership is claimed only where the next section cites a stored property or assignment.
Ownership and state
classDiagram
RoomPlanCatalogGenerator *-- CommandConfiguration : configuration
CreateFolderHierarchy *-- CommandConfiguration : configuration
Options *-- String : inputPath
Options o-- Options : options
Ownership evidence
RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift:16 — stored dependency or nearest verified ownership anchor
@main
struct RoomPlanCatalogGenerator: ParsableCommand {
// ...
}| Owner | Object or state | Relationship | Mutation authority |
|---|---|---|---|
RoomPlanCatalogGenerator |
CommandConfiguration (configuration) |
creates and retains | Initialized by the owner; the binding is immutable |
CreateFolderHierarchy |
CommandConfiguration (configuration) |
creates and retains | Initialized by the owner; the binding is immutable |
Options |
String (inputPath) |
owns value state | App/module collaborators |
Options |
Options (options) |
stores or receives | App/module collaborators |
Composition arrows indicate a source-visible construction expression or locally owned value state; aggregation means the owner stores or receives a dependency without proving exclusive lifetime ownership.
Concurrency, scheduling, and thread safety
Evidence limit: actor isolation, async/await, or Task creation does not by itself prove background-thread execution; Sendable conformance alone does not prove thread-safe mutation.
No source-visible execution, scheduling, or synchronization boundary was found in the indexed source.
@MainActor/MainActor.run, DispatchQueue.main, and RunLoop.main are reported as distinct isolation, queue, and event-loop mechanisms. A plain Task is kept separate from Task.detached; neither is labeled as a background thread.
State propagation, frameworks, and dependencies
Evidence limit: an import proves a source-level compilation dependency at the cited line; it does not prove runtime use, architectural adoption, or whether a Swift package is a direct application dependency.
| Category | Mechanism or module | Verified role | Evidence |
|---|---|---|---|
| State propagation | SwiftUI state property wrapper |
A SwiftUI property wrapper supplies or observes UI state. | RoomPlanExporter/ContentView.swift:50 |
| Source import | Foundation |
The cited file imports this module; runtime use and architectural role are not inferred. | RoomPlanCatalogGenerator/RoomPlanCatalog.swift:8 |
| Source import | RoomPlan |
The cited file imports this module; runtime use and architectural role are not inferred. | RoomPlanCatalogGenerator/RoomPlanCatalog.swift:9 |
| Source import | os |
The cited file imports this module; runtime use and architectural role are not inferred. | RoomPlanCatalogGenerator/RoomPlanCatalog.swift:11 |
| Source import | SwiftUI |
The cited file imports this module; runtime use and architectural role are not inferred. | RoomPlanExporter/ContentView.swift:8 |
| Source import | ArgumentParser |
The cited file imports this module; runtime use and architectural role are not inferred. | RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift:9 |
| Source import | ModelIO |
The cited file imports this module; runtime use and architectural role are not inferred. | RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift:10 |
receive(on:) describes downstream delivery scheduling, while subscribe(on:) describes upstream subscription/request/cancel scheduling. An import Combine alone establishes neither behavior nor a Store, reducer, Redux, or other application architecture.
Class and protocol design
RoomPlanExporter/RoomPlanExporterApp.swift:12 — representative type boundary
@main
struct RoomPlanExporterApp: App {
// ...
ContentView()
// ...
}| Type | Responsibility | Depends on or conforms to |
|---|---|---|
RoomPlanExporterApp |
Application entry and top-level composition | App |
RoomPlanCatalogGenerator |
Generates feature data or resources | ParsableCommand |
ContentView |
User-interface presentation and input forwarding | View |
GeneratorError |
Represents feature failure conditions | LocalizedError |
CreateFolderHierarchy |
Represents a feature value or composable behavior | ParsableCommand |
Options |
Carries feature or framework configuration | ParsableArguments |
GenerateCatalog |
Represents a feature value or composable behavior | ParsableCommand |
Options |
Carries feature or framework configuration | ParsableArguments |
ConvertRoom |
Represents a feature value or composable behavior | ParsableCommand |
Options |
Carries feature or framework configuration | ParsableArguments |
No local protocol conformance is claimed as protocol-oriented design; external framework conformances are listed only as dependencies.
Access control
| Symbol | Access | Verified effect | Likely rationale |
|---|---|---|---|
modelFilename (RoomPlanCatalogGenerator/RoomPlanCatalog.swift:102) |
private(set) |
Read access follows the declaration; writes remain in the private scope. | Inference: allow observation while reserving invariant-changing writes for the owner. |
defaultCategoryAttributeFolderName (RoomPlanCatalogGenerator/RoomPlanCatalog.swift:108) |
private |
Use is restricted to the lexical declaration and same-file extensions allowed by Swift. | Inference: keep state mutation or dependency lifetime inside the owning implementation. |
generateFolderRelativePath (RoomPlanCatalogGenerator/RoomPlanCatalog.swift:145) |
private |
Use is restricted to the lexical declaration and same-file extensions allowed by Swift. | Inference: hide an implementation step that is not part of the collaboration surface. |
chechInputURL (RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift:184) |
private |
Use is restricted to the lexical declaration and same-file extensions allowed by Swift. | Inference: hide an implementation step that is not part of the collaboration surface. |
Reference code
RoomPlanCatalogGenerator/RoomPlanCatalog.swift:102 — representative boundary
struct RoomPlanCatalogCategoryAttribute: Codable {
// ...
private(set) var modelFilename: String? = nil
// ...
}Swift declarations without a modifier are internal; explicit private, fileprivate, private(set), public, or open entries above are interpreted by language semantics. Objective-C/C samples instead rely on header and implementation boundaries, which are not equivalent to Swift lexical privacy.
Logic ownership and placement
| Logic | Owning type or file | Placement rationale |
|---|---|---|
| Application entry and top-level composition | RoomPlanExporterApp |
The source’s App suffix makes this role explicit. |
| Generates feature data or resources | RoomPlanCatalogGenerator |
The source’s Generator suffix makes this role explicit. |
| User-interface presentation and input forwarding | ContentView |
The source’s View suffix makes this role explicit. |
Design patterns
| Pattern | Source evidence | Purpose or tradeoff |
|---|---|---|
| No named application pattern | RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift:14 |
The verified source directly composes concrete framework types; this document avoids forcing a pattern name. |
Naming conventions
- Types: App: RoomPlanExporterApp; Generator: RoomPlanCatalogGenerator; View: ContentView.
- Protocols: no local protocol declaration in the scanned source.
- Methods:
run,chechInputURL,writeCatalog,createModel,createUSDC,cleanCatalogPackage,load,export. - Files:
RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift,RoomPlanExporter/RoomPlanExporterApp.swift,RoomPlanExporter/ContentView.swift,RoomPlanCatalogGenerator/RoomPlanCatalog.swift.
Architecture takeaways
RoomPlanCatalogGeneratoris the main source-visible entry or composition anchor for this sample.- Framework work reaches RoomPlan, SwiftUI, ArgumentParser, ModelIO through a deliberately small high-level chain; the detailed API graph remains inside the cited implementation files.
- Stored-property evidence identifies lifecycle collaboration; it does not by itself prove exclusive object ownership.
- Access-control conclusions separate verified language visibility from the likely design rationale.
- The source does not justify labeling the design protocol-oriented.
Source map
| Source file | Relevant symbols |
|---|---|
RoomPlanCatalogGenerator/RoomPlanCatalogGenerator.swift |
Cited implementation, ArgumentParser, ModelIO, RoomPlanCatalogGenerator, GeneratorError, CreateFolderHierarchy, Options, GenerateCatalog, ConvertRoom |
RoomPlanExporter/RoomPlanExporterApp.swift |
RoomPlanExporterApp |
RoomPlanCatalogGenerator/RoomPlanCatalog.swift |
Cited implementation, Foundation, RoomPlan, os, RoomPlanCatalog, RoomPlanCatalogCategoryAttribute, CodingKeys |
RoomPlanExporter/ContentView.swift |
SwiftUI state property wrapper, SwiftUI, CatalogError, ContentView, ExportState, ContentView_Previews |
RoomPlanCatalogGenerator/URL+CatalogExtensions.swift |
Feature implementation |