标签:loading intersect free 打印 sprintf span inf include end
NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_modl.h> #include <uf_curve.h> UF_initialize(); //创建两条直线 UF_CURVE_line_t Line_coords1; Line_coords1.start_point[0] = 0.0; Line_coords1.start_point[1] = 0.0; Line_coords1.start_point[2] = 0.0; Line_coords1.end_point[0] = 100.0; Line_coords1.end_point[1] = 0.0; Line_coords1.end_point[2] = 0.0; tag_t Line1Tag = NULL_TAG; UF_CURVE_create_line(&Line_coords1, &Line1Tag); UF_CURVE_line_t Line_coords2; Line_coords2.start_point[0] = 50.0; Line_coords2.start_point[1] = -50.0; Line_coords2.start_point[2] = 0.0; Line_coords2.end_point[0] = 50.0; Line_coords2.end_point[1] = 100.0; Line_coords2.end_point[2] = 0.0; tag_t Line2Tag = NULL_TAG; UF_CURVE_create_line(&Line_coords2, &Line2Tag); //获得两条曲线的交点 int num_intersections = 0; double* data = 0; UF_MODL_intersect_curve_to_curve(Line1Tag, Line2Tag, &num_intersections, &data); //打印交点xyz坐标 char msg[256]; sprintf_s(msg, "x:%.2f,y:%.2f,z:%.2f", data[0],data[1],data[2]); uc1601(msg,1); //释放 UF_free(data); UF_terminate(); Caesar卢尚宇 2020年7月5日
NX二次开发-UFUN获得两条曲线的交点UF_MODL_intersect_curve_to_curve
标签:loading intersect free 打印 sprintf span inf include end
原文地址:https://www.cnblogs.com/nxopen2018/p/13251483.html