创建块并且指定一条边倒圆角

阅读: 评论:0

创建块并且指定一条边倒圆角

创建块并且指定一条边倒圆角

 /* TODO: Add your application code here */


char length[256]="100";
char width[256]="50";
char higth[256]="20";

double tolerance_mold;
UF_MODL_ask_distance_tolerance(&tolerance_mold);//获取系统设置中的公差


char char_radius[256]="5";

double double_length=atof(length);
double double_width=atof(width); 
double double_higth=atof(higth); 

double corner_pt[3]={0,0,0};      //定位原点
char * edge_len[3]={length,width,higth}; //大小(x,y,z)
tag_t blk_tag;
UF_MODL_create_block1(UF_NULLSIGN,corner_pt,edge_len,&blk_tag);  //创建方体


tag_t face1,face2;

tag_t obj=NULL_TAG;
uf_list_p_t face_list;
UF_MODL_create_list(&face_list);//创建链表
UF_MODL_ask_feat_faces(blk_tag,&face_list);//将所有面的tag值放入链表中。
int count=0;
UF_MODL_ask_list_count(face_list,&count);//查询链表中的面的数量
for(int i=0;i<count;i++)
{
UF_MODL_ask_list_item(face_list,i,&obj);//查询列表中的对象 上面的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(obj,&type,point,dir,box,&radius,&rad_data,&norm_dir);//查询与面有关的数据,输入obj,输出type
if(type==22)//“22”代表有界平面
    {
                  if(fabs(point[2]-double_higth)<tolerance_mold)
                  {
                      face1=obj;
                  }
                        if(fabs(point[0]-double_length)<tolerance_mold)
                  {
                      face2=obj;
                  }
         int typel;
         UF_MODL_ask_face_type(obj,&typel);

         if(typel==UF_MODL_PLANAR_FACE )
         {
         uf_list_p_t blend_face;
         UF_MODL_create_list(&blend_face);
         UF_MODL_ask_shared_edges(face1,face2,&blend_face);//查新面的交线
            const char * radius=char_radius;
             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 );
         }
    }
}

    /* Terminate the API environment */

本文发布于:2024-01-30 03:47:27,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170655765119006.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

上一篇:算法
下一篇:tkinter学习
标签:圆角
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23