Search code examples
c#unity-game-enginegoogle-project-tango

Saving Unity mesh created from Tango's Meshbuilder


I want to be able to save the mesh I generate from the Unity mesh builder. From what I can tell the way most people save is with the point cloud data however, I would much rather have the mesh that is generated inside Unity or data so I can recreate the mesh generated in Unity . When I looked into some of the scripts I found a few scripts that seem to deal with the data that is involved with the mesh


CustomPointCloudListener.cs

DynamicMeshCube.cs

DynamicMeshManager.cs

Polygonizer.cs

Voxel.cs

VoxelHashTree.cs

https://github.com/googlesamples/tango-examples-unity/tree/master/UnityExamples/Assets/TangoExamples/ExperimentalMeshBuilder/Scripts


What would be the best way of getting the mesh? I was thinking of trying to save the data by modifying one of the scripts above but I'm not sure where to even start with this.

Edit: the main reason I don't want cloud point data is because I would have to run it through something like this https://blender.stackexchange.com/questions/7028/wrapping-a-mesh-around-point-cloud-with-cavities


Solution

  • I believe you want to look at the calls into the polygonizer, which is using enhanced marching cubes to extracting the surface. Work back from there to get your mesh (sorry, doing this from memory, don't have the code in front of me)