iCAx开思工具箱
标题:
求曲面(U=0.5,V=0.5)位置和曲面法向问题
[打印本页]
作者:
asku88
时间:
2009-6-27 09:14
标题:
求曲面(U=0.5,V=0.5)位置和曲面法向问题
用UF_MODL_ask_face_props求法向是正确的,但求曲面(U=0.5,V=0.5)位置结果不对
我这个电极的尺寸45.000x18.000x20.029
求出来的点数据明显超大
(, 下载次数: 2)
上传
点击文件名下载附件
下载积分: 贡献 -2
代码如下:
#include <uf.h>
#include <uf_exit.h>
#include <uf_ui.h>
#include <uf_modl.h>
#include <uf_disp.h>
#if ! defined ( __hp9000s800 ) && ! defined ( __sgi ) && ! defined ( __sun )
# include <strstream>
# include <iostream>
using std::ostrstream;
using std::endl;
using std::ends;
using std::cerr;
#else
# include <strstream.h>
# include <iostream.h>
#endif
#include "ask_props.h"
extern "C" DllExport void ufsta( char *param, int *returnCode, int rlen )
{
int errorCode = UF_initialize();
if ( 0 == errorCode )
{
int irc = 0;
char *message = "Select Object";
UF_UI_selection_options_t opts;
UF_UI_mask_t mask;
int response;
tag_t object, view;
double cursor[3];
UF_initialize();
opts.other_options = 0;
opts.reserved = NULL;
opts.num_mask_triples = 1;
opts.mask_triples = &mask;
opts.mask_triples->object_type = UF_solid_type;
opts.mask_triples->object_subtype = UF_solid_face_subtype;
opts.mask_triples->solid_type = UF_UI_SEL_FEATURE_ANY_FACE;
while (response!=2)
{
opts.scope = UF_UI_SEL_SCOPE_WORK_PART;
irc = UF_UI_select_single(message,&opts,&response,
&object,cursor,&view);
if (response==5)
{
double face_param[2],face_point[3],face_u_deriv1[3];
double face_v_deriv1[3],face_u_deriv2[3],face_v_deriv2[3];
double face_normal[3],face_radii[2];
char msg[256];
face_param[0] = 0.5;
face_param[1] = 0.5;
UF_MODL_ask_face_props(object,
face_param,
face_point,
face_u_deriv1,face_v_deriv1,
face_u_deriv2,face_v_deriv2,
face_normal,face_radii);
sprintf(msg,"曲面(U=0.5,V=0.5)位置:\n X = %.3f\n Y = %.3f\n Z = %.3f \n\n曲面法向:\n I = %.3f\n J = %.3f\n K = %.3f \n\n",
face_point[0],face_point[1],face_point[2],
face_normal[0],face_normal[1],face_normal[2]);
uc1601(msg,1);
UF_DISP_set_highlight(object,0);
}
}
errorCode = UF_terminate();
}
}
extern "C" int ufusr_ask_unload( void )
{
return( UF_UNLOAD_IMMEDIATELY );
}
复制代码
作者:
jaken99
时间:
2012-4-15 19:51
到最后你会发现连面的法向都不对了
作者:
qindongjun88
时间:
2012-4-16 09:10
jaken99 ,"到最后你会发现连面的法向都不对了"
为什么呀?
作者:
zale_lzj
时间:
2012-4-19 12:35
曲面(U=0.5,V=0.5), 并不一定是曲面中心,因为这个面被边界修剪过了
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3