求助,pcl创建样条曲线
浏览:113950
经常一次作很多样条曲线,一条一条来很麻烦。突发奇想:能不能编个程序,每次创建的时候只需把坐标替换、然后运行就OK?!下面是用户手册里面找到的一个创建样条曲线的例子,但本人编程一窍不通。哪位达人能帮我写一个一次连续创建多条样条曲线的PCL程序啊?比如一次创建4条样条曲线(事实上我经常一次作几十条,一条一条,苦啊):
1 [230000,0,50] [230000,850,220] [230000,1530,790] [230000,2120,1440] [230000,2700,2110] [230000,3240,2810] [230000,3770,3520] [230000,4260,4250] [230000,4760,4980] [230000,5270,5700] [230000,5780,6430] [230000,6280,7150] [230000,6780,7880] [230000,7280,8610] [230000,7770,9340] [230000,8260,10080] [230000,8750,10820] [230000,9240,11550] [230000,9730,12290] [230000,10210,13030]
2 [222000,0,50] [222000,960,90] [222000,1840,490] [222000,2590,1080] [222000,3310,1730] [222000,4000,2410] [222000,4690,3080] [222000,5340,3790] [222000,5980,4520] [222000,6600,5250] [222000,7230,5990] [222000,7840,6730] [222000,8440,7490] [222000,9020,8260] [222000,9600,9030] [222000,10180,9800] [222000,10730,10600]
3 [214000,0,50] [214000,1040,60] [214000,2070,250] [214000,3010,690] [214000,3900,1240] [214000,4740,1860] [214000,5560,2500] [214000,6350,3190] [214000,7100,3910] [214000,7840,4650] [214000,8550,5410] [214000,9240,6200] [214000,9920,6990] [214000,10570,7800] [214000,11220,8620] [214000,11830,9470] [214000,12440,10320] [214000,12990,11210] [214000,13530,12100]
4 [206000,0,50] [206000,1120,50] [206000,2230,120] [206000,3320,360] [206000,4360,760] [206000,5360,1260] [206000,6320,1840] [206000,7220,2490] [206000,8090,3200] [206000,8930,3940] [206000,9720,4730] [206000,10490,5540] [206000,11230,6370] [206000,11930,7250] [206000,12600,8140] [206000,13240,9060] [206000,13820,10010] [206000,14360,10990]
小弟在此感激不尽!
asm_const_curve_bspline ()
#
# Purpose : This file provides an example of a call to the
# function asm_const_curve_bspline()
#
# This session file will create a new database by
# name ’new.db’ and call the above mentioned
# function and create a bspline closed curve.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function asm_const_curve_bspline()
# has the following arguments:
#
# asm_const_curve_bspline
# ( output_ids,
# ncurves,
# point_list,
# order,
# interpolate,
# param_method,
# closed,
# created_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_output_ids[16]
INTEGER i_ncurves
STRING s_point_list[64]
INTEGER i_order
LOGICAL l_interpolate
INTEGER i_param_method
LOGICAL l_closed
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Enabling the curve and point labeling.
curve_label(TRUE)
point_label(TRUE)
#---------------------------------------------------------------------
# Creating a four segment fourth order closed piecewise cubic curve.
s_output_ids = "#"
i_ncurves = 4
s_point_list = "[0 0 0][1 1 1][-1 .5 1][0 1 1]"
i_order = 4
l_interpolate = TRUE
i_param_method = 1
l_closed = TRUE
#
i_return_value = @
asm_const_curve_bspline @
( s_output_ids, @
i_ncurves, @
s_point_list, @
i_order, @
l_interpolate, @
i_param_method, @
l_closed, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
sys_free_string(sv_created_ids)
#---------------------------------------------------------------------
1 [230000,0,50] [230000,850,220] [230000,1530,790] [230000,2120,1440] [230000,2700,2110] [230000,3240,2810] [230000,3770,3520] [230000,4260,4250] [230000,4760,4980] [230000,5270,5700] [230000,5780,6430] [230000,6280,7150] [230000,6780,7880] [230000,7280,8610] [230000,7770,9340] [230000,8260,10080] [230000,8750,10820] [230000,9240,11550] [230000,9730,12290] [230000,10210,13030]
2 [222000,0,50] [222000,960,90] [222000,1840,490] [222000,2590,1080] [222000,3310,1730] [222000,4000,2410] [222000,4690,3080] [222000,5340,3790] [222000,5980,4520] [222000,6600,5250] [222000,7230,5990] [222000,7840,6730] [222000,8440,7490] [222000,9020,8260] [222000,9600,9030] [222000,10180,9800] [222000,10730,10600]
3 [214000,0,50] [214000,1040,60] [214000,2070,250] [214000,3010,690] [214000,3900,1240] [214000,4740,1860] [214000,5560,2500] [214000,6350,3190] [214000,7100,3910] [214000,7840,4650] [214000,8550,5410] [214000,9240,6200] [214000,9920,6990] [214000,10570,7800] [214000,11220,8620] [214000,11830,9470] [214000,12440,10320] [214000,12990,11210] [214000,13530,12100]
4 [206000,0,50] [206000,1120,50] [206000,2230,120] [206000,3320,360] [206000,4360,760] [206000,5360,1260] [206000,6320,1840] [206000,7220,2490] [206000,8090,3200] [206000,8930,3940] [206000,9720,4730] [206000,10490,5540] [206000,11230,6370] [206000,11930,7250] [206000,12600,8140] [206000,13240,9060] [206000,13820,10010] [206000,14360,10990]
小弟在此感激不尽!
asm_const_curve_bspline ()
#
# Purpose : This file provides an example of a call to the
# function asm_const_curve_bspline()
#
# This session file will create a new database by
# name ’new.db’ and call the above mentioned
# function and create a bspline closed curve.
#
# This file can be run by starting a session of
# MSC Patran, and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function asm_const_curve_bspline()
# has the following arguments:
#
# asm_const_curve_bspline
# ( output_ids,
# ncurves,
# point_list,
# order,
# interpolate,
# param_method,
# closed,
# created_ids )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_output_ids[16]
INTEGER i_ncurves
STRING s_point_list[64]
INTEGER i_order
LOGICAL l_interpolate
INTEGER i_param_method
LOGICAL l_closed
STRING sv_created_ids[VIRTUAL]
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database "new.db"
uil_file_new.go("","new.db")
$? YES 36000002
#---------------------------------------------------------------------
# Enabling the curve and point labeling.
curve_label(TRUE)
point_label(TRUE)
#---------------------------------------------------------------------
# Creating a four segment fourth order closed piecewise cubic curve.
s_output_ids = "#"
i_ncurves = 4
s_point_list = "[0 0 0][1 1 1][-1 .5 1][0 1 1]"
i_order = 4
l_interpolate = TRUE
i_param_method = 1
l_closed = TRUE
#
i_return_value = @
asm_const_curve_bspline @
( s_output_ids, @
i_ncurves, @
s_point_list, @
i_order, @
l_interpolate, @
i_param_method, @
l_closed, @
sv_created_ids )
dump i_return_value
dump sv_created_ids
sys_free_string(sv_created_ids)
#---------------------------------------------------------------------