点击查看详细介绍

UF_DRAW_ask_simplified_curve() 函数的参数解释说明、函数详细用法,以及实例代码演示

misnn 10年前 907 0

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


函数结构:
UF_DRAW_ask_simplified_curve
(
tag_t master_curve_tag,
tag_t * view_tag,
logical * flat_arc_to_line,
double * tolerance,
int * num_segments,
tag_p_t * segments
)

函数说明:
鉴于绘图曲线(轮廓或部分边缘)或边缘的是圆锥或花键,以及绘图员图,其中标签这条曲线或边居住,这个函数返回简化曲线(如它们存在),并且简化创建信息。 如果一个NULL_TAG被输入作为view_tag和master_curve_tag是一个部分边缘或轮廓,视图推断,如果master_curve_tag是边缘,首先查看发现那里的边缘简化使用。

函数参数:
第1个参数为输入:
master_curve_tag代表参数变量,tag_t 为输入参数类型,这是简化了主曲线或边的标签。

第2个参数为输入:
view_tag代表参数变量,tag_t * 为输入参数类型,主曲线的绘图员视图的标签。

第3个参数为输出:
flat_arc_to_line代表参数变量,logical * 为输出参数类型,如果为TRUE,进行从简化输出弧段的后处理,以平弧段不到一半的视图显示公差带转换弦公差线段。另外,相邻的线段和圆弧段可能已经加入,如果结果是该视图显示公差的一半以内。

第4个参数为输出:
输出double * 双精度类型的参数,参数的变量格式为tolerance,公差的是使用产生的简化。

第5个参数为输出:
输出int * 整数型的参数,参数的变量格式为num_segments,简化的曲线数量

第6个参数为输出:
segments代表参数变量,tag_p_t * 为输出参数类型,简化曲线的数组。自由到自由内存使用。

UF_DRAW_ask_simplified_curve函数实例代码演示:
这个例子程序从一个边缘部分简单的创建曲线在部分成员视图中。
[quote]
#include <stdio.h>
#include <string.h>
#include <uf.h>
#include <uf_defs.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_drf_types.h>
#include <uf_obj.h>
void ufusr(char *param, int *retcod, int param_len)
{
int ifail = 0;
int num_sxsolids = 0;
int num_sxedges = 0;
int num_segments = 0;
logical flat_arc_to_line = TRUE;
double tolerance;
tag_t sxview_tag = NULL_TAG;
tag_p_t sxsolid_tags = NULL;
tag_p_t sxedge_tags = NULL;
tag_p_t segments = NULL;
char error_message[133];
char * sxview = "sx@1";
UF_DRAW_sxline_leg_t sxline_leg = UF_DRAW_sxline_leg1;
ifail = UF_initialize();
if( ifail == 0 )
{
int numchrs = 0;
/* Find the tag of the section view from its name. */
numchrs = strlen( sxview );
ifail = uc5028( sxview, numchrs, &sxview_tag );
}
/* Find the section solids of the section view. */
if( ifail == 0 )
ifail = UF_DRAW_ask_sxsolids_of_sxview( sxview_tag,
sxline_leg,
&num_sxsolids,
&sxsolid_tags );
/* Find the section edges of the first section
solid of the view. */
if( ifail == 0 )
{
ifail = UF_DRAW_ask_sxedges_of_sxsolid( sxsolid_tags[0],
&num_sxedges,
&sxedge_tags );
UF_free( sxsolid_tags );
}
/* Simplify the first section edge of that section solid.
Note that only section edges that are splines or conics
will be simplified. */
if( ifail == 0 )
{
ifail = UF_DRAW_create_simplified_curve(
sxedge_tags[0],
sxview_tag,
flat_arc_to_line,
&num_segments,
&segments );
UF_free( segments );
segments = NULL;
}
/* After a simplification has been created, it may be
queried. */
if( ifail == 0 && num_segments > 0 )
{
ifail = UF_DRAW_ask_simplified_curve( sxedge_tags[0],
sxview_tag,
&flat_arc_to_line,
&tolerance,
&num_segments,
&segments );
UF_free( sxedge_tags );
}
/* To delete a simplification, delete just one of the simple
curves. */
if( ifail == 0 && num_segments > 0 )
{
ifail = UF_OBJ_delete_object( segments[0] );
UF_free( segments );
}
printf( "UF_DRAW_crv_simp sample " );
if( ifail )
ifail = UF_get_fail_message( ifail, error_message );
printf( "fails.\nError is: %s\n", error_message );
}
else
printf( "is successful.\n" );
ifail = UF_terminate();
}



[/quote]

0

最新回复 (0)
请登录后发表新帖