I can't export or merge procedural mesh

dear richard:
we are working on a vr painting app similar to tiltbrush.
the meshes are procedually generated, driven from the controller movements.
in this example. an export feature is really critical to us.
because we need to implement an “save painting” and “export painting” feature.

dear dalih:
this sounds very clever to me. a simple and beautiful solution.
one question: If I use different materials in one mesh, how can I define those “material-slots” in OBJ Format?