青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

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

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

[复制链接]
发表于 2007-5-17 10:53 | 显示全部楼层 |阅读模式
UF_CURVE_state_t *states;8 E5 r, `/ w2 ?- i
UF_CURVE_spline_t splinedata;
( L* ?9 C* a! A3 w
% N/ n; j; K+ L; @" [splinedata.knots=new double[9];4 X/ i/ m0 k8 R; \7 ?# T4 p! |
splinedata.knots[0]=0.0;
2 [3 X  J: ]" s* ]  `/ F, psplinedata.knots[1]=0.0;
# Y) E7 P5 d* @' x5 S5 H  m' Zsplinedata.knots[2]=0.0;
' w  p( m6 C5 \7 p* dsplinedata.knots[3]=0.0;$ D: y" Q8 W- H" g2 Z& I, s/ i
splinedata.knots[4]=0.5;2 }! U' _+ R. @& E' S; D& q; X
splinedata.knots[5]=1.0;0 [9 t& M9 K7 O; g( n
splinedata.knots[6]=1.0;* F" V: ^0 T0 b& ^! A& F0 `
splinedata.knots[7]=1.0;8 M0 s! g- u9 O3 L
splinedata.knots[8]=1.0;
% w# E/ o! c- W; {splinedata.start_param=0;
9 A* V8 H4 z# Z3 {* msplinedata.end_param=1;
  N& j1 Z, Q; X+ q; V2 q8 H  ]splinedata.is_rational=1;( ]: e" h5 U3 d. F2 j4 M6 A
splinedata.num_poles=5;
: Z- m  B  P9 a% jsplinedata.order=4;7 s# g: ]+ {7 \6 B
splinedata.poles=new double[5][4];
( n, F' x. i- X( M7 r1 Q; [  W$ L5 Tsplinedata.poles[0][0]=111.0;/ K) v/ Y3 D9 \1 Z% i+ o, u6 l
splinedata.poles[0][1]=31.0;
& `+ s4 Q; L1 `1 ~/ x3 @. qsplinedata.poles[0][2]=46.0;; z. ^# V; d  e# `
splinedata.poles[0][3]=1.0;6 ~/ V. g9 `1 C, ]
splinedata.poles[1][0]=107.0;
* z4 q3 p; A) g9 w, |splinedata.poles[1][1]=46.0;
8 e! _' K- H0 u9 a( P& Rsplinedata.poles[1][2]=46.0;# x: R) Y- @% f8 I( Q) W
splinedata.poles[1][3]=1.0;1 g( ^4 v1 w$ Z6 X
splinedata.poles[2][0]=98.0;
! h: d- f" r: xsplinedata.poles[2][1]=37.0;0 k6 H: T. t! W8 k* H- l0 ^% s
splinedata.poles[2][2]=46.0;
5 n/ {' o  H" Jsplinedata.poles[2][3]=1.0;$ a, K0 T6 {8 T, c% @# |. G% a, _1 j$ i
splinedata.poles[3][0]=100.0;
" p7 M. F* p1 N0 [, hsplinedata.poles[3][1]=35.0;
. Y+ m) @$ X1 Psplinedata.poles[3][2]=46.0;8 C% h9 n# {* j+ [; F" L
splinedata.poles[3][3]=1.0;
8 c5 w. V% P& }- G' Usplinedata.poles[4][0]=8.0;# }4 Z$ Q6 R+ j
splinedata.poles[4][1]=89.0;! o( ?* r( E  A: `. h% W
splinedata.poles[4][2]=56.0;
! p4 o3 C2 s; dsplinedata.poles[4][3]=1.0;7 a" m) Q+ ]% a5 i! X
) s. T; @, e, b- I, v6 C! Z
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-2-19 05:55 , Processed in 0.121154 second(s), 29 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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