NX二次开发 UFUN创建三角平面 UF_MODL_create_plane
//VS8.0+VS2010
#include <UF_VEC.h>
#include <UF_MODL.h>
//创建三角平面
bool CreatePlane(const double point[3], const double dir[3], tag_t& plane_tag)
{
double pt[3] = { point[0], point[1], point[2] }, vec[3] = { 0.0 }, magnitude = 0.0;
plane_tag = NULL_TAG;
if (UF_VEC3_unitize(dir, 0.00000001, &magnitude, vec))
return false;
UF_MODL_create_plane(pt, vec, &plane_tag);
if (NULL_TAG == plane_tag)
return false;
return true;
}
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
tag_t dplane_tag = NULL_TAG;
double point[3] = { 0.0, 0.0, 50.0 };
double dir[3] = { 0.0, 0.0, 1.0 };
CreatePlane(point, dir, dplane_tag);
UF_terminate();
}
//梅雷QQ1821117007

704




被折叠的 条评论
为什么被折叠?



