NX二次开发 UFUN创建圆锥体 UF_MODL_create_cone1
#include <UF_MODL.h>
#include <UF_OBJ.h>
//创建圆锥体
bool CreateCone(const double point[3], const double dir[3], const double diam1, const double diam2, const double height, tag_t& body_tag)
{
body_tag = NULL_TAG;
tag_t tag = NULL_TAG;
char height_str[132] = "", diam_str[132] = "";
char strDiam1[133] = "", strDiam2[133] = "", strHeight[133] = "";
double point1[3] = { point[0],point[1],point[2] };//圆锥体底部点
double dir1[3] = { dir[0],dir[1],dir[2] };//圆锥体轴方向
if (diam1 > 0.00001 && diam2 > 0.00001 && height > 0.00001)
{
sprintf(strDiam1, "%.9f", diam1);
sprintf(strDiam2, "%.9f", diam2);
sprintf(st