資源簡介
在Matlab GUI中實現(xiàn)了Bezier任意階數(shù)曲線和曲面的繪制。曲線可使用鼠標生成控制點,控制點可隨意拖動;也可手動輸入控制點坐標。曲面控制點信息可使用xls文件導入,也可手動輸入控制點坐標。
程序使用Matlab GUI編寫。
文件清單:
===========必需文件============
----bezier_test.m、bezier_test.fig:bezier曲線繪制主頁面程序(主程序入口)
----bezier_surface.m、bezier_surface.fig:bezier曲線繪制頁面程序
----bezier_DeCas.m、bezier_DeCas.fig:De_Casteljau算法顯示頁面程序
----my_bezier.m:bezier曲線/曲面生成子函數(shù)
----my_Curve_De_Casteljau.m:曲線De_Casteljau算法子函數(shù)
----my_Surface_De_Casteljau.m:曲面De_Casteljau算法子函數(shù)
----at.xls:繪制“@”圖案用到的控制點坐標信息文件
============非必需文件===========
----bezier_surface_control_points:實例文件,曲面控制點信息文件。導入此文件,可繪制Bezier曲面。

代碼片段和文件信息
function?varargout?=?bezier_DeCas(varargin)
%?BEZIER_DECAS?MATLAB?code?for?bezier_DeCas.fig
%??????BEZIER_DECAS?by?itself?creates?a?new?BEZIER_DECAS?or?raises?the?existing
%??????singleton*.
%
%??????H?=?BEZIER_DECAS?returns?the?handle?to?a?new?BEZIER_DECAS?or?the?handle?to
%??????the?existing?singleton*.
%
%??????BEZIER_DECAS(‘CALLBACK‘hobjecteventDatahandles...)?calls?the?local
%??????function?named?CALLBACK?in?BEZIER_DECAS.M?with?the?given?input?arguments.
%
%??????BEZIER_DECAS(‘Property‘‘Value‘...)?creates?a?new?BEZIER_DECAS?or?raises?the
%??????existing?singleton*.??Starting?from?the?left?property?value?pairs?are
%??????applied?to?the?GUI?before?bezier_DeCas_OpeningFcn?gets?called.??An
%??????unrecognized?property?name?or?invalid?value?makes?property?application
%??????stop.??All?inputs?are?passed?to?bezier_DeCas_OpeningFcn?via?varargin.
%
%??????*See?GUI?Options?on?GUIDE‘s?Tools?menu.??Choose?“GUI?allows?only?one
%??????instance?to?run?(singleton)“.
%
%?See?also:?GUIDE?GUIDATA?GUIHANDLES
%?Edit?the?above?text?to?modify?the?response?to?help?bezier_DeCas
%?Last?Modified?by?GUIDE?v2.5?11-May-2014?15:19:04
%?Begin?initialization?code?-?DO?NOT?EDIT
gui_Singleton?=?1;
gui_State?=?struct(‘gui_Name‘???????mfilename?...
???????????????????‘gui_Singleton‘??gui_Singleton?...
???????????????????‘gui_OpeningFcn‘?@bezier_DeCas_OpeningFcn?...
???????????????????‘gui_OutputFcn‘??@bezier_DeCas_OutputFcn?...
???????????????????‘gui_LayoutFcn‘??[]??...
???????????????????‘gui_Callback‘???[]);
if?nargin?&&?ischar(varargin{1})
????gui_State.gui_Callback?=?str2func(varargin{1});
end
if?nargout
????[varargout{1:nargout}]?=?gui_mainfcn(gui_State?varargin{:});
else
????gui_mainfcn(gui_State?varargin{:});
end
%?End?initialization?code?-?DO?NOT?EDIT
%?---?Executes?just?before?bezier_DeCas?is?made?visible.
function?bezier_DeCas_OpeningFcn(hobject?eventdata?handles?varargin)
%?This?function?has?no?output?args?see?OutputFcn.
%?hobject????handle?to?figure
%?eventdata??reserved?-?to?be?defined?in?a?future?version?of?MATLAB
%?handles????structure?with?handles?and?user?data?(see?GUIDATA)
%?varargin???command?line?arguments?to?bezier_DeCas?(see?VARARGIN)
????handles.column_name_list={‘原始控制點‘?‘第1次插值‘?‘第2次插值‘?‘第3次插值‘?‘第4次插值‘‘第5次插值‘...
???????????????????????????????‘第6次插值‘?‘第7次插值‘?‘第8次插值‘?‘第9次插值‘‘第10次插值‘...
???????????????????????????????‘第11次插值‘?‘第12次插值‘?‘第13次插值‘?‘第14次插值‘‘第15次插值‘};
????handles.row_name_list={‘P0‘‘P1‘‘P2‘‘P3‘‘P4‘‘P5‘‘P6‘‘P7‘‘P8‘‘P9‘‘P10‘‘P11‘‘P12‘‘P13‘‘P14‘‘P15‘};
????set(handles.CtrlPtNum_edit‘String‘4);
????set(handles.DeCas_uitable‘ColumnEditable‘?[true?false?false?false?false]);?
????set(handles.DeCas_uitable2‘ColumnEditable‘?[true?false?false?false?false]);?
????data=cell(55);
????for?j=2:5
????????for?i=(7-j):5
????????????data{ij}=‘----------‘;
????????end
????end
????set(handles.DeCas_uitable‘Data‘?data);?
????set(handles.DeCas_uitable‘ColumnName‘?{‘原始控制點‘?‘第1次插值‘?‘第2次插值‘
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????22528??2014-05-10?20:04??程序源代碼\at.xls
?????文件???????5784??2014-05-12?11:57??程序源代碼\bezier_DeCas.fig
?????文件??????12767??2014-05-12?11:57??程序源代碼\bezier_DeCas.m
?????文件???????7479??2014-05-11?17:21??程序源代碼\bezier_surface.fig
?????文件??????12514??2014-05-11?17:21??程序源代碼\bezier_surface.m
?????文件??????17408??2014-05-09?20:38??程序源代碼\bezier_surface_control_points.xls
?????文件??????10792??2014-05-13?00:02??程序源代碼\bezier_test.fig
?????文件??????23090??2014-05-13?00:20??程序源代碼\bezier_test.m
?????文件????????737??2014-05-09?13:49??程序源代碼\my_bezier.m
?????文件????????393??2014-05-09?12:35??程序源代碼\my_Curve_De_Casteljau.m
?????文件????????557??2014-05-09?12:50??程序源代碼\my_Surface_De_Casteljau.m
?????文件????????651??2014-08-14?15:50??Bezier程序清單.txt
?????文件??????33881??2014-08-14?15:49??Bezier程序使用說明.docx
?????目錄??????????0??2014-05-13?01:39??程序源代碼
-----------?---------??----------?-----??----
???????????????148581????????????????????14
評論
共有 條評論