1 NX11+VS2013 2 3 4 #include <uf.h> 5 #include <uf_ui.h> 6 #include <uf_modl.h> 7 #include <uf_curve.h> 8 9 10 UF_initialize(); 11 12 //点构造器 13 char sCue[] = "点构造器"; 14 UF_UI_POINT_base_method_t base_method = UF_UI_POINT_INFERRED; 15 tag_t tPoint = NULL_TAG; 16 double sBasePoint[] = { 0, 0, 0 }; 17 int iRespone; 18 UF_UI_point_construct(sCue, &base_method, &tPoint, sBasePoint, &iRespone); 19 20 //获取点在面上U,V方向的位置 21 tag_t face_id = 49138; 22 double ref_pnt[3]; 23 ref_pnt[0] = sBasePoint[0]; 24 ref_pnt[1] = sBasePoint[1]; 25 ref_pnt[2] = sBasePoint[2]; 26 double parm[2]; 27 double face_pnt[3]; 28 UF_MODL_ask_face_parm(face_id, ref_pnt, parm, face_pnt); 29 30 //获取点在面上的向量方向 31 double point[3]; 32 double u1[3]; 33 double v1[3]; 34 double u2[3]; 35 double v2[3]; 36 double unit_norm[3]; 37 double radii[2]; 38 UF_MODL_ask_face_props(face_id, parm, point, u1, v1, u2, v2, unit_norm, radii); 39 40 //创建直线 41 UF_CURVE_line_t line_coords; 42 line_coords.start_point[0] = ref_pnt[0]; 43 line_coords.start_point[1] = ref_pnt[1]; 44 line_coords.start_point[2] = ref_pnt[2]; 45 line_coords.end_point[0] = ref_pnt[0] + unit_norm[0]; 46 line_coords.end_point[1] = ref_pnt[1] + unit_norm[1]; 47 line_coords.end_point[2] = ref_pnt[2] + unit_norm[2]; 48 tag_t line_tag = NULL_TAG; 49 UF_CURVE_create_line(&line_coords, &line_tag); 50 51 UF_terminate(); 52 53 Caesar卢尚宇 54 2019年10月22日
网友王牌飞行员