RoomPlan

RSS for tag

Create parametric 3D scans of rooms and room-defining objects.

Posts under RoomPlan tag

69 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How can I use this code in ContentView with the default augmented reality template provided by Xcode
Hey guys, I hope you are all doing well! I am really stuck on a problem and I need help here. I am new to Swift but I need to use Swift to complete a project. I am trying to use this code https://github.com/jmousseau/RoomObjectReplicatorDemo/blob/main/RoomObjectReplicatorDemo/ViewController.swift with the RoomObjectReplicator library https://github.com/jmousseau/RoomObjectReplicator. However, the issue is that my app is currently using SwiftUI and not UIKit. Furthermore, I have ContentView and ARViewContainer. How can I implement the code but use ContentView and ARViewContainer along with SwiftUI? Thanks in advance!
0
0
445
Dec ’23
Structure Builder crashing with EXC_BAD_ACCESS
A case occured where the Structure Builder is crashing with EXC_BAD_ACCESS and the error cannot be handled without the app crashing. I have two minimalistic models, one even reduced to the minimum of the "coreModel" itself. (See attachment) Each model alone in the StructureBuilder works fine. Using both causes the crash. Has anyone found a way to handle this error without the app crashing? override func viewDidLoad() { super.viewDidLoad() let capturedRooms: [CapturedRoom] = [ loadCapturedRoom(fileName: "appleModel1"), loadCapturedRoom(fileName: "appleModel2") ] buildStructure(capturedRooms) } func buildStructure(_ capturedRooms: [CapturedRoom]) { let structureBuilder = StructureBuilder(options: []) Task { print("----- START BUILDING STRUCTURE -----") do { let capturedStructure = try await structureBuilder.capturedStructure(from: capturedRooms) } catch { print("----- FAILED BUILDING STRUCTURE -----") } // Crashing with: EXC_BAD_ACCESS // This part will never be reached print("----- FINISH BUILDING STRUCTURE -----") } } func loadCapturedRoom(fileName: String) -> CapturedRoom { do { guard let jsonFileURL = Bundle.main.url(forResource: fileName, withExtension: "json") else { fatalError("JSON file not found.") } let data = try Data(contentsOf: jsonFileURL) return try JSONDecoder().decode(CapturedRoom.self, from: data) } catch { fatalError(error.localizedDescription) } } appleModel1.json appleModel2.json
2
1
610
Dec ’23
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.
3
1
766
Jun ’24
Texture not appling on roomplan wall object (capturedata)
We are attempting to update the texture on a node. The code below works correctly when we use a color, but it encounters issues when we attempt to use an image. The image is available in the bundle, and it image correctly in other parts of our application. This texture is being applied to both the floor and the wall. Please assist us with this issue." for obj in Floor_grp[0].childNodes { let node = obj.flattenedClone() node.transform = obj.transform let imageMaterial = SCNMaterial() node.geometry?.materials = [imageMaterial] node.geometry?.firstMaterial?.diffuse.contents = UIColor.brown obj.removeFromParentNode() Floor_grp[0].addChildNode(node) }
1
0
653
Sep ’24