RoomPlan: How to track rooms across a CapturedStructure.init(from:) call?

I'd like to be able to associate some data with each CapturedRoom scan and maintain those associations when CapturedRooms are combined in a CapturedStructure.

For example, in the delegate method captureView(didPresent:error:), I'd like to associate external data with the CapturedRoom. That's easy enough to do with a Swift dictionary, using the CapturedRoom's identifier as the key to the associated data.

However, when I assemble a list of CapturedRooms into a CapturedStructure using StructureBuilder.init(from:), the rooms in the output CapturedStructure have different identifiers so their associations to the external data are lost.

Is there any way to track or identify CapturedRoom objects that are input into a StructureBuilder to the rooms in the CapturedStructure output? I looked for something like a "userdata" property on a CapturedRoom that might be preserved, but couldn't find one. And since the room identifiers change when they are built into a CapturedStructure, I don't see an obvious way to do this.

Did you find a work around for this? I have noticed that when converting the room's to JSON, the room identifier is omitted in most cases, which doesn't help!!

I tried using a UUID in the name of the various JSON files, but once the array goes into the StructureBuilder, like you said, the room's no longer match. It's very frustrating!

I've looked into this a little more and I've noticed that window, door and floor identifiers seem to stay the same across the structure builder, so it might be possible to identify a room using a floor identifier?

I need to explore this more.

RoomPlan: How to track rooms across a CapturedStructure.init(from:) call?
 
 
Q