购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
函数结构:UF_MODL_create_proj_curves( uf_list_p_t curve_refs, uf_list_p_t face_refs, int along_face_normal, double proj_vector [ 3 ], tag_t * proj_curve_feature) 函数说明:
创建相关联的预测曲线。用于创建一个公差曲线凸起可以通过使用子程序来改变UF_MODL_set_distance_tolerance。沿面法线或投影沿着向量产生一个精确的投影投射到一个平面上时。投影曲线特征可使用UF_MODL_delete_feature或删除该曲线可以使用UF_MODL_ask_proj_curves进行访问和删除个别。同样,UF_MODL_move_feature可用于移动预计曲线功能。
函数参数:
第1个参数为输入:
curve_refs代表参数变量,uf_list_p_t 为输入参数类型,曲线,素描,或预计曲线功能标识符列表。
第2个参数为输入:
face_refs代表参数变量,uf_list_p_t 为输入参数类型,平面,基准面,或面部识别列表。
第3个参数为输入:
输入int 整数型的参数,参数的变量格式为along_face_normal,0 =使用投影向量(矢量PROJ)1 =使用面法线
第4个参数为输入:
输入double 双精度类型的参数,参数的变量格式为proj_vector [ 3 ],在绝对空间三维矢量
第5个参数为输出:
proj_curve_feature代表参数变量,tag_t * 为输出参数类型,预计曲线要素标识符
UF_MODL_create_proj_curves函数实例代码演示:
[quote]
#include <stdio.h>
#include <uf_modl.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_curve.h>
#include <uf_csys.h>
#include <uf_disp.h>
#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))
static int report( char *file, int line, char *call, int irc)
{
if (irc)
{
char messg[133];
printf("%s, line %d: %s\n", file, line, call);
(UF_get_fail_message(irc, messg)) ?
printf(" returned a %d\n", irc) :
printf(" returned error %d: %s\n", irc, messg);
}
return(irc);
}
static void do_ugopen_api(void)
{
int along_face = 1;
int not_along_face = 0;
tag_t arctag;
tag_t wcs_tag;
tag_t wcs_planetag;
tag_t planetag;
tag_t proj1tag;
tag_t proj2tag;
uf_list_p_t curve_refs;
uf_list_p_t face1_refs;
uf_list_p_t face2_refs;
UF_CURVE_arc_t arc_coords;
double plan1orig[3] = { 0.0, 0.0, 0.0 };
double plan2orig[3] = { 0.0, 0.0, 3.0 };
double x1axpt[3] = { 1.0, 0.0, 0.0 };
double x2axpt[3] = { 1.0, 0.0, 3.0 };
double plan1pt[3] = { 1.0, 1.0, 0.0 };
double plan2pt[3] = { 0.0, .70710678118655, 3.70710678118655 };
double proj_vector[3] = { 0.0, 0.0, 1.0 };
/* Create planes and arc */
FTN(uf5374)(plan1orig, x1axpt, plan1pt, &wcs_planetag);
FTN(uf5374)(plan2orig, x2axpt, plan2pt, &planetag);
UF_CALL(UF_CSYS_ask_wcs(&wcs_tag));
UF_CALL(UF_CSYS_ask_matrix_of_object(wcs_tag,
&arc_coords.matrix_tag));
arc_coords.start_angle = 0.0;
arc_coords.end_angle = 2 * PI;
arc_coords.arc_center[0] = 1.0;
arc_coords.arc_center[1] = 1.0;
arc_coords.arc_center[2] = 6.0;
arc_coords.radius = 0.5;
UF_CALL(UF_CURVE_create_arc(&arc_coords, &arctag));
UF_CALL(UF_MODL_create_list(&curve_refs));
UF_MODL_create_list(&face1_refs);
UF_MODL_create_list(&face2_refs);
UF_MODL_put_list_item(curve_refs, arctag);
UF_MODL_put_list_item(face1_refs, wcs_planetag);
UF_MODL_put_list_item(face2_refs, planetag);
UF_CALL(UF_MODL_create_proj_curves(curve_refs, face1_refs,
along_face,proj_vector, &proj1tag));
UF_CALL(UF_MODL_create_proj_curves(curve_refs, face2_refs,
not_along_face,proj_vector, &proj2tag));
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int param_len)
{
if (!UF_CALL(UF_initialize()))
{
do_ugopen_api();
UF_CALL(UF_terminate());
}
}
int ufusr_ask_unload(void)
{
return (UF_UNLOAD_IMMEDIATELY);
}
[/quote]