Hi community,We have some of the generated usdz files need to be convert to CapturedRoom object or JSON format. But we haven't found the relevant method.Can you tell me how to do this
RoomPlan/usdz, how to convert usdz to CapturedRoom or JSON?
Hi. Thank you for this question.
You don't need to convert a usdz to JSON in your example. You can convert the CapturedRoom object to JSON with this free library: https://github.com/fhstp/swift-roomplan-jsonexport.git
I have tried to find a way to convert usdz to JSON but have not found any libs that can do this. The above works for CapturedRoom to JSON.
Best regards, Mladen
you can convert encode of CapturedRoom, convert finalResults to Json
let encoder = JSONEncoder()do {
let jsonData = try encoder.encode(finalResults)
let jsonString = String(data: jsonData, encoding: .utf8)
print(jsonString)
} catch {
print("Error encoding object to JSON: \(error.localizedDescription)")
}