|
悬赏5G币未解决
UF_MODL_create_fitted_spline()通过点生成样条曲线 不会用 求指导
! V b, E9 o( d也看过帮助文档,但是没实例,SPLINE_FIT_p_t 这种数据结构没看懂
% s6 r% i. ]$ P" g% u- bstatic void do_ugopen_api(void)
( G8 s/ d2 v. e{
# x: Q- G z0 ^8 j+ J
4 g5 Q% y! t& s! | double sp1;
3 _) C9 k8 K3 v7 Z8 @' X5 |
; ^ L" w8 \* x0 k double pt[15]={1.1000, 0.5320, 2.0000,
^+ F4 T8 }0 q8 ^8 d. | 1.5240, 0.6789, 2.3000,
5 h& N: r0 s/ v0 _5 _* C4 d( C 2.0000, 0.9000, 3.5956,/ Q, M: M4 S4 i$ m9 u& t$ p
2.3456, 1.3456, 3.7890,. I d4 L* W/ h6 q
3.1000, 2.4567, 3.3214};4 N. i9 X- d1 j6 s
int err_pt=0;
, E" y: Q3 w0 W* n int i;
7 Y. J, q, b* z5 F+ o. [ tag_p_t curved_id;
! b6 y y3 W, v1 N3 o: |1 K* N6 B; J. [+ t/ J1 Y) K5 z8 ^6 s8 f
SPLINE_FIT_p_t spdata; //数据结构 这个不会用
7 j' F* ]+ m* x spdata->degree=3;2 D$ H; d- U2 B
spdata-> num_of_points=5; \- n/ \/ @, Y) Z6 e" o% L
spdata->num_of_segments=1;
* r: I; C; j6 S' Q, ^ double *points;
: X2 P# i8 L- f1 H% i$ [7 k0 n L, }3 S! y. e7 c" i
// points $ J* M1 |( t$ [
// double *& f' r/ a9 j) T
//
+ S, Z% a6 I q( M; t! N' P// coordinates for the points to be fitted. 3 Y# E& y) s' B! U
// points[0~2] = (x, y, z) for the 1st point,
6 D/ A$ [ m& E/ w: E" w// points[3~5] = (x, y, z) for the 2nd point, * q0 t1 F6 d# @9 r3 `6 E$ I
// ...& q( y" c ?! K- w( y1 z( l5 ]
) @' I# |; l* {+ I6 k% }# n
& G t/ y+ m7 G# I2 | " L7 A% K! h1 |
for(i=0;i<15;i++)& g( ~6 x7 m6 @; Q' B
{
7 n m0 b" ^2 e3 @, z" ? spdata->points[i]=pt[i]; //在这里可能错误 不会赋值
( |+ i2 A$ w! L8 L8 s8 [ // spdata[i].points[0]=pt[3*i];: a( X; D/ k3 w% m
// spdata[i].points[1]=pt[3*i+1];' o7 s7 }8 U7 y5 J
// spdata[i].points[2]=pt[3*i+2];
6 |: X5 m! {% {0 ^1 E, i6 g
" p' @$ E6 o) {- T+ T5 b }
( G$ o8 W5 N9 I& ?5 d
& ^7 U6 n( n" Z3 R# I2 \# A8 ^& L //通过点的样条曲线
/ Y* S2 c4 [8 _% p3 S UF_MODL_create_fitted_spline(spdata,&sp1,&err_pt,curved_id);
d: D7 \6 d- N. h) i' r: e% o8 v: d2 U# p: r/ T
}
# r' V) h8 }2 \/ @* N G2 W+ g
3 m, j, l* l: w) X3 e |
|