|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我创建了一个拉伸体,其特征原型是
extern int UF_MODL_create_extruded (uf_list_p_t objects,
char * taper_angle,
char ** limit,
double point[ 3 ],
double direction[ 3 ],
UF_FEATURE_SIGN sign,
uf_list_p_t * features );
features是否是它的标识?如果不是,要如何获得它的标识?在这个拉伸体上面如何进行其它操作,如倒圆角。下面是一个拉伸的例子,
如何在它的边上倒圆角?劳烦大虾指教。
void do_ugopen_api()
{
double direction[3]={0.0,0.0,-1.0}; //拉伸方向
int number=1;
char *taper="0";
double high=10;
uf_list_p_t features;
////输入参数
double pt1[3] = {0,0,0.0};
double pt2[3] = {0,50,0.0};
double pt3[3] = {40,50,0.0};
double pt4[3] = {40.0,0.0,0.0};
double ref_pt[3];
char *part_name = "arm";
char *taper_angle = "0.0";
char temp[133];
sprintf(temp,"%f",-high); //将double型的高度值转为char型
char *limit1[2] = {"0.0", temp};
int english_units = 1, i, count = 4;
tag_t objarray[11];
uf_list_p_t loop_list;
UF_FEATURE_SIGN create = UF_NULLSIGN;
UF_CURVE_line_t line1, line2, line3,line4;
line1.start_point[0] = pt1[0];
line1.start_point[1] = pt1[1];
line1.start_point[2] = pt1[2];
line1.end_point[0] = pt2[0];
line1.end_point[1] = pt2[1];
line1.end_point[2] = pt2[2];
line2.start_point[0] = line1.end_point[0];
line2.start_point[1] = line1.end_point[1];
line2.start_point[2] = line1.end_point[2];
line2.end_point[0] = pt3[0];
line2.end_point[1] = pt3[1];
line2.end_point[2] = pt3[2];
line3.start_point[0] = line2.end_point[0];
line3.start_point[1] = line2.end_point[1];
line3.start_point[2] = line2.end_point[2];
line3.end_point[0] = pt4[0];
line3.end_point[1] = pt4[1];
line3.end_point[2] = pt4[2];
line4.start_point[0] = line3.end_point[0];
line4.start_point[1] = line3.end_point[1];
line4.start_point[2] = line3.end_point[2];
line4.end_point[0] = pt1[0];
line4.end_point[1] = pt1[1];
line4.end_point[2] = pt1[2];
UF_CURVE_create_line([$line1,&objarray[0])] //创建线条1
UF_CURVE_create_line([$line2,&objarray[1])]
UF_CURVE_create_line([$line3,&objarray[2])]
UF_CURVE_create_line([$line4,&objarray[3])]
UF_MODL_create_list([$loop_list)] //创建线框表链
for(i = 0; i < count; i++)
{
UF_MODL_put_list_item(loop_list, objarray); //将线1-4放进列表loop_list中
}
UF_MODL_create_extruded(loop_list, taper_angle, limit1,
ref_pt, direction, create, [$features)] //拉伸操作
} |
|