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 (121.8 KB)
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
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
red yellow green blue