|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
extern UFUNEXPORT int UF_MODL_trim_body(
tag_t target_body ,/* <I>
Target body to be trimmed.
*/
tag_t tool_tag ,/* <I>
Tag of face, datum plane, or plane to be used for trim.
*/
int direction_flag ,/* <I>
0 = Accept default direction
1 = Reverse direction
*/
tag_t * trim_feature /* <O>
Resultant trim_feature identifier tag
*/
);
以上为此函数的声明,照理说这是最简单的函数了,可我怎么就是出错,我要实现的目标如下图所示,源程序如下,请高手指点:
//============================[1] Create a sphere====================
tag_t sphere_tag;
double center[3]={0, 0,0};
char sphere_diam[256];
sphere_diam[0]='\0';
sprintf(sphere_diam,"%f",84.8*2);
UF_MODL_create_sphere1(UF_NULLSIGN,center,sphere_diam,[$sphere_tag)]
//============================[2] 2 Trim of sphere====================
tag_t dplane1;
double sphere_radius=atof(sphere_diam)/2;
double dplane1_origin[3];
dplane1_origin[0]=0;
dplane1_origin[1]=0;
dplane1_origin[2]=-80;
double dplane1_dir[3]={0,0,1};
UF_MODL_create_fixed_dplane(dplane1_origin, dplane1_dir,[$dplane1)]
tag_t dplane2;
double dplane2_origin[3];
dplane2_origin[0]=0;
dplane2_origin[1]=0;
dplane2_origin[2]=-60;
double dplane2_dir[3]={0,0,1};
UF_MODL_create_fixed_dplane (dplane2_origin,dplane2_dir,[$dlane2)]
int direction_flag=0;
tag_t trim_left,trim_right;
int ret=UF_MODL_trim_body(sphere_tag,
dplane1,
direction_flag,
[$trim_left)]
char test[256];
sprintf(test,"%d",ret);
uc1601(test,1);
//从结果显示 ret=690025 |
|