|
悬赏5G币未解决
UF_MODL_create_fitted_spline()通过点生成样条曲线 不会用 求指导; \ x, {# _2 g5 L. m
也看过帮助文档,但是没实例,SPLINE_FIT_p_t 这种数据结构没看懂
$ t7 `# s. x2 [5 v* Ystatic void do_ugopen_api(void)
2 D( g# n s: h6 G X' u{5 S I, T) A0 H% @
: q9 U' i6 t2 P! G
double sp1;7 i8 ~# n# {6 o8 \( E4 _
" g( u. Q" f9 e double pt[15]={1.1000, 0.5320, 2.0000,
/ H8 y. a9 E! v& |6 { 1.5240, 0.6789, 2.3000,/ H7 f& f% v' c# \2 T
2.0000, 0.9000, 3.5956,4 n4 t; [ N" H2 |
2.3456, 1.3456, 3.7890,0 k: w0 U; Z$ P1 o* b
3.1000, 2.4567, 3.3214};
: @. d/ N( q! \* v& ^) I int err_pt=0;5 L0 q5 c- Y Q& G# W7 `! ]
int i;) U2 A/ z: u# u
tag_p_t curved_id;
* |+ j5 W: G a4 z- W* I3 ~9 I/ t9 ^- w8 U6 \7 |, h. D+ D+ n
SPLINE_FIT_p_t spdata; //数据结构 这个不会用
" J% R1 F: c4 I9 G# Q spdata->degree=3;
4 t: Y. U E1 M* A spdata-> num_of_points=5;
6 C$ V9 I0 G- e8 I+ Z spdata->num_of_segments=1;4 ~8 N! e" T. m8 O
double *points;
. p# T. k* q" h
8 k: T. _# y* y! b6 I# k. B0 p// points
" x/ k ]3 \; u3 z+ M' p// double *6 m, L2 p* \& l* N7 W' s$ R
// - B/ h9 S* r& B% T
// coordinates for the points to be fitted.
6 D! y/ b! X* ^2 a// points[0~2] = (x, y, z) for the 1st point, ' u1 p8 G$ h. Y
// points[3~5] = (x, y, z) for the 2nd point,
p, k3 p7 A, m// ...5 l( i# ~4 K6 D$ L; m ?0 i6 k
0 M( j1 d/ x4 M. K
; a5 D' @9 p& @$ T( r
+ {4 |5 @/ n0 Z0 \1 E4 u
for(i=0;i<15;i++) j* J* V+ S. P7 C) F! D0 q
{0 f1 `! p, g; E$ X
spdata->points[i]=pt[i]; //在这里可能错误 不会赋值8 {: x. p1 C1 Z, R: G. T( g
// spdata[i].points[0]=pt[3*i];8 H7 h9 x/ ~* R' ~
// spdata[i].points[1]=pt[3*i+1];! z% i# u: h9 D, z0 h
// spdata[i].points[2]=pt[3*i+2];6 ^4 {! W3 n, K" q8 I; b
3 I# p5 T7 E" _. d% C }
4 n/ t+ ~5 L, L8 v8 v # c% z& Z1 Z: x: j) c- l1 `; ]
//通过点的样条曲线$ B0 l/ r! \5 s
UF_MODL_create_fitted_spline(spdata,&sp1,&err_pt,curved_id); & t# w1 y& ~2 {: r3 Z
' H$ {8 M8 M8 {1 {}' B8 B2 S9 k' z7 b. i7 L8 W
9 h' _/ _0 u4 E/ A9 C
|
|