Hello @brandonK212
I tried out your code sample, but can't get the PLY file as an output. I've pressed the save button many times, but the file does not appear in any of my File folders.
My viewDidLoad looks something like this :
override func viewDidLoad() {
super.viewDidLoad()
// Setup a save button
let button = UIButton(type: .system, primaryAction: UIAction(title: "Save", handler: { (action) in
self.renderer.savePointsToFile()
}))
button.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(button)
NSLayoutConstraint.activate([
button.centerXAnchor.constraint(equalTo: self.view.centerXAnchor),
button.centerYAnchor.constraint(equalTo: self.view.centerYAnchor)
])
guard let device = MTLCreateSystemDefaultDevice() else {
print("Metal is not supported on this device")
return
}
And i've put the savePointsToFile in the Render.swift, but it only allows me to define it as func not "private func", because of the error - savePointsToFile' is inaccessible due to 'private' protection level.
func savePointsToFile() {
guard !self.isSavingFile else { return }
self.isSavingFile = true
..
I'm still figuring out Swift, would be great to hear feedback from you, or other developers, to fix this issue.