最近遇到一个问题,想用这个函数画个凸轮廓线,我目前已经利用数学公式获得凸轮廓线的X,Y,Z的坐标,生成.dat文件,我想能不能利用这个UF_CURVE_create_spline_thru_pts函数,生成一个廓线,不知道还有没有其他的方法,主要想调用生成的.dat文件,这个函数里的 point_data,参数不会用,想能不能从.dat中读出数组,赋给这个 point_data?纠结中!!部分代码如下% g+ U4 g4 X7 ?* P* m8 y
//public int Excute()2 H+ p' D2 i6 j
//{
) f& r& b1 I, B // /* B-spline parameters */6 L0 F" o& I; Z1 m, C, Z8 r
// int degree = 3;
3 n( J; |# b* @ // int periodicity = 1;: m5 t7 W5 s# e- m' A
// int num_points = NUMBER_POINTS;6 n y1 w: L1 ~; M
// int save_def_data = 1;
e+ }) |! p0 ?% A9 r8 u // /* Point/slope UFCurve attribute array */
- h, M* A$ I6 s! y // UFCurve.PtSlopeCrvatr[] point_data = new UFCurve.PtSlopeCrvatr[NUMBER_POINTS];
# A' A8 ]+ p/ S0 Q$ }- ~" F- j, G/ u" F2 _4 P
// fs = new FileStream(path, FileMode.Open, FileAccess.Read);. `8 R5 N* U9 r5 K, l' d. Z1 g
// StreamReader br = new StreamReader(fs, System.Text.Encoding.GetEncoding("gb2312")); * K4 a0 L$ L# _' I& p0 K9 J
// string m = br.ReadLine();
! u, u8 b. o! C! K4 y" h# S1 C // string[] arr = m.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);! |/ {# U$ ^2 c/ z
// List<double> list = new List<double>();0 ~" B# g# _, Y+ ~* R
t* s" N* E4 K* }8 f
// w.Flush();1 Z/ o6 D* N4 e& L6 o
// w.Close();& v; X% d- A$ x0 w# t& [- f
+ g' Z0 ?9 k6 ]6 e; c: ^
// /* Arrays of user's defining point data */
- \* Z1 H1 u& s) c // double[] parameters = null;1 |+ ?. j/ ?1 A4 z+ [& j& Z9 K
// double[] points = arr;
8 C; v) @! D, o2 ]$ A' d# Z) C // Tag spline_tag;, ]6 l4 {2 z: V% O4 `
0 \2 Z3 O# f. Y1 H# U H; p8 b7 h // /* Create B-spline UFCurve */4 S5 w' o* A& g, k4 k
// theUfSession.Curve.CreateSplineThruPts(degree,: U% N+ }* O" Z7 P1 |7 E
// periodicity,
- G8 {4 i. l* |8 B // num_points,! f, Y$ S; v0 t( f. l$ N; D- B& Y
// point_data,. I' I8 M* Y8 U9 s" i1 B
// parameters,
Y( [ W" I2 @5 m // save_def_data,' i$ L$ `* C2 l$ n3 J' U6 F2 r
// out spline_tag);$ G, n& z/ z- B u* z
// theUfSession.Part.Save();& ~6 m% F; E' R4 ~3 R* d
// return 0;( S* p8 M, \$ N* B
//}
9 h' v3 X' \2 J' C5 g2 F* R* u还有这个ug6里面的journal功能,能不能录个insert-curve-spline,选择throUGh points的操作过程啊!!! |