|
想求助一下大家UF_MODL_create_fitted_spline()函数参数到底怎么使用啊?
这里有一段给出点的程序,请帮忙看一下:
void do_ugopen_api()
{
int i=1,k,num=5;
double j=1;
double point[15]={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_data fit_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好像一直出错误。 |
|