grantespo
grantespo

Reputation: 2269

LiDAR: export ARReferenceObject as .obj

Since LiDAR has been built into the newest 2020+ iOS devices (iPhone 12 Pro, iPad Pro).

ARKit has more possibilities than ever, including support for exporting to .obj.

Here is the code for exporting a ARReferenceObject to .arobject

guard let testRun = self.testRun, 
      let object = testRun.referenceObject, 
      let name = object.name 
else {
    print("Error: Missing scanned object.")
    return
}
    
let documentURL = FileManager.default.temporaryDirectory
                             .appendingPathComponent(name + ".arobject")
    
DispatchQueue.global().async {
    do {
        try object.export(to: documentURL, 
                previewImage: testRun.previewImage)
    } catch {
        fatalError("Failed to save the file to \(documentURL)")
    }
}

How do you export as .obj?

Upvotes: 1

Views: 727

Answers (1)

Andy Jazz
Andy Jazz

Reputation: 58093

Sparse point cloud contained in .arobject file can't be exported as 3D geometry.

So the answer is: NO.

Upvotes: 1

Related Questions