Crashalot
Crashalot

Reputation: 34523

SceneKit: export scene as STL file for 3D printing?

How can you export a SceneKit scene as a STL file (for 3D printing)?

The write function from SCNScene does not appear to support the STL format.

Upvotes: 1

Views: 1536

Answers (2)

mnuages
mnuages

Reputation: 13462

you can use SCNScene's write(to:options:delegate:progressHandler:).

While the online documentation only mentions Collada and SceneKit file formats, the header documentation states that:

macOS 10.10 and lower only supports exporting to .dae files.

Starting iOS 10 exporting supports .scn as well as all file formats supported by Model I/O.

Starting macOS 10.11 exporting supports .dae, .scn as well as file all formats supported by Model I/O.

Upvotes: 4

Hal Mueller
Hal Mueller

Reputation: 7655

The export function in ModelIO (MDLAsset) appears to support STL, but I've never tried it myself.

MDLAsset:export()

Upvotes: 1

Related Questions