Warning: file(datafile/online) [function.file]: failed to open stream: No such file or directory in /home/all2one/public_html/bbs/topic.php on line 200
阳光精品论坛 > 『 CAD 专栏 』 > UF_CURVE_create_spline_thru_pts 的用法实例
 
欢迎您,客人:高级登录 | 注册 | 取回密码 新贴 | 发帖 | 会员 | 搜索 | 帮助

阳光精品论坛 >> 『 CAD 专栏 』 >> UF_CURVE_create_spline_thru_pts 的用法实例本主题已阅读2051次,回复0
发表一个新主题 回复贴子
批量引用回复把本贴加入论坛收藏夹向管理员报告帖子问题
作者 | 本页主题: UF_CURVE_create_spline_thru_pts 的用法实例 上一个主题:焊接件受力分析 下一个主题:曲柄连杆机构的优化分析  
even2004 

 
 究级天王 [荣誉]
信息:坛主标志 该用户目前离线
来自:未填 align=absmiddle
发贴:1239 贴 查找所有我发的帖子
积分:244
货币:5814 阳光币
注册时间:2008/12/31
 查看会员个人资料资料 将其加入好友列表好友 发短信息消息 引用回复这个贴子引用直接回复贴子回复

UF_CURVE_create_spline_thru_pts 的用法实例


#include
#include 6
#include
#define  NUMBER_POINTS  5
#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:  %sn", file, line, call);
       (UF_get_fail_message(irc, messg)) ?
           printf("    returned a %dn", irc) :
           printf("    returned error %d:  %sn", irc, messg);/
   }
   return(irc);
}
static void do_ugopen_api(void)
{
 /* B-spline parameters  */
 int degree = 3;
 int periodicity = 0;
 int num_points = NUMBER_POINTS;
 /* Point/slope curve attribute array */
 UF_CURVE_pt_slope_crvatr_t point_data[NUMBER_POINTS] =
  {
     {  {-0.0539, 0.0511, 0.0000},
        UF_CURVE_SLOPE_AUTO,      {-0.3597, 0.9639, 0.0000},
        UF_CURVE_CRVATR_NONE,     {0.0000, 0.0000, 0.0000} )
     },
     {  {-0.4801, 0.8428, 0.0000},
        UF_CURVE_SLOPE_NONE,      {0.0000, 0.0000, 0.0000},
        UF_CURVE_CRVATR_NONE, {0.0000, 0.0000, 0.0000}
     },
     {  {2.0000, 0.9000, 3.5956},
        UF_CURVE_SLOPE_NONE,      {0.0000, 0.0000, 0.0000},
        UF_CURVE_CRVATR_NONE,     {0.0000, 0.0000, 0.0000}
     },"
     {  {2.3456, 1.3456, 3.7890},
        UF_CURVE_SLOPE_DIR,       {0.5000, 1.0000, 0.5000},
        UF_CURVE_CRVATR_VEC,      {1.0000, -1.0000, 1.0000}
     },
     {  {3.1000, 2.4567, 3.3214},
        UF_CURVE_SLOPE_VEC,       {1.0000, -2.0000, 1.0000},
        UF_CURVE_CRVATR_VEC,      {-1.0000, -1.0000, -1.0000}
     }
  };

 /* Arrays of user's defining point data */
 double parameters[NUMBER_POINTS] = {0.00, 0.89,  1.73,  2.23,  2.85};
 int i, save_def_data = 1;
 tag_t spline_tag;

 /* Create B-spline curve */
 UF_CALL(UF_CURVE_create_spline_thru_pts(degree,
                                         periodicity,
                                         num_points,
                           point_data,
                                         parameters,
                                         save_def_data,
                                         &spline_tag));
}
/*ARGSUSED*/
void ufusr(char *param, int *retcode, int paramLen)
{
   if (!UF_CALL(UF_initialize()))
   {
       do_ugopen_api();
       UF_CALL(UF_terminate());
   }
}
int ufusr_ask_unload(void)
{
   return (UF_UNLOAD_IMMEDIATELY);
}


修改贴子编辑 |  发表于 2009/05/01/08:14  |  1 层 

发表一个新主题 回复贴子 推荐给朋友 可打印版本 文章模式 
论坛跳转:


  快速回复  

文章内容:

HTML 代码不可用


BMB代码选项:
[img] - 开启
[flash] - 开启
[size] - 开启

上传附件[还可传0个]:
开启

最大字节: 200000 字节
最少发帖: 20 篇

标题:


  [使用 Ctrl+Enter 直接提交贴子]

你的用户名  你的密码: 忘了密码?

阳光精品论坛 >> 『 CAD 专栏 』 >> UF_CURVE_create_spline_thru_pts 的用法实例本主题已阅读2051次,回复0



本论坛言论纯属发表者个人意见,与 阳光精品论坛 立场无关 联系我们
Powered by BMForum v5.0 Skin by Bob Shen