A SketchUp model is organized as a hierarchy of Sketchup::Entities / SUEntitiesRef (either at top-level or in component definitions). It is not a single mesh. The API and SDK give access to vertices per face/edge, starting from zero for each. That means the vertex index lists of two given faces both have an index 0 but for a different vertices.
If by “this” you mean a single index list for all (triangulated) faces of a model, you need to create a function to map indices to new indices (The repetition in your example indicates that you just concatenated them without remapping).
If your model contains component instances, you need to merge them (simulate “Explode” in the SketchUp program), considering their transformation and that they may have multiple occurences (instance paths):
- Get all vertices and positions of the selected component definition.
- Get all instance paths of the component you are currently working on
[Model, ComponentInstance1, NestedComponentInstance2, SelectedComponentInstance], …
- For each instance path, multiply the transformations of the involved parent component instances.
- Apply the transformation to the vertex positions and insert them as new positions into your merged mesh.
- Map (a copy of) the original vertex indices to point to the new positions. Then insert these new indices to your merged mesh’s indices.