I am using this gist to import a binary STL 3d mesh into a SCNNode, which works fine (I can view the mesh in a SCNView and it looks good).
However, if I try to export the (unchanged) mesh using either MDLAsset.export(to: url)
or SCNScene.write(to: url)
to an STL or OBJ file, the resulting mesh is broken.
If I load the example ship.scn
scene and then export to STL, everything looks good.
This makes me think that there must be something wrong about how the above mentioned gist creates the SCNNode, but I can't figure out what it is.