用那几个拉伸,不能将封闭的曲线拉伸成片体,用UF_MODL_create_extrusion函数是可以的,下面是例子。
帮助上说拉伸片体不能有拔模角度,应该是错误的,下面是一个封闭曲线带拔模角度拉伸片体的例子:
拉伸面、拉伸封闭曲线成片体效果:
源码:
extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); uc1601("拉伸", 1); tag_t tagLine = 45256; //tag_t tagLine = 45950; double douAngle = 10.0; char cTaperAngle[256] = ""; sprintf(cTaperAngle, "%f", douAngle); double douLimit0 = 0.0; double douLimit1 = 10.0; char Limit0[256] = ""; sprintf(Limit0, "%f", douLimit0); char Limit1[256] = ""; sprintf(Limit1, "%f", douLimit1); tag_t objects[1] = { tagLine }; int object_count = 1; char *taper_angle = cTaperAngle; char *Limit[2] = { Limit0,Limit1 }; char * offsets[2] = { "10","0" }; double Point2[3] = { 0.0, 0.0, 0.0 }; double douDir[3] = { 0.0, 0.0, 1.0 }; UF_FEATURE_SIGN Sign1 = UF_NULLSIGN; tag_t *outObjects = NULL; int iFeaturesCount = 0; UF_MODL_create_extrusion(objects, object_count, NULL, taper_angle, Limit, offsets, Point2, false, false, douDir, Sign1, &outObjects, &iFeaturesCount); UF_terminate(); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }
(关于拉伸的偏置方向,之前感觉是随机的、不确定的,我简单研究了一下还是有些规律,我总结到了下面这篇帖子: 【NX二次开发】拉伸的偏置方向猜想与验证 )