Scenekit, Metal, Model I/O and MDLVoxelArray


#1

I’m trying to integrate SceneKit and Metal into an app, and have figured out how to save scans from the Structure Sensor as .obj files, then reimport them into my UI.

What I’d like to do is edit the imported meshes by turning them into voxels using Model I/O and MDLVoxelArray.

Sticking point is how to actually edit the voxel array.

Even something as simple as deleting voxels seems needlessly complicated.

I’ve tried finding some documentation, books, videos and Google, but can’t find any sample code that explains how to work with individual voxels.

The only function I have found—setVoxelAtIndex(_ index: MDLVoxelIndex)—has no documentation to even say how you set a sample, or what one is.

Any pointers?