|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
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;
} |
|