Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfianlosari/usdzscanner
SPM USDZ Lidar Scanner/Capture for iOS based on Apple Object Capture Sample Code
https://github.com/alfianlosari/usdzscanner
arkit library photogrammetry swift swiftui usdz usdzcapture usdzscanner
Last synced: about 2 months ago
JSON representation
SPM USDZ Lidar Scanner/Capture for iOS based on Apple Object Capture Sample Code
- Host: GitHub
- URL: https://github.com/alfianlosari/usdzscanner
- Owner: alfianlosari
- License: other
- Created: 2023-09-02T00:53:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-23T20:25:03.000Z (11 months ago)
- Last Synced: 2024-07-30T19:51:44.445Z (5 months ago)
- Topics: arkit, library, photogrammetry, swift, swiftui, usdz, usdzcapture, usdzscanner
- Language: Swift
- Homepage:
- Size: 10.8 MB
- Stars: 36
- Watchers: 2
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# USDZScanner
A SwiftUI USDZ Object Scanner for Capturing Real Life Objects and transforming to USDZ file using Photogrametry.
This is just a SPM wrapper based on the original [Apple Object Capture Sample Code](https://developer.apple.com/documentation/realitykit/guided-capture-sample)
## Requirements
- iPhone or iPad with a LiDAR Scanner and an A14 Bionic chip or later
- iOS or iPadOS 17 or later## Installation
### Swift Package Manager
- File > Swift Packages > Add Package Dependency
- Add https://github.com/alfianlosari/USDZScanner.gitYou must add `Privacy - Camera Usage Description` permission in your App Info.plist to use the scanner.
## Usage
Initialize USDZScanner passing the completion callback. The completion contains a parameter for the URL where it stored the USDZ file.
```swift
import SwiftUI
import USDZScanner@main
struct SampleApp: App {@State var isScanObjectPresenting = false
@State var url: URL?
var body: some Scene {
WindowGroup {
VStack {
Button("Scan Object") {
isScanObjectPresenting = true
}
if let url {
Text(url.absoluteString)
}
}
.sheet(isPresented: $isScanObjectPresenting, content: {
USDZScanner { url in
self.url = url
isScanObjectPresenting = false
}
})
}
}
}
```