找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?在线3D打印服务,一键上传,自动报价 
查看: 16955|回复: 1
打印 上一主题 下一主题

[求助] UF_CSYS_create_matrix第一个参数传递无效??

[复制链接]
跳转到指定楼层
1
发表于 2010-11-2 15:34:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

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

x
base_face是为指定的一个面,下面的这个错误我怀疑是不是指定的这个面本身就有问题????
这个问题很急,希望高手帮忙!!


error = UF_MODL_ask_face_uv_minmax( base_face,uvs );   // 得到指定面的U和V
/*printf("Error from Asking uv minmax = %i\n",error);*/
      if ( error != 0 )
      {
        UF_OBJ_set_blank_status( steels[cnt],UF_OBJ_NOT_BLANKED );           /* Unblank the steel */
//UF_get_fail_message ( error,message );
        sprintf( box_message,"Error Asking UV Parameters for Steel %s - steel skipped",object_name );
        uc1601( box_message,1 );
        goto donewithsteel;
      }


      params[0] = ( uvs[0] + uvs[1] ) / 2;                    /* Set params to find face midpoint */
      params[1] = ( uvs[2] + uvs[3] ) / 2;


      error = UF_MODL_ask_face_props( base_face,params,face_point,         /* Get face properties */
                                      vec1,junk,junk,junk,vec3,junk );
//printf("Error from Asking face properties = %i\n",error);
printf("Face point = X%lf  Y%lf  Z%lf\n",face_point[0],face_point[1],face_point[2]);     // 值是:X242.970668  Y1387.556782  Z645.000000
printf("vec1 = I%lf  J%lf  K%lf\n",vec1[0],vec1[1],vec1[2]);    // 值是:  I573.576436   J819.152044  K0.000000
printf("vec3 = I%lf  J%lf  K%lf\n",vec3[0],vec3[1],vec3[2]);    // 值是:I0.000000  J0.000000  K-1.000000
      if ( error != 0 )
      {
        UF_OBJ_set_blank_status( steels[cnt],UF_OBJ_NOT_BLANKED );           /* Unblank the steel */
//UF_get_fail_message ( error,message );
        sprintf( box_message,"Error Asking Face Props for Steel %s - Steel Skipped",object_name );
        uc1601( box_message,1 );
        goto donewithsteel;
      }


      UF_VEC3_cross( vec3,vec1,vec2 );  // 看不懂这句话????如何计算的vec2 ??


      error = UF_VEC3_unitize( vec1,modl_tol,&magnitude,&matrix9[0] );   // 得到matrix9[0],matrix9[1],matrix9[2]的值
      if ( error != 0 )
      {
        UF_OBJ_set_blank_status( steels[cnt],UF_OBJ_NOT_BLANKED );           /* Unblank the steel */
//UF_get_fail_message ( error,message );
        sprintf( box_message,"Error Unitizing Vector 1 for Steel %s - Steel Skipped",object_name );
        uc1601( box_message,1 );
        goto donewithsteel;
      }


      error = UF_VEC3_unitize( vec2,modl_tol,&magnitude,&matrix9[3] );//得到matrix9[3],matrix9[4],matrix9[5]的值
      if ( error != 0 )
      {
        UF_OBJ_set_blank_status( steels[cnt],UF_OBJ_NOT_BLANKED );           /* Unblank the steel */
//UF_get_fail_message ( error,message );
        sprintf( box_message,"Error Unitizing Vector 2 for Steel %s - Steel Skipped",object_name );
        uc1601( box_message,1 );
        goto donewithsteel;
      }


      UF_VEC3_copy( vec3,&matrix9[6] );// 得到matrix9[6],matrix9[7],matrix9[8]的值
//
  matrix9[0] = 1;matrix9[1] = 0;matrix9[2] = 0;
//
  matrix9[3] = 0;matrix9[4] = 1;matrix9[5] = 0;
//
  matrix9[6] = 0;matrix9[7] = 0;matrix9[8] = 1;


printf("matrix9 = %lf  %lf  %lf\n",matrix9[0],matrix9[1],matrix9[2]);  // 0.573576    0.819152    0.000000
printf("matrix9 = %lf  %lf  %lf\n",matrix9[3],matrix9[4],matrix9[5]); //  0.819152    -0.573576   0.000000
printf("matrix9 = %lf  %lf  %lf\n",matrix9[6],matrix9[7],matrix9[8]); //  0.000000    0.000000    -1.000000


      error = UF_CSYS_create_matrix( matrix9,&mtx_tag );   //在这里出错,错误消息是:第一个参数传递无效?     /* Create matrix tag for new CSYS */
      if ( error != 0 )
      {
        UF_OBJ_set_blank_status( steels[cnt],UF_OBJ_NOT_BLANKED );           /* Unblank the steel */

UF_get_fail_message ( error,message );
        sprintf( box_message,"Error Creating CSYS Matrix for Steel %s - Steel Skipped",object_name );
        uc1601( box_message,1 );
        goto donewithsteel;
      }


      error = UF_CSYS_create_csys( face_point,mtx_tag,&csys_tag );             /* Create new CSYS */
      if ( error != 0 )
      {
        UF_OBJ_set_blank_status( steels[cnt],UF_OBJ_NOT_BLANKED );           /* Unblank the steel */
//UF_get_fail_message ( error,message );
        sprintf( box_message,"Error Creating CSYS for Steel %s - Steel Skipped",object_name );
        uc1601( box_message,1 );
        goto donewithsteel;
      }
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2010-11-21 01:04:57 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

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

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

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-9-20 18:39 , Processed in 0.021040 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

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