单个面倒C角,倒圆角
作者:互联网
double mold_tolerance;
UF_MODL_ask_distance_tolerance(&mold_tolerance);
UF_FEATURE_SIGN sign = UF_NULLSIGN;
char *length_plate="80";
char *width_plate="50";
char *heigh_plate="20";
double plate_center[3]={0,-25,0}; //定位原点
char * plate_dim[3]={length_plate,width_plate,heigh_plate}; //大小(x,y,z)
tag_t plate_tag=NULL_TAG;
UF_MODL_create_block1(sign,plate_center,plate_dim,&plate_tag);
double d_length_plate=atof(length_plate) ;
double d_width_plate=atof(width_plate);
double d_heigh_plate=atof(heigh_plate);
uf_list_p_t face_list;
UF_MODL_create_list(&face_list);//Retrieves an object from a linked list of objects
UF_MODL_ask_feat_faces(plate_tag,&face_list);
int count=0;
UF_MODL_ask_list_count(face_list,&count);
//倒C角
for(int i=0;i<count;i++)
{
tag_t face1,face2;
tag_t obj2=NULL_TAG;
UF_MODL_ask_list_item(face_list,i,&obj2);//查询列表中的对象 上面的facelist
int type;
double point [3] ;
double dir [3] ;
double box [6] ;
double radius;
double rad_data;
int norm_dir ;
UF_MODL_ask_face_data(obj2,&type,point,dir,box,&radius,&rad_data,&norm_dir);//查询与面有关的数据,输入obj,输出type
if(type==22)//“22”代表有界平面,该处还有其他值,可以查阅帮助
{
if(fabs(point[2]-d_heigh_plate)<mold_tolerance) {face1=obj2;}
if(fabs(point[0]-d_length_plate)<mold_tolerance) {face2=obj2;}
int typel;
UF_MODL_ask_face_type(obj2,&typel);
if(typel==UF_MODL_PLANAR_FACE )
{
uf_list_p_t cham_line;
UF_MODL_create_list(&cham_line);
UF_MODL_ask_shared_edges(face2,face1,&cham_line);//查新面的交线
tag_t ChamferTag;
UF_MODL_create_chamfer(5, "10", "10*tan(30)", "30", cham_line, &ChamferTag);
}
}
}
UF_MODL_delete_list(&face_list);
tag_t bodyTAG1=NULL_TAG ;
UF_MODL_ask_feat_body(plate_tag,&bodyTAG1);
uf_list_p_t face_list2;
UF_MODL_create_list(&face_list2);
UF_MODL_ask_body_faces(bodyTAG1,&face_list2);
int count1=0;
UF_MODL_ask_list_count(face_list2,&count1);
//倒圆角
tag_t face5,face6;
tag_t obj4=NULL_TAG;
for(int i=0;i<count1;i++)
{
UF_MODL_ask_list_item(face_list2,i,&obj4);//查询列表中的对象 上面的facelist
int type;
double point [3] ;
double dir [3] ;
double box [6] ;
double radius;
double rad_data;
int norm_dir ;
UF_MODL_ask_face_data(obj4,&type,point,dir,box,&radius,&rad_data,&norm_dir);//查询与面有关的数据,输入obj,输出type
if(type==22)//“22”代表有界平面,该处还有其他值,可以查阅帮助
{
if(fabs(point[2]-d_heigh_plate)<mold_tolerance) { face5=obj4; }
if(point[0]>70&&fabs(point[1])<25) { face6=obj4;}
int typel;
UF_MODL_ask_face_type(obj4,&typel);
if(typel==UF_MODL_PLANAR_FACE )
{
uf_list_p_t blend_face;
UF_MODL_create_list(&blend_face);
UF_MODL_ask_shared_edges(face5,face6,&blend_face);//查新面的交线
char *radius="5";
int smooth_overflow=0;
int cliff_overflow=0;
int notch_overflow=0;
double vrb_tool=3;
tag_t feature_obj_id;
UF_MODL_create_blend(radius, blend_face, smooth_overflow, cliff_overflow, notch_overflow, vrb_tool, &feature_obj_id );
}
}
}
UF_MODL_delete_list(&face_list2);
去参
tag_t body_obj_id;
UF_MODL_ask_feat_body (plate_tag,&body_obj_id); //查找体的特征
uf_list_p_t body_list; // 变量body_list为 对象列表
UF_MODL_create_list(&body_list); // 创建链表
UF_MODL_put_list_item(body_list, body_obj_id); //将长方体中的特征加入链表
UF_MODL_delete_body_parms(body_list);//删除对象列表所有对象参数
标签:plate,倒圆角,double,list,char,面倒,单个,UF,MODL 来源: https://blog.csdn.net/Ye_hr/article/details/123217918