SCNView merging two SCNNode

I’m working with Apple’s RoomPlan and I’m struggling to load all the nodes from the CapturedStructure into SCNNode.
I was able to browse through the floors, doors, windows, walls and object and render them in the view, but I’m struggling to add whole in the wall for the windows or the whole in the wall for the openings, for example.

I have tried several solutions and I was able to render the usdz file into the SCNView, and I noticed that usually the window and the wall are in a group and that was the last thing I tried.

This is the code that I’m using to merge the wall and the opening together, but I had no success, even the window isn’t working as expected.

    func createWallWithOpenings(wall: CapturedRoom.Surface, openings: [CapturedRoom.Surface]) -> SCNNode {
        let wallNode = SCNNode()
        
        // Define the wall geometry
        let wallWidth = CGFloat(wall.dimensions.x)
        let wallHeight = CGFloat(wall.dimensions.y)
        let wallThickness: CGFloat = 0.01
        let wallGeometry = SCNBox(width: wallWidth, height: wallHeight, length: wallThickness, chamferRadius: 0)
        
        // Create the wall node
        let wall2 = SCNNode(geometry: wallGeometry)
        wall2.simdTransform = wall.transform
//        wall2.position = SCNVector3(wall.transform.position.x, wall.transform.position.y, wall.transform.position.z)
        
        // Create materials
        let wallMaterial = SCNMaterial()
        wallMaterial.diffuse.contents = UIColor.gray // Your wall texture or color
        wallMaterial.blendMode = .alpha
        wall2.geometry?.materials = [wallMaterial]
        
        // Add wall node to wallNode
        wallNode.addChildNode(wall2)
        
        // Subtract openings
        for opening in openings {
            if opening.parentIdentifier == wall.identifier {
                let openingWidth = CGFloat(opening.dimensions.x)
                let openingHeight = CGFloat(opening.dimensions.y)
                let openingThickness: CGFloat = 0.4
                let openingGeometry = SCNBox(width: openingWidth, height: openingHeight, length: openingThickness, chamferRadius: 0)
                let openingNode = SCNNode(geometry: openingGeometry)
                openingNode.simdTransform = opening.transform
//                openingNode.position = SCNVector3(opening.transform.columns.3.x, opening.transform.columns.3.y, opening.transform.columns.3.z)
                
                // Create material for the opening (transparent)
                let openingMaterial = SCNMaterial()
                openingMaterial.diffuse.contents = UIImage(named: "window-texture.png")
                openingMaterial.emission.contents = UIColor.clear
                openingMaterial.isDoubleSided = true
                openingMaterial.blendMode = .alpha
                openingNode.geometry?.materials = [openingMaterial]
                
                // Subtract the opening from the wall
                wallNode.addChildNode(openingNode)
            }
        }
        return wallNode
    }

As you can see in the image below, you can notice that the wall neither the wall nor the opening is transparent, even though I positioned them correctly in the Scene.

I would appreciate any help here, because I’m running out of ideas and it should be possible to be done, because when I render the usdz file, I can see all the nodes and the window and the openings are there and the only reason I don’t use the object rendered by the usdz is that I lose some information like:

  1. Node width, node height, material and so on

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật