NX二次开发 PK创建片体平面PK_BODY_create_sheet_planar
//创建片体平面(点必须顺时针)
bool PK_CreateSheetPlanar(const int n_points, const double points[][3], const double dir[3], PK_BODY_t& pkBody)
{
pkBody = PK_ENTITY_null;
if (n_points < 3 || n_points > 1000)
{
return false;
}
double mm = 0.001;
PK_BODY_create_sheet_planar_o_t options;
PK_VECTOR_t* vectors = new PK_VECTOR_t[n_points];
PK_BODY_create_sheet_planar_o_m(options);
for (int i = 0; i < n_points; i++)
{
vectors[i].coord[0] = points[i][0] * mm;
vectors[i].coord[1] = points[i][1] * mm;
vectors[i].coord[2] = points[i][2] * mm;
}
options.plane.location.coord[0] = vectors[0].coord[0];
options.plane.location.coord[1] = vectors[0].coord[1];
options.plane.location.c