What 3D model formats are supported by ARKit? Does someone know all supported formats for using in ARKit, and which format Xcode can export to use in app?
Ever since its invention, the STL file format has been readily adopted by the rapid prototyping, 3D printing, and computer-aided manufacturing industries. It's still the most widely used file format in 3D printing.
DAE and OBJ/MTL are automatically supported, in the sense that you can just drop the files in the .scnassets folder and it will handle them for you. Personally, I had fewer issues with OBJ/MTL but I'm not well versed in 3D.
The documentation for Model I/O states that you can import 3D assets from the following files
The set of supported formats includes Alembic (.abc), Wavefront Object (.obj), Polygon (.ply), and Standard Tessellation Language (.stl). Additional formats may be supported as well.
I've not worked with this framework though, so can't tell you how well does it work with ARKit.
And you may want to have a look at AssimpKit which allows to export several formats to .scn SceneKit scenes
ARKit itself doesn't read any 3D formats. Only rendering engines can do it.
SceneKit
and RealityKit
frameworks are satellites of ARKit, so they can read in poly geometry supporting several popular 3D file formats at the moment. If SceneKit or RealityKit can't read a file, you can covert it using usdzconvert Terminal command into USDZ.
Collada's Digital Asset Exchange .dae
(SceneKit)
Pixar's Zipped Universal Scene Description .usdz
(SceneKit and RealityKit)
Pixar's ASCII Universal Scene Description .usda
(needs conversion)
Pixar's Binary Universal Scene Description .usd
and .usdc
(needs conversion)
Reality Composer format .rcproject
(RealityKit)
Reality Composer format .reality
(works faster in RealityKit)
Wavefront Object .obj
along with material .mtl
(needs conversion)
Alembic Interchange File Format .abc
(needs conversion)
Polygon File Format .ply
(needs conversion)
Autodesk Filmbox Format .fbx
(needs conversion)
Graphics Library Transmission Format .glTF
(needs conversion)
Stereolithography File Format .stl
(needs conversion)
Native Scene Format .scn
(SceneKit)
The best way to use those formats is to initialize SCNScene
from MDLAssset like this:
import SceneKit.ModelIO
guard let url = Bundle.main.url(forResource: fileName, withExtension: "usdz")
else {
fatalError()
}
let mdlAsset = MDLAsset(url: url)
let scene = SCNScene(mdlAsset: mdlAsset)
The full set of file types documented as supported by the Model I/O framework can be found here:
https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension
The set of supported extensions and formats includes:
- .abc Alembic
- .usd, .usda, .usdc Universal Scene Description
- .usdz Universal Scene Description (Mobile)
- .ply Polygon
- .obj Wavefront Object
- .stl Standard Tessellation Language
Additional formats may be supported as well.
It looks like Apple's new preferred file type for ARKit on iOS (as of iOS 12) is their own usdz:
https://developer.apple.com/augmented-reality/quick-look/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With