iCAx开思网
标题:
UF_CSYS_create_matrix第一个参数传递无效??
[打印本页]
作者:
sunmz_wjxy
时间:
2010-11-2 15:35
标题:
UF_CSYS_create_matrix第一个参数传递无效??
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;
}
作者:
zjs
时间:
2010-11-2 22:35
Matrix values -- should be normalized and orthogonal. Use UF_MTX3_initialize to
这个矩阵必需单位化,并且是正交矩阵
作者:
sunmz_wjxy
时间:
2010-11-3 09:28
请问在上面这份代码的什么地方添加上UF_MTX3_initialize以实现矩陈的单位化???
能否帮我修改一下这个代码,我很急!!!!
作者:
zjs
时间:
2010-11-3 11:28
将matrix9 改为:
1,0,0
0,1,0
0,0,1
试试,你就可以发现问题了。
工作还是需要自己动手。
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3