How to set separate uv coordinates for connected vertex that belongs to a different group?

I’ve created this buffergeometry which is basically a slim box. I wanted to wrap a single texture around the geometry.

Just like this

Unfortunately, I can’t set separate UV coordinates to the vertices in the corners of the box.
Note this is an indexed geometry.

I was able to set different groupings for the planes but uv still uses the vertex indices when mapping

Is there a way to set separate UV coordinates for each vertex grouping on an indexed geometry?

Notice that the count of vertices, normals, colors and texture coordinates in the related WebGL buffers always have to match. It can’t be different. So the only way to solve your issue is to duplicate the corner vertices and then define different texture coordinates.

So the only way to do this is with unindexed geometry?

Maybe you can use some of my construction.

See Magic Box:


See also Addon to create special / extended geometries

It can be indexed but you have to duplicate the corner vertices. Depending on the geometry, it makes more sense to use a non-indexed geometry. Especially if not vertex data are shared anyway.

Yeah you’re right. Non-indexed would definitely make more sense. Thanks