1 uf_list_p_t FaceList; 2 UF_MODL_ask_body_faces(ObjectTag, &FaceList); 3 4 5 //获取链表数量 6 int Count; 7 UF_MODL_ask_list_count(FaceList, &Count); 8 9 //UF_UI_open_listing_window(); 10 //获取链表里的tag 11 for (int i = 0; i < Count; i++) 12 { 13 tag_t FaceTag = NULL_TAG; 14 UF_MODL_ask_list_item(FaceList, i, &FaceTag); 15 16 //获取面的法向 17 int Type; 18 double Point[3]; 19 double Dir[3]; 20 double Box[6]; 21 double Radius[3]; 22 double RadData[3]; 23 int NormDir; 24 UF_MODL_ask_face_data(FaceTag, &Type, Point, Dir, Box, Radius, RadData, &NormDir); 25 26 //找面 27 if (Type == 22 &&Dir[2]==1)//对比面的类型 28 { 29 //对面设置颜色 30 //srand(i+5); 31 int kk=rand()%216+1; 32 33 UF_OBJ_set_color(FaceTag, kk); 34 sprintf_s(msg, "面的高度为:%.4f\n%d\n",Box[5],kk); 35 36 }
原文:https://www.cnblogs.com/liuxiaoqing1/p/12184532.html