|
用mfc做二次开发建模,截面曲线都画好了,但是生成旋转体的函数不生效,ug没报错
代码如下
tag_t point_tag1=NULL_TAG , point_tag2=NULL_TAG , point_tag3=NULL_TAG , point_tag4=NULL_TAG;
double point1[3]={0,-410,18};
double point2[3]={0,0,76};
double point3[3]={0,-410,15};
double point4[3]={0,0,58};
double direction0[3]={1,0,0};//平面法线方向
UF_CURVE_create_point(point1,&point_tag1);//创建点
UF_CURVE_create_point(point2,&point_tag2);
UF_CURVE_create_point(point3,&point_tag3);
UF_CURVE_create_point(point4,&point_tag4);
UF_CSYS_map_point(UF_CSYS_ROOT_WCS_COORDS,point1,UF_CSYS_WORK_COORDS,point1);
UF_CSYS_map_point(UF_CSYS_ROOT_WCS_COORDS,point2,UF_CSYS_WORK_COORDS,point2);
UF_CSYS_map_point(UF_CSYS_ROOT_WCS_COORDS,point3,UF_CSYS_WORK_COORDS,point3);
UF_CSYS_map_point(UF_CSYS_ROOT_WCS_COORDS,point4,UF_CSYS_WORK_COORDS,point4);
tag_t support_plane; //定义基准平面
UF_MODL_create_fixed_dplane(point1,direction0,&support_plane);//固定基准平面
double radius1=m_rds1; //半径
double radius2=m_rds2;
UF_CURVE_principal_axis_type_t principal_axis=UF_CURVE_Y_AXIS;
logical is_asso=true;
tag_t arc1=NULL_TAG , arc2=NULL_TAG , line1=NULL_TAG , line2=NULL_TAG;
UF_CURVE_create_arc_point_point_radius(point_tag1,point_tag2,radius1,false,support_plane,is_asso,&arc1);
UF_CURVE_create_arc_point_point_radius(point_tag3,point_tag4,radius2,false,support_plane,is_asso,&arc2);
UF_CURVE_create_line_point_point(point_tag1,point_tag3,false,support_plane,is_asso,&line1);
UF_CURVE_create_line_point_point(point_tag2,point_tag4,false,support_plane,is_asso,&line2);
UF_MODL_ask_object_feat(arc1,&arc1);
UF_MODL_ask_object_feat(arc2,&arc2);
UF_MODL_ask_object_feat(line1,&line1);
UF_MODL_ask_object_feat(line1,&line1);
//旋转
tag_t generators[4], *objects0 ; generators[0]=arc1;
generators[1]=arc2;
generators[2]=line1;
generators[3]=line2;
int object_count0 ;
UF_MODL_SWEEP_TRIM_object_p_t trim_data =NULL;
char *limit[2] ={"0,0","360.0"};
char *offsets[2] ={"0","0",};//<I>Offsets for open strings
double origin0[3] = {0.0, 0.0, 0.0};
double direction00[3] = {0.0, 1.0, 0.0};
UF_FEATURE_SIGN sign0 =UF_NULLSIGN;
UF_MODL_create_revolution(generators, 4, trim_data,limit, offsets, origin0, false,true, origin0, direction00, sign0,&objects0 , &object_count0 ); |
|