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)
        }
Texture not appling on roomplan wall object (capturedata)
 
 
Q