Closed scottldouglas60 closed 1 year ago
Have you verified that previewVC
and pointCloud
are non-nil? If you change those ?
to !
, does it crash?
How are you looking in the installation folder? Downloading the app container via the Xcode organizer?
Hi aaptho!!!!
I have found the .ply files! When I use Xcode to download the container and view contents. The .ply reside in /tmp/SCMeshTexturing-xxxx where the xxx is placed by numbers generated at I expect compile/run time.
Im able to set my copy path to tmp, and copy files out to the Phones user Documents Folder.
print("Pressed Export Button") let temporaryFolderURL = URL(fileURLWithPath: NSTemporaryDirectory()) print("tmp folder is =",temporaryFolderURL)
tmp folder is = file:///private/var/mobile/Containers/Data/Application/9EE52650-19B6-4028-8F31-2ED882B4EFAD/tmp/
I am stuck how to set the path to the SCMeshTexturing-x folder if name changes all the time. Any help to a newbie Xcode developer is much appreciated.!!
Those tmp/SCMeshTexturing-{uuid}
files are only used during scanning for generating a textured mesh, not for saving the point cloud. The point cloud should already be in the app’s Documents directory when you used
let plyFile = documentsURL!.appendingPathComponent("myScan.ply”)
Does Documents/myScan.ply
exist in this case?
While iOS does have a system-wide Documents directory accessible with the Files app, your app can’t directly write to that one. Instead, each app’s documents directory is “containerized”, so it’s specific to that app.
See here for how to prompt the user to export a copy of the file to the shared Documents directory in Files, or to make your app’s Documents directory show up within Files on the device. https://stackoverflow.com/a/46457518
Absolutely crushed it. I added this code to the saveScene function and it wrote out a .ply.
SWEET
!!!!!1
scene.pointCloud?.writeToPLY(atPath: scenePlyURL.path)
Love this code - Thanks to the team at StandardCyborg for releasing to the public. I have the example app compiling and working nicely.
let plyFile = documentsURL!.appendingPathComponent("myScan.ply") previewVC?.pointCloud?.writeToPLY(atPath: plyFile.path)
I did find this function which I think I could wire to a button but in a previous issue members report that this method is not working correctly
scene.writeToGLTF(atPath: sceneGltfURL.path)
So how would I save out these files in the Documents folder.
Thanks for all the help!
SD