I found a script that calculates 3D models and combines identical vertices. It has the following logic, where according to my understanding, vertices are hash maps of vertex class:
unless vertices.key?(vertex)
new_vertices << vertex
vertices[ vertex ] = @vertex_index
@vertex_index += 1
end
If we find a vertex
that is unique, we add it to the new_vertices
array.
I'd like to modify this so that the key for the hash map is a combination of a vertex and a material (both are classes from Sketchup, which is the software this script runs in). What is the best way to do this so that each key is a combination of two classes instead of one? Some sort of duple or class holding both the vertex and the material? Is that supported by a hash map?