马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这是我编一个函数,下面是要用生成的三个界面截一个实体得到三条截面线,往下不知如何做,请问如何应用UF_MODL_intersect_objects含数求得???
static void do_ugopen_api(void)
{
tag_t part_tag;
part_tag = Select_Test(); //问当前页身的tag号
//保存绝对坐标系位置
//tag_t saved_wcs;
//UF_CSYS_ask_wcs(&saved_wcs);
//建立在基准平面上的工作坐标系
double x_vec[ 3 ] = {1.0,0.0,0.0};//X方向矢量
double y_vec[ 3 ] = {0.0,0.0,1.0};//Y方向矢量
double mtx[ 9 ] ;
UF_MTX3_initialize (x_vec, y_vec, mtx);//生成3*3坐标系矩阵
tag_t matrix_id;
UF_CSYS_create_matrix (mtx, & matrix_id );
double csys_origin[ 3 ] = {0.0,0.0,450.0};//坐标系原点
tag_t csys_id ;
UF_CSYS_create_csys (csys_origin, matrix_id, &csys_id );//生成WCS
UF_CSYS_set_wcs (csys_id ); //设置WCS
UF_CSYS_set_wcs_display (1);//WCS显示
//基准平面1
tag_t dplane_tag1;
double pt1[ 3 ] = {0,0,0};
double pt2[ 3 ] = {0,0,1};
double out_pt1[ 3 ];
double out_pt2[ 3 ];
int int_dplane;
double dplane_distance = 60.0;
//点在WCS中的坐标转换到ABS中
UF_CSYS_map_point (UF_CSYS_ROOT_WCS_COORDS, pt1, UF_CSYS_WORK_COORDS, out_pt1);
UF_CSYS_map_point (UF_CSYS_ROOT_WCS_COORDS, pt2, UF_CSYS_WORK_COORDS, out_pt2);
UF_CSYS_map_point (UF_CSYS_ROOT_WCS_COORDS, pt3, UF_CSYS_WORK_COORDS, out_pt3);
//基准平面法矢
double dir[ 3 ] = {out_pt2[0]-out_pt1[0],out_pt2[1]-out_pt1[1],out_pt2[2]-out_pt1[2]};
double dplane_point2[ 3 ] ;
double dplane_point3[ 3 ] ;
double dplane_point4[ 3 ] ;
double input_dplane_point2[3] = {0.0,0.0,dplane_distance};
double input_dplane_point3[3] = {0.0,0.0,2*dplane_distance};
double input_dplane_point4[3] = {0.0,0.0,3*dplane_distance};
UF_CSYS_map_point (UF_CSYS_ROOT_WCS_COORDS, input_dplane_point2, UF_CSYS_WORK_COORDS, dplane_point2);
UF_CSYS_map_point (UF_CSYS_ROOT_WCS_COORDS, input_dplane_point3, UF_CSYS_WORK_COORDS, dplane_point3);
UF_CSYS_map_point (UF_CSYS_ROOT_WCS_COORDS, input_dplane_point4, UF_CSYS_WORK_COORDS, dplane_point4);
//基准平面2(截面1)
tag_t dplane_tag2;
UF_CALL(int_dplane = UF_MODL_create_fixed_dplane (dplane_point2, dir, &dplane_tag2));
//基准平面3(截面2)
tag_t dplane_tag3;
UF_CALL(int_dplane = UF_MODL_create_fixed_dplane (dplane_point3, dir, &dplane_tag3));
//基准平面4(截面3)
tag_t dplane_tag4;
UF_CALL(int_dplane = UF_MODL_create_fixed_dplane (dplane_point4, dir, &dplane_tag4));
我接处时间不长,希望个位能够赐教!!! |