回转实例代码:
static void do_ugopen_api(void){ //在绝对坐标创建的回转体 int obj_count; UF_FEATURE_SIGN mode_sign = UF_NULLSIGN; tag_t line[4], *objects; char *body_limit[2] = { "0.0", "360.0"}; //Turning angle char *offsets[2]= { "0.0", "0.0"}; double origin[3] = {-2.0, 0.0, 0.0}; //Turning origin double direction[3] = { 0.0, 1.0, 0.0}; UF_MODL_SWEEP_TRIM_object_p_t trim_data = NULL; UF_CURVE_line_t sline[4]; /* line#1 */ sline[0].start_point[0] = 0.0; sline[0].start_point[1] = 0.0; sline[0].start_point[2] = 0.0; sline[0].end_point[0] = 0.0; sline[0].end_point[1] = 1.0; sline[0].end_point[2] = 0.0; UF_CALL(UF_CURVE_create_line(&sline[0],&line[0])); /* line#2 */ sline[1].start_point[0] = 0.0; sline[1].start_point[1] = 1.0; sline[1].start_point[2] = 0.0; sline[1].end_point[0] = 2.5; sline[1].end_point[1] = 3.5; sline[1].end_point[2] = 0.0; UF_CALL(UF_CURVE_create_line(&sline[1],&line[1])); /* line#3 */ sline[2].start_point[0] = 2.5; sline[2].start_point[1] = 3.5; sline[2].start_point[2] = 0.0; sline[2].end_point[0] = 1.0; sline[2].end_point[1] = 0.0; sline[2].end_point[2] = 0.0; UF_CALL(UF_CURVE_create_line(&sline[2],&line[2])); /* line#4 */ sline[3].start_point[0] = 1.0; sline[3].start_point[1] = 0.0; sline[3].start_point[2] = 0.0; sline[3].end_point[0] = 0.0; sline[3].end_point[1] = 0.0; sline[3].end_point[2] = 0.0; UF_CALL(UF_CURVE_create_line(&sline[3],&line[3])); UF_CALL(UF_MODL_create_revolution(line, 4, trim_data,body_limit,offsets,origin, false,true, origin,direction, mode_sign,&objects, &obj_count));}
运行结果: