Decombine script or recalculate part of mesh?

hi there. im looking for solution for pretty complicated problem, this tool may rly help me. so, the question is:

is there some kind of "decombine" script? (for example get a part of mesh and assign it to another mesh filter)

i need it cos i want to add some triangles to pretty huge model via runtime, and may be "decombine" will be nice solution. (get part of mesh, change ammount of triangles, combine it back)

tyvm for all responds :)

Creating a new mesh from part of another mesh provides some interesting difficulties:

  1. Creating a new mesh is as easy as `var mesh = new Mesh();`.

  2. Another task is getting the vertex arrays from the first mesh. If you are simply doing a distance check, then it isn't very hard. If you want complex shapes, then you will have to to find an algorithm that isolates only the vertices you want- maybe use vertex color.

  3. Recreating the triangle arrays is probably going to be the hardest part. If you are lucky and removing a submesh, that will save you some time. Otherwise. Same as above. You will need to procedurally recreate the triangle indices.

Decombining a mesh won't come easily. Your best option would be to store the vertex and triangle indices before you combine the mesh so that you can take it apart more easily.