iCAx开思工具箱

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 24889|回复: 12
打印 上一主题 下一主题

ug二次开发的问题,急求

[复制链接]
跳转到指定楼层
楼主
发表于 2012-7-10 15:10:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
具体怎么添加颜色设置函数把这个拉伸体设置成红色?小弟刚学不会呀
#include <stdio.h>
#include <uf.h>
#include <uf_modl.h>
#include <uf_curve.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)
{
double pt1[3]= {0.0,0.0,0.0};
double pt2[3]= {1.0,0.0,0.0};
double pt3[3]= {3.0,3.0,0.0};
double pt4[3]= {0.0,1.0,0.0};
tag_t  line1;
tag_t  line2;
tag_t  line3;
tag_t  line4;
UF_CURVE_line_t line_coords1;
UF_CURVE_line_t line_coords2;
UF_CURVE_line_t line_coords3;
UF_CURVE_line_t line_coords4;


line_coords1.start_point[0] = pt1[0];
line_coords1.start_point[1] = pt1[1];
line_coords1.start_point[2] = pt1[2];
line_coords1.end_point[0] = pt2[0];
line_coords1.end_point[1] = pt2[1];
line_coords1.end_point[2] = pt2[2];
   
UF_CALL(UF_CURVE_create_line(&line_coords1, &line1));
line_coords2.start_point[0] = pt2[0];
line_coords2.start_point[1] = pt2[1];
line_coords2.start_point[2] = pt2[2];
line_coords2.end_point[0] = pt3[0];
line_coords2.end_point[1] = pt3[1];
line_coords2.end_point[2] = pt3[2];
   
UF_CALL(UF_CURVE_create_line(&line_coords2, &line2));
line_coords3.start_point[0] = pt3[0];
line_coords3.start_point[1] = pt3[1];
line_coords3.start_point[2] = pt3[2];
line_coords3.end_point[0] = pt4[0];
line_coords3.end_point[1] = pt4[1];
line_coords3.end_point[2] = pt4[2];
   
UF_CALL(UF_CURVE_create_line(&line_coords3, &line3));
line_coords4.start_point[0] = pt4[0];
line_coords4.start_point[1] = pt4[1];
line_coords4.start_point[2] = pt4[2];
line_coords4.end_point[0] = pt1[0];
line_coords4.end_point[1] = pt1[1];
line_coords4.end_point[2] = pt1[2];
   
UF_CALL(UF_CURVE_create_line(&line_coords4, &line4));
    double  direction[3] = {0.0, 0.0, 1.0};
UF_FEATURE_SIGN sign = UF_NULLSIGN;
char * taper_angle = "0.0";
double point[3];
char * limit[2] = {"0.0", "10"};
uf_list_p_t objects, body;
UF_CALL(UF_MODL_create_list(&objects));
UF_CALL(UF_MODL_put_list_item(objects, line1));
UF_CALL(UF_MODL_put_list_item(objects, line2));
UF_CALL(UF_MODL_put_list_item(objects, line3));
UF_CALL(UF_MODL_put_list_item(objects, line4));
UF_CALL(UF_MODL_create_extruded (objects, taper_angle, limit, point, direction, sign, &body));



}
/*ARGSUSED*/
extern 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);
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 支持支持
沙发
发表于 2012-7-10 17:04:29 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
板凳
 楼主| 发表于 2012-7-10 22:26:54 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
地板
发表于 2012-7-10 22:30:04 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
5
发表于 2012-7-11 06:40:39 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
6
 楼主| 发表于 2012-7-11 10:25:42 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
7
 楼主| 发表于 2012-7-11 17:31:40 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
8
发表于 2012-7-11 22:42:25 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
9
发表于 2012-7-12 14:51:54 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
10
发表于 2012-7-12 15:00:59 | 只看该作者

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手板模型制作,在线3D打印服务

QQ|小黑屋|手机版|开思工具箱 CAD工具箱_CAM工具箱  

GMT+8, 2024-5-13 20:07 , Processed in 0.017449 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表