青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 82805|回复: 9

教大家如何使用ugapi语言生成spline曲线

[复制链接]
发表于 2007-5-17 10:53 | 显示全部楼层 |阅读模式
UF_CURVE_state_t *states;; b& Y' }/ @2 W2 o5 z+ h0 U1 k
UF_CURVE_spline_t splinedata;# ]7 a, N  y) I  `5 ]1 ?# {; [

1 t$ y9 a5 `# v1 H* Nsplinedata.knots=new double[9];4 `6 J8 d6 R6 o
splinedata.knots[0]=0.0;
, s3 w" Q) D- }6 m) ksplinedata.knots[1]=0.0;7 h8 F/ W9 y6 j% J. O# D
splinedata.knots[2]=0.0;4 H* Q. l: |8 h, @. ?
splinedata.knots[3]=0.0;. y7 z* v8 H  x1 ~( D8 m4 ^
splinedata.knots[4]=0.5;
: [1 V5 b  x' f+ o8 ]) \3 nsplinedata.knots[5]=1.0;
* m; @* v" X; `: m" u& ?7 Vsplinedata.knots[6]=1.0;: l1 ~( @9 z- Y8 E* ~' i& I
splinedata.knots[7]=1.0;$ {4 M! [0 O( i' r5 V/ S
splinedata.knots[8]=1.0;! }; B- C# t- z" u+ y
splinedata.start_param=0;
) L  b8 c! Z  c3 c1 u7 P0 esplinedata.end_param=1;8 p/ v4 R& j7 N: l5 Z9 r
splinedata.is_rational=1;3 d* U7 R; w7 {4 ?  \! H3 r5 Q( z
splinedata.num_poles=5;
# q' |7 g, `1 R5 u7 X; E4 u9 _splinedata.order=4;
5 L( x" ?: [, K, C- Csplinedata.poles=new double[5][4];) v+ ~* ?- U! c6 o0 R1 G8 O
splinedata.poles[0][0]=111.0;1 Q9 n6 d5 v( x  K5 G! f& \
splinedata.poles[0][1]=31.0;
' R& ~  m, l) O+ Rsplinedata.poles[0][2]=46.0;
# A9 O4 ^+ r4 V' w# o* |splinedata.poles[0][3]=1.0;
7 l! ?9 m3 R: u# g: K' csplinedata.poles[1][0]=107.0;1 F2 x# C  z9 r( N2 G0 }5 Z+ W1 r
splinedata.poles[1][1]=46.0;
+ b8 S* T6 o7 I! l1 hsplinedata.poles[1][2]=46.0;7 G+ V- V6 C5 C; i3 p% @
splinedata.poles[1][3]=1.0;
# K6 k- z. |7 \splinedata.poles[2][0]=98.0;. ^" ]2 g, F8 I/ c* K7 k/ [5 [4 B5 S7 [
splinedata.poles[2][1]=37.0;/ P6 B% Z  X/ ^( e
splinedata.poles[2][2]=46.0;
; U# I" o  O: Bsplinedata.poles[2][3]=1.0;
' R/ Q7 Q& ^2 e( _1 ]9 Esplinedata.poles[3][0]=100.0;
( j- B5 `) x) ?* Psplinedata.poles[3][1]=35.0;9 n: N; w0 c5 U: T
splinedata.poles[3][2]=46.0;- ~& x' z1 r- d  n
splinedata.poles[3][3]=1.0;
" F  e6 P- J6 T: Gsplinedata.poles[4][0]=8.0;' Y, J) U5 b5 ]* x
splinedata.poles[4][1]=89.0;
+ A7 K$ Y( w3 }4 nsplinedata.poles[4][2]=56.0;2 Q! |$ ^8 j# r, n
splinedata.poles[4][3]=1.0;
1 z0 X7 e% t& ~, X3 u% [. ]( M+ x0 i7 X0 p) O- ^
UF_CURVE_create_spline (&splinedata,&splinetag,&num_states,&states);

评分

参与人数 1流量 +10 +2 技术 +1 收起 理由
xcb + 10 + 2 + 1 精品文章

查看全部评分

发表于 2007-5-17 13:00 | 显示全部楼层
多加点分,鼓励一下,二次开发板块人气不行啊!
发表于 2007-5-22 22:59 | 显示全部楼层
都是版大来的  
发表于 2007-6-3 10:08 | 显示全部楼层

二次開發的人不多

人氣不行呀..我踩
发表于 2007-6-8 13:18 | 显示全部楼层
支持
发表于 2007-6-13 19:42 | 显示全部楼层
支持!!!!!!!!!!!!!!!!!
发表于 2007-7-5 22:56 | 显示全部楼层
支持!!!!!!!!!!!!!!!!!
发表于 2007-7-15 19:45 | 显示全部楼层
都看不懂!晕
发表于 2009-3-31 20:35 | 显示全部楼层
生成的什么哦?
回复 支持 反对

使用道具 举报

发表于 2009-3-31 21:26 | 显示全部楼层
有两个变量需要定义才能通过编译
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-4-2 09:15 , Processed in 0.139588 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表