【NX二次开发】获取体的面

获取体的面

int getBodyFaces(tag_t tagBody, int iType, vector<tag_t> *vecFaces)
{
    uf_list_p_t list1 = NULL;
    UF_MODL_create_list(&list1);
    double douFaceBox[6];
    double  douOFaceRadius;
    double  douFaceRadData;
    int  iFaceNormDir;
    int  iFaceType;
    double douFacePoint[3];
    double douFaceDir[3];

    UF_MODL_ask_body_faces(tagBody, &list1);
    int count = 0;
    UF_MODL_ask_list_count(list1, &count);
    for (int i = 0; i < count; i++)
    {
        tag_t tagPlane = NULL_TAG;
        UF_MODL_ask_list_item(list1, i, &tagPlane);
        UF_MODL_ask_face_data(tagPlane, &iFaceType, douFacePoint, douFaceDir, douFaceBox, 
            &douOFaceRadius, &douFaceRadData, &iFaceNormDir);
        if ((iType == -1) || (iFaceType == iType))
        {
            (*vecFaces).push_back(tagPlane);
        }
    }
    UF_free(list1);
    list1 = NULL;
    return 0;
}

iType:

17 UF_cone_type 圆锥面
18 UF_sphere_type 球面
19 UF_surface_of_revolution_type  
20 UF_tabulated_cylinder_type  
22 UF_bounded_plane_type 有界平面
23 UF_blended_face_type  
43 UF_b_surface_type  
65 UF_offset_surface_type  
66 UF_foreign_surface_type  
-1   所有面
posted @ 2022-06-17 14:19  王牌飞行员_里海  阅读(165)  评论(0编辑  收藏  举报