16,473
社区成员
发帖
与我相关
我的任务
分享
SmoothSpline(tag_t spline_tag)
{
UF_CURVE_spline_t spline_data;
int cont_order;
double dist_toler, ang_toler;
double smooth_param = 1.2;
int num_states;
UF_CURVE_state_p_t states;
tag_t output_tag;
UF_CALL(UF_CURVE_ask_spline_data(spline_tag,&spline_data));//get spline_data
cont_order=2;
dist_toler=smooth_param;
ang_toler=360;
UF_CALL( UF_CURVE_smooth_spline_data
(&spline_data,cont_order,dist_toler,ang_toler,&num_states,&states));//光顺曲线
UF_CALL(UF_CURVE_create_spline(&spline_data,&output_tag,&num_states,&states));
//光顺以后重新生成曲线
UF_OBJ_set_color(spline_tag, 1);
UF_free(spline_data.knots);
UF_free(spline_data.poles);
UF_free(states);
return output_tag;