# How can get angle of uv?

**URL:** <https://forums.sketchup.com/t/how-can-get-angle-of-uv/275620>\
**Category:** SketchUp SDK\
**Tags:** sketchup, uv\
**Created:** [May 31, 2024, 1:36am UTC](https://forums.sketchup.com/t/how-can-get-angle-of-uv/275620 "2024-05-31T01:36:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![javalitterboy](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/javalitterboy/32/170896_2.png) [@javalitterboy](https://forums.sketchup.com/u/javalitterboy)\
**Post date:** [May 31, 2024, 1:36am UTC](https://forums.sketchup.com/t/how-can-get-angle-of-uv/275620/1 "2024-05-31T01:36:23Z")

</div>

I want to obtain the rotation angle of the texture. At first, I thought it was p1, and p2 corresponds to the horizontal direction of the rotation and texture. Later, I found that the order of the UV thumbnails was not correct.

[test.skp](https://forums.sketchup.com/uploads/short-url/nK9ey1IbqGelLVNNwkdualzuRVl.skp) (121.8 KB)

```auto
SUPoint3D origin{ 0,0,0 };
SUPoint3D points[4] = { { 0,0,0 } ,{ 0,0,0 } ,{ 0,0,0 } ,{ 0,0,0 } };
SUPoint2D uv_points[4] = { { 0,0 } ,{ 0,0 } ,{ 0,0 } ,{ 0,0 } };

size_t vertex_num = 0;
SUFaceGetNumVertices(face, &vertex_num);
std::vector<SUVertexRef> vertices(vertex_num);
SUFaceGetVertices(face, vertex_num, &vertices[0], &vertex_num);
SUVertexGetPosition(vertices[0],&origin);
SUFaceGetUVTileAt(face, &origin, true, points, uv_points);

FILE* fp = fopen("D:/cad.log", "a");

fprintf(fp, "%f,%f,%f\n", points[0].x, points[0].y, points[0].z);
fprintf(fp, "%f,%f,%f\n", points[1].x, points[1].y, points[1].z);
fprintf(fp, "%f,%f,%f\n", points[2].x, points[2].y, points[2].z);
fprintf(fp, "%f,%f,%f\n\n", points[3].x, points[3].y, points[3].z);

fprintf(fp, "%f,%f\n", uv_points[0].x, uv_points[0].y);
fprintf(fp, "%f,%f\n", uv_points[1].x, uv_points[1].y);
fprintf(fp, "%f,%f\n", uv_points[2].x, uv_points[2].y);
fprintf(fp, "%f,%f\n\n", uv_points[3].x, uv_points[3].y);
fclose(fp);

```

**OUT\_PUT**

```plaintext
141.978133,19.489528,8.351655
133.626478,19.489528,16.703310
141.978133,19.489528,25.054965
150.329788,19.489528,16.703310

-8.000000,9.000000
-7.000000,9.000000
-7.000000,10.000000
-8.000000,10.000000

41.758274,0.000091,75.164894
33.406620,0.000085,83.516549
41.758274,0.000100,91.868204
50.109929,0.000105,83.516549

2.000000,7.000000
3.000000,7.000000
3.000000,8.000000
2.000000,8.000000

```

**red green yellow blue**

 ![AO%DS048NLC9`37RY@KFS$0](https://global.discourse-cdn.com/sketchup/original/3X/b/b/bb969ddc564e99b7713c39241ed7663bc84d05ce.jpeg)

**red yellow green blue**  
 ![O(G240(SZ$W28PGR94_48W0](https://global.discourse-cdn.com/sketchup/original/3X/7/0/7096cd1c7a440d549bd08f9b26b7a3f313fa7cfe.png)
