简简单单 发表于 2014-12-9 10:01:50

创建块倒圆角

/*********************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <uf.h>
#include <uf_attr.h>
#include <uf_cfi.h>
#include <uf_curve.h>
#include <uf_ui.h>
#include <uf_modl.h>

/************* unload alloc mem *************************/
/* UF_UNLOAD_SEL_DIALOG _UG_TERMINATE _IMMEDIATELY */

extern void ufusr( char *param, int *retcod, int param_len )
{
UF_initialize();


double coner={0,0,0};
char *edge = {"10","50","20"};
tag_t blk_tag;
UF_MODL_create_block1(UF_NULLSIGN,coner,edge,&blk_tag);


UF_MODL_ask_feat_body(blk_tag,&blk_tag);
uf_list_p_t end_list;
UF_MODL_create_list(&end_list);
UF_MODL_ask_body_edges(blk_tag,&end_list);
int num;
UF_MODL_ask_list_count(end_list,&num);

char *radius ="2";
int smooth_overflow = 0;
int cliff_overflow = 0;
int notch_overflow = 0;
double vrb_tool = 0;
tag_t feature_obj_id ;
uf_list_p_t end_list2;
UF_MODL_create_list(&end_list2);
for (int i = 0; i < num ; i++)
{
tag_t tt,curve1;
UF_MODL_ask_list_item(end_list,i,&tt);
UF_MODL_create_curve_from_edge(tt,&curve1);        //抽取曲线
double point1 [ 3 ] ;
   double point2 [ 3 ] ;
   int vertex_count;
UF_MODL_ask_edge_verts(tt,point1,point2,&vertex_count);
if ((point1==point2)&(point1==point2))
{
   UF_MODL_put_list_item(end_list2,tt);
}
}
UF_MODL_create_blend(radius,end_list2,smooth_overflow,cliff_overflow,notch_overflow,vrb_tool,&feature_obj_id);
UF_MODL_delete_list(&end_list);

UF_terminate();
return;
}

extern int ufusr_ask_unload()
{
return UF_UNLOAD_IMMEDIATELY;
}

简简单单 发表于 2014-12-9 10:52:54

;P,得分了哦
页: [1]
查看完整版本: 创建块倒圆角