NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_vec.h> #include <uf_modl.h> #include <uf_curve.h> UF_initialize(); //创建点 double point_coords[3] = { 0, 0, 10 }; tag_t point_tag = NULL_TAG; UF_CURVE_create_point(point_coords, &point_tag); //创建固定的基准平面 double Origin_Point[3] = {0, 0, 500}; double Plane_Normal[3] = {0.0, 0.0, 1.0}; tag_t Plane_Tag = NULL_TAG; UF_MODL_create_fixed_dplane(Origin_Point, Plane_Normal, &Plane_Tag); //计算从点到平面的法向距离 double tolerance = 0.001; double distance = 0; UF_VEC3_distance_to_plane(point_coords, Origin_Point, Plane_Normal, tolerance, &distance); //打印 char msg[256]; sprintf(msg, "点到平面的法向距离为%f", distance); uc1601(msg, 1); UF_terminate(); 阿飞 2021年10月18日
阿飞
2021年10月18日