I have a code for unifying polyhedrons that looks like this:
std::vector toMerge; // filling "toMerge" with data here. Geometry g