this is the texture:

I have a box which I build by hand, trying to create the textcoordinates for the top face of the box using top1 - top4 coordinates.
I build all faces according to https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes
like this:
22 --3
| | Counter-clockwise
| |
0--1 1
and indices like { 2,0,1, 1,3,2 };
for all other faces I use t1 - t4 and I dont see any problem, but for topface I run into problems which you see in the screenshot. Any ideas why this doesn't work?
Vector2f t1 = new Vector2f(0, 0);
Vector2f t2 = new Vector2f(0.5f, 0);
Vector2f t3 = new Vector2f(0, 0.5f);
Vector2f t4 = new Vector2f(0.5f, 0.5f);
Vector2f top1 = new Vector2f(0.5f, 0.5f);
Vector2f top2 = new Vector2f(1.0f, 0.0f);
Vector2f top3 = new Vector2f(0.0f, 1.0f);
Vector2f top4 = new Vector2f(1.0f, 1.0f);
later in the code...
if(faces[topFace] == 1)
{
verticesSize = vertices.size();
vertices.add(pc);
vertices.add(pd);
vertices.add(pg);
vertices.add(ph);
normals.add(normal);
texCoord.add(top1);
texCoord.add(top2);
texCoord.add(top3);
texCoord.add(top4);
indexes.add(verticesSize+2);
indexes.add(verticesSize+0);
indexes.add(verticesSize+1);
indexes.add(verticesSize+1);
indexes.add(verticesSize+3);
indexes.add(verticesSize+2);
}