曲线拟合函数UF_MODL_create_fitted_spline()的问题
想求助一下大家UF_MODL_create_fitted_spline()函数参数到底怎么使用啊?这里有一段给出点的程序,请帮忙看一下:
void do_ugopen_api()
{
int i=1,k,num=5;
double j=1;
double point={1.0, 0.5320, 2.0000,
1.5240, 0.6789, 2.3,
2.0000, 0.90000,3.5956,
2.3456, 1.3456, 3.7890,
3.1000, 2.4567, 3.3214};
SPLINE_FIT_t spline_data;
double max_err;
int max_err_pt;
tag_t obj_id;
int fit_method=1;
logical * is_self_intersecting;
UF_CURVE_spline_t spline_data1;
tag_t spline_tag;
int num_states;
UF_CURVE_state_t *states;
spline_data.degree=3;
spline_data.num_of_points=5;
spline_data.num_of_segments=1;
spline_data.num_of_weights=5;
for(k=0;k<15;k++)
{
spline_data.points=point;
}
spline_data.slopes=NULL;
spline_data.slope_flag=3;
spline_data.tolerance=0.001;
spline_data.weights=NULL;
spline_data.weight_positions=#
UF_MODL_curve_fit_datafit_data;
fit_data.curve_fit_method=1;
fit_data.maximum_degree=3;
fit_data.maximum_segments=1;
UF_CALL(UF_MODL_set_curve_fit_method(fit_method));
UF_CALL(UF_MODL_create_fitted_spline(&spline_data,&max_err,&max_err_pt,&obj_id));
UF_CURVE_is_spline_self_int( obj_id, is_self_intersecting);//确定曲线是否已经自我相交形成环
}
参数weight_position好像一直出错误。 太高深了,不懂这是什么? mwg 发表于 2016-7-10 09:58
太高深了,不懂这是什么?
就是根据一系列已知坐标的点拟合出一条BURBS曲线来。 mwg 发表于 2016-7-10 09:58
太高深了,不懂这是什么?
就是根据一系列已知坐标的点拟合出一条BURBS曲线来。 你问的问题,是一些非常基础和简单的问题,看你的代码就知道,你根本就没有理解输入的参数是什么。
拿你的数据做了一下,可以看看结果;(你可以把你的点整到NX,然后手工拟合,看看与我动画的曲线形状是不是一样的。
二次开发相关的资料目前在网络上少得可怜,能找到的也是一些老的MFC在搞,那些代码:
1、教授也是乱抄的,拿过来直接编译都是不通过的;
2、已经过时,建议不要学了;
3、要学就学最新版的UI界面来做二次开发。
在整个网络上,目前能将二次开发,从入门讲解做到高级的二次开发工具做出来的教程,只有我做过。
有兴趣关注一下:(可以看目录,还有前面的试看教程)
http://www.chuanke.com/3405460-153615.html
我想说如果你想设置第五个数权重,应该需要将其他位置的权重也给出来吧?
weight_positions
int *
The index of points (from 1 ~ num_of_points) for the user-defined
weights to apply to
而且,这个structure在使用前不应该先初始化一下吗就是SPLINE_FIT_t spline_data={0};这样不用的参数不会因为没有初始化而影响到你
页:
[1]