計算機(jī)輔助設(shè)計 第三次研究性教學(xué)._第1頁
計算機(jī)輔助設(shè)計 第三次研究性教學(xué)._第2頁
計算機(jī)輔助設(shè)計 第三次研究性教學(xué)._第3頁
計算機(jī)輔助設(shè)計 第三次研究性教學(xué)._第4頁
計算機(jī)輔助設(shè)計 第三次研究性教學(xué)._第5頁
已閱讀5頁,還剩87頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、產(chǎn)品數(shù)據(jù)交換標(biāo)準(zhǔn)一、研究性專題內(nèi)容簡介1. 利用MasterCAM軟件,以立方體為例,分析線框、表面、實體、特征建模所形成IGES的數(shù)據(jù),編制計算機(jī)程序從IGES格式中提取數(shù)據(jù)繪制出該立方體,打印出程序和相應(yīng)的模型,立方體尺寸按下式確定:長:3a;寬:2a;高:aa=20+(n-1); n:分組序號2. 以上述立方體為例,分別采用DXF、IGES、STEP數(shù)據(jù)交換格式,實現(xiàn)MasterCAM、AutoCAD、SolidEdge軟件之間的幾何圖形轉(zhuǎn)換,說明轉(zhuǎn)換步驟,并打印各自的截面圖形。3. 繪制右圖所示的圖形,尺寸按下式確定:長:3a;寬:2a;高:a;圓柱直徑:4/3a;圓柱高:2/3a,其

2、中,a值按照式(1)計算。分析IGES數(shù)據(jù)結(jié)構(gòu)中的主要數(shù)據(jù)參數(shù)數(shù)據(jù)。提交報告,報告中要體現(xiàn)本組的分工,具體到每個成員。二、利用MasterCAM軟件,以立方體為例,分析線框、表面、實體、特征建模所形成IGES的數(shù)據(jù),編制計算機(jī)程序從IGES格式中提取數(shù)據(jù)繪制出該立方體,打印出程序和相應(yīng)的模型線框建模:保存成IGES文件:S00000011H,1H;,20HMASTERCAM version X5,14H線模.MCX-5,11HMASTERCAMX5,1H1,16,G0000001 框建8,24,8,56,1.,2,2HMM,1,0.01,13H110417.124323,0.00005,100

3、.,8,0,;G0000002406 1 1 1 1 0 00000300D0000001406 0 1 1 15 0D0000002116 2 1 1 1 000000000D0000003116 0 3 1 0 0D0000004116 3 1 1 1 0 00000000D0000005116 0 3 1 0 0D0000006116 4 00000000D0000007116 0D0000008116 5 00000000D0000009116 0D0000010116 6 00000000D0000011116 0D0000012116 7 00000000D0000013116 0

4、D0000014116 8 00000000D0000015116 0D0000016116 9 00000000D0000017116 0D0000018110 10 00000000D0000019110 0D00000201 0 1 0 1 0 1 0 1 0 1 0 1 0 31 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0110 11 1 1 1 0 00000000D0000021110 0 3 1 0 0D0000022110 12 1 1 1 0 0000000

5、0D0000023110 0 3 1 0 0D0000024110 13 00000000D0000025110 0D0000026110 14 00000000D0000027110 0D0000028110 15 00000000D0000029110 0D0000030110 16 00000000D0000031110 0D0000032110 17 00000000D0000033110 0D0000034110 18 00000000D0000035110 0D0000036110 19 00000000D0000037110 1 0 1 0 1 0 1 0 1 0 1 0 1 0

6、 41 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 00D0000038110 20 1 1 1 0 00000000D0000039110 0 3 1 0 0D0000040110 21 1 1 1 0 00000000D0000041110 0 0D0000042 406,1,15HUnnamed 1P0000001116,0.,0.,0.; 3P0000002116,0.,0.,24.; 5P0000003116,0.,48.,0.; 7P0000004116,0.,48.

7、,24.; 9P0000005116,72.,0.,0.; 11P0000006116,72.,0.,24.; 13P0000007116,72.,48.,0.; 15P0000008116,72.,48.,24.; 17P0000009110,0.,0.,0.,0.,0.,24.; 19P0000010110,0.,0.,24.,0.,48.,24.; 21P0000011110,0.,48.,24.,0.,48.,0.; 23P0000012110,0.,48.,0.,0.,0.,0.; 25P00000133 Level51 0 1;110,72.,0.,0.,72.,0.,24.;27

8、P0000014110,72.,0.,24.,72.,48.,24.;29P0000015110,72.,48.,24.,72.,48.,0.;31P0000016110,72.,48.,0.,72.,0.,0.;33P0000017110,0.,0.,0.,72.,0.,0.;35P0000018110,0.,48.,0.,72.,48.,0.;37P0000019110,0.,0.,24.,72.,0.,24.;39P0000020110,0.,48.,24.,72.,48.,24.;41P0000021S0000001G0000002D0000042P0000021 T0000001IG

9、ES數(shù)據(jù)分析:該圖形所用到的相關(guān)的元素代號極其數(shù)據(jù)格式如下:組成元素:8個點(diǎn)(116)、12條直線(110)開始段(字母代號S)1行,全局段(字母代號G)2行,元素索引段(字母代號D)42行,參數(shù)數(shù)據(jù)段(字母代號P)21行和結(jié)束段(字母代號T)1行在數(shù)據(jù)段,8個116后面3個數(shù)據(jù)分別代表長方體8個頂點(diǎn)的坐標(biāo)。12個110后的數(shù)據(jù)表示長方體12條邊,每條邊有兩個點(diǎn)的坐標(biāo)表示。8個頂點(diǎn)12條邊組成了線框模型。表面建模:保存成IGES文件:S00000011H,1H;,20HMASTERCAM version X5,14H表模.MCX-5,11HMASTERCAMX5,1H1,16,G0000001

10、 面建8,24,8,56,1.,2,2HMM,1,0.01,13H110416.193909,0.00005,100.,8,0,;G0000002406 1 1 1 1 0 00000300D0000001406 0 1 1 15 0D0000002116 2 1 1 1 0 00000000D0000003116 0 3 1 0 0D0000004110 3 1 1 1 001000000D0000005110 0 3 1 0 0D0000006110 4 1 1 1 0 01000000D0000007110 0 3 1 0 0D0000008110 5 01000000D00000091

11、10 0D0000010110 6 01000000D0000011110 0D0000012110 7 01000000D0000013110 0D0000014110 8 01000000D0000015110 0D0000016110 9 01000000D0000017110 0D0000018110 10 01000000D0000019110 0D0000020110 11 01000000D0000021110 0D00000221 0 1 0 1 0 1 0 1 0 1 0 1 0 81 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 1

12、 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0110 12 1 1 1 0 01000000D0000023110 0 3 1 0 0D0000024110 13 1 1 1 0 01000000D0000025110 0 3 1 0 0D0000026110 14 01000000D0000027110 0D0000028128 15 00000000D0000029128 0D0000030128 17 00000000D0000031128 0D0000032128 19 00000000D0000033128 0D0000034128 21 00000000D

13、0000035128 0D0000036128 23 00000000D0000037128 0D0000038128 25 00000000D0000039128 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 3 1 3 1 3 1 3 1 3 1 3 1 3 91 1 1 2 1 2 1 2 1 2 1 2 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 00D0000040406,1,15HUnnamed1P0000001 Level 1;116,24.,36.,0.; 3P0000002110,0.,0.,0.,0.,72.,0.; 5P0000003110,

14、48.,0.,0.,48.,72.,0.; 7P0000004110,0.,0.,24.,0.,72.,24.; 9P0000005110,48.,0.,24.,48.,72.,24.; 11P0000006110,0.,0.,0.,48.,0.,0.; 13P0000007110,0.,72.,0.,48.,72.,0.; 15P0000008110,0.,0.,24.,48.,0.,24.; 17P0000009110,0.,72.,24.,48.,72.,24.; 19P0000010110,0.,0.,0.,0.,0.,24.; 21P0000011110,0.,72.,0.,0.,7

15、2.,24.; 23P0000012110,48.,0.,0.,48.,0.,24.; 25P0000013110,48.,72.,0.,48.,72.,24.; 27P0000014128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,29P00000150.,0.,72.,0.,48.,0.,0.,48.,72.,0.,0.,1.,0.,1.;29P0000016128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,31P00000170.,4

16、8.,0.,0.,0.,0.,24.,48.,0.,24.,0.,1.,0.,1.;31P0000018128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,48.,33P00000190.,0.,48.,72.,0.,48.,0.,24.,48.,72.,24.,0.,1.,0.,1.;33P0000020128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,35P000002172.,0.,48.,72.,0.,0.,72.,24.,48.,72.,24.,0.

17、,1.,0.,1.;35P0000022128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,37P00000230.,0.,72.,0.,0.,0.,24.,0.,72.,24.,0.,1.,0.,1.;37P0000024128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,39P000002524.,0.,72.,24.,48.,0.,24.,48.,72.,24.,0.,1.,0.,1.;39P0000026S0000001G0000002

18、D0000040P0000026 T0000001IGES數(shù)據(jù)分析:該圖形所用到的相關(guān)的元素代號極其數(shù)據(jù)格式如下:組成元素:6個B樣條曲面(128)、12條直線(110),1個點(diǎn)(116)開始段(字母代號S)1行,全局段(字母代號G)2行,元素索引段(字母代號D)40行,參數(shù)數(shù)據(jù)段(字母代號P)26行和結(jié)束段(字母代號T)1行在數(shù)據(jù)段,12個110后的數(shù)據(jù)表示長方體12條邊,每條邊有兩個點(diǎn)的坐標(biāo)表示。6個128后的數(shù)據(jù)表示長方體6個面的相關(guān)信息,里面可以提取出組成每個面的4個頂點(diǎn)坐標(biāo)。6個面12條邊組成了表面模型。保存成IGES文件:S00000011H,1H;,20HMASTERCAM ve

19、rsion X5,14H實模.MCX-5,11HMASTERCAMX5,1H1,16,G0000001 體建8,24,8,56,1.,2,2HMM,1,0.01,13H110416.202252,0.00005,100.,8,0,;G0000002406 1 1 1 1 0 00000300D0000001406 0 1 1 15 0D0000002116 2 1 1 1 0 00000000D0000003116 0 3 1 0 0D0000004128 3 1 1 1 000000000D0000005128 0 3 2 0 0D0000006128 5 1 1 1 0 00000000D

20、0000007128 0 3 2 0 0D0000008128 7 1 1 1 00000000D0000009128 0 3 2 0D0000010128 9 1 1 1 00000000D0000011128 0 3 2 0D0000012128 11 1 1 1 00000000D0000013128 0 3 2 0D0000014128 13 1 1 1 00000000D0000015128 0 3 2 0D0000016 406,1,15HUnnamed Level1P0000001116,24.,36.,0.; 3P0000002128,1,1,1,1,0,0,1,0,0,0.,

21、0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0., 5P000000324.,48.,0.,24.,0.,72.,24.,48.,72.,24.,0.,1.,0.,1.; 5P0000004128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0., 7P000000524.,0.,0.,0.,48.,0.,24.,48.,0.,0.,0.,1.,0.,1.; 7P0000006130 0 0 0 0 0 0 0 1;128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1

22、.,1.,1.,1.,1.,1.,0.,0.,9P00000070.,0.,0.,24.,0.,72.,0.,0.,72.,24.,0.,1.,0.,1.;9P0000008128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,11P000000972.,0.,0.,72.,24.,48.,72.,0.,48.,72.,24.,0.,1.,0.,1.;11P0000010128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,48.,13P00000110.,0.,0

23、.,0.,0.,48.,72.,0.,0.,72.,0.,0.,1.,0.,1.;13P0000012128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,48.,15P00000130.,24.,48.,0.,0.,48.,72.,24.,48.,72.,0.,0.,1.,0.,1.;15P0000014S0000001G0000002D0000016P0000014 T0000001IGES數(shù)據(jù)分析:該圖形所用到的相關(guān)的元素代號極其數(shù)據(jù)格式如下:組成元素:6個B樣條曲面(128)、1個點(diǎn)(116)開始段(字母代號S)1行,全局段

24、(字母代號G)2行,元素索引段(字母代號D)16行,參數(shù)數(shù)據(jù)段(字母代號P)14行和結(jié)束段(字母代號T)1行在數(shù)據(jù)段, 6個128后的數(shù)據(jù)表示長方體6個面的相關(guān)信息,里面可以提取出組成每個面的4個頂點(diǎn)坐標(biāo)。6個面組成了實體模型。特征建模:保存成IGES文件:S00000011H,1H;,20HMASTERCAM version X5,14H特模.MCX-5,11HMASTERCAMX5,1H1,16,G0000001 征建8,24,8,56,1.,2,2HMM,1,0.01,13H110416.200118,0.00005,100.,8,0,;G0000002406 1 1 1 1 0 000

25、00300D0000001406 0 1 1 15 0D0000002110 2 1 1 1 0 00000000D0000003110 0 3 1 0 0D0000004110 3 1 1 1 000000000D0000005110 0 3 1 0 0D0000006110 4 1 1 1 0 00000000D0000007110 0 3 1 0 0D0000008110 5 1 1 1 0 00000000D0000009110 0D0000010128 6 00000000D0000011128 0D0000012128 8 00000000D0000013128 0D0000014

26、128 10 00000000D0000015128 0D0000016128 12 00000000D0000017128 0D0000018128 14 00000000D0000019128 0D0000020128 16 00000000D0000021128 0D0000022 406,1,15HUnnamed0 1 0 1 0 1 0 1 0 1 0 1 0 3 1 3 1 3 1 3 1 3 1 3 1 3 Level 161 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1; 1 1 1 1 1 11P0000001110,0.,72.,0.,48

27、.,72.,0.;3P0000002110,48.,72.,0.,48.,0.,0.;5P0000003110,48.,0.,0.,0.,0.,0.;7P0000004110,0.,0.,0.,0.,72.,0.;9P0000005128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,11P00000060.,0.,0.,24.,0.,72.,0.,0.,72.,24.,0.,1.,0.,1.;11P0000007128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.

28、,1.,0.,13P000000872.,0.,0.,72.,24.,48.,72.,0.,48.,72.,24.,0.,1.,0.,1.;13P0000009128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,48.,15P00000100.,24.,48.,0.,0.,48.,72.,24.,48.,72.,0.,0.,1.,0.,1.;15P0000011128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,0.,0.,17P000001224.,0.,0.,0.

29、,48.,0.,24.,48.,0.,0.,0.,1.,0.,1.;17P0000013128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,48.,19P00000140.,24.,0.,0.,24.,48.,72.,24.,0.,72.,24.,0.,1.,0.,1.;19P0000015128,1,1,1,1,0,0,1,0,0,0.,0.,1.,1.,0.,0.,1.,1.,1.,1.,1.,1.,48.,21P00000160.,0.,0.,0.,0.,48.,72.,0.,0.,72.,0.,0.,1.,0.,1.;21

30、P0000017S0000001G0000002D0000022P0000017 T0000001IGES數(shù)據(jù)分析:該圖形所用到的相關(guān)的元素代號極其數(shù)據(jù)格式如下:組成元素:6個B樣條曲面(128)、4條直線(110)開始段(字母代號S)1行,全局段(字母代號G)2行,元素索引段(字母代號D)22行,參數(shù)數(shù)據(jù)段(字母代號P)17行和結(jié)束段(字母代號T)1行在數(shù)據(jù)段,4個110后的數(shù)據(jù)表示長方體12條邊,每條邊有兩個點(diǎn)的坐標(biāo)表示。6個128后的數(shù)據(jù)表示長方體6個面的相關(guān)信息,里面可以提取出組成每個面的4個頂點(diǎn)坐標(biāo)。6個面4條邊組成了特征模型。采用GUI設(shè)計工具,進(jìn)行可視化設(shè)計。Matlab程序設(shè)計

31、:function varargout = draw(varargin)gui_Singleton = 1;gui_State = struct(gui_Name, mfilename, .gui_Singleton, gui_Singleton, .gui_OpeningFcn, draw_OpeningFcn, . gui_OutputFcn, draw_OutputFcn, .gui_LayoutFcn, , .gui_Callback, );if nargin & ischar(varargin1)gui_State.gui_Callback = str2func(varargin1)

32、;endif nargoutvarargout1:nargout = gui_mainfcn(gui_State, varargin:); elsegui_mainfcn(gui_State, varargin:);endhandles.output = hObject;guidata(hObject, handles);if strcmp(get(hObject,Visible),off)plot(rand(5);endfunction varargout = draw_OutputFcn(hObject, eventdata, handles) varargout1 = handles.o

33、utput;function pushbutton1_Callback(hObject, eventdata, handles) axes(handles.axes1);cla;popup_sel_index = get(handles.popupmenu1, Value);switch popup_sel_indexcase 1plot(rand(5);case 2plot(sin(1:0.01:25.99);case 3bar(1:.5:10);case 4plot(membrane);case 5surf(peaks);endfunction FileMenu_Callback(hObj

34、ect, eventdata, handles)function OpenMenuItem_Callback(hObject, eventdata, handles) file = uigetfile(*.fig);if isequal(file, 0)open(file);endfunction PrintMenuItem_Callback(hObject, eventdata, handles)printdlg(handles.figure1)function CloseMenuItem_Callback(hObject, eventdata, handles) selection = q

35、uestdlg(Close get(handles.figure1,Name) ?,.Close get(handles.figure1,Name) .,. Yes,No,Yes);if strcmp(selection,No)return;enddelete(handles.figure1)function popupmenu1_Callback(hObject, eventdata, handles)function popupmenu1_CreateFcn(hObject, eventdata, handles)if ispc & isequal(get(hObject,Backgrou

36、ndColor), get(0,defaultUicontrolBackgroundColor)set(hObject,BackgroundColor,white);endset(hObject, String, plot(rand(5), plot(sin(1:0.01:25), bar(1:.5:10), plot(membrane), surf(peaks);function pushbutton4_Callback(hObject, eventdata, handles)function pushbutton5_Callback(hObject, eventdata, handles)

37、function pushbutton6_Callback(hObject, eventdata, handles)function pushbutton7_Callback(hObject, eventdata, handles)fid =fopen(表面建模.IGS,r);if (fid=-1) error(Cannot open filename .)endline=0;i=0;k=0;if fid=-1while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pb=strtok(str,;);c=str2num(b);m,n=size

38、(c);if m=0&n=0&c(1,1)=116 i=i+1;endd=strtok(str,P);e=str2num(d);p,q=size(e);if p=0&q=0&e(1,1)=128 k=k+1;endendendendif k=6line=0;temp=0;B=;w=1;fid =fopen(表面建模.IGS,r); while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pd=strtok(str,P);e=str2num(d);p,q=size(e);if p=0&q=0&e(1,1)=128 line=line+1;st

39、r = fgetl(fid);h=strtok(str,;);l=str2num(h);p1,q1=size(l);for r=1:10B(w,r)=l(1,r);endw=w+1;endendendfor s=1:48if B(s)0a1=B(s);break;endendfor s=2:48if B(s)0&B(s)=a1a2=B(s);break;endendfor s=3:48if B(s)0&B(s)=a1&B(s)=a2a3=B(s);break;endendA=0,0,0;a1,0,0;0,a2,0;a1,a2,0;0,0,a3;a1,0,a3;0,a2,a3;a1,a2,a3;

40、 d=1 2 4 3 1 5 6 8 7 5 6 2 4 8 7 3plot3(A(d,1),A(d,2),A(d,3) xlabel(x)ylabel(y)zlabel(z)grid onview(3); rotate3d;endif i=8fid =fopen(表面建模.IGS,r); line=0;j=1;x=;y=;z=;while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pk=k+1;b=strtok(str,;);c=str2num(b);m,n=size(c);if m=0&n=0&c(1,1)=116 x(j,1)=c(

41、1,2)y(j,1)=c(1,3)z(j,1)=c(1,4)j=j+1;endendendA=x,y,zd=1 2 4 3 1 5 6 8 7 5 6 2 4 8 7 3plot3(A(d,1),A(d,2),A(d,3)xlabel(x)ylabel(y)zlabel(z)grid onview(3); rotate3d;endfunction pushbutton4_CreateFcn(hObject, eventdata, handles)function pushbutton4_ButtonDownFcn(hObject, eventdata, handles) function pu

42、shbutton4_DeleteFcn(hObject, eventdata, handles) function togglebutton2_Callback(hObject, eventdata, handles)function togglebutton2_KeyPressFcn(hObject, eventdata, handles) function pushbutton9_Callback(hObject, eventdata, handles) fid =fopen(特征建模.IGS,r);if (fid=-1) error(Cannot open filename .)endl

43、ine=0;i=0;k=0;if fid=-1while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pb=strtok(str,;);c=str2num(b);m,n=size(c);if m=0&n=0&c(1,1)=116i=i+1;endd=strtok(str,P);e=str2num(d);p,q=size(e);if p=0&q=0&e(1,1)=128 k=k+1;endendendendif k=6line=0;temp=0;B=;w=1;fid =fopen(特征建模.IGS,r); while feof(fid)lin

44、e=line+1;str = fgetl(fid);if str(73)=Pd=strtok(str,P);e=str2num(d);p,q=size(e);if p=0&q=0&e(1,1)=128line=line+1;str = fgetl(fid);h=strtok(str,;);l=str2num(h);p1,q1=size(l);for r=1:10B(w,r)=l(1,r); endw=w+1;endendendfor s=1:48if B(s)0a1=B(s);break;endendfor s=2:48if B(s)0&B(s)=a1a2=B(s);break;endendf

45、or s=3:48if B(s)0&B(s)=a1&B(s)=a2a3=B(s);break;endendA=0,0,0;a1,0,0;0,a2,0;a1,a2,0;0,0,a3;a1,0,a3;0,a2,a3;a1,a2,a3; d=1 2 4 3 1 5 6 8 7 5 6 2 4 8 7 3plot3(A(d,1),A(d,2),A(d,3)xlabel(x)ylabel(y)zlabel(z)grid onview(3); rotate3d;endif i=8fid =fopen(特征建模.IGS,r); line=0;j=1;x=;y=;z=;while feof(fid)line=

46、line+1;str = fgetl(fid);if str(73)=Pk=k+1;b=strtok(str,;);c=str2num(b);m,n=size(c);if m=0&n=0&c(1,1)=116 x(j,1)=c(1,2)y(j,1)=c(1,3)z(j,1)=c(1,4)j=j+1;endendendA=x,y,zd=1 2 4 3 1 5 6 8 7 5 6 2 4 8 7 3 plot3(A(d,1),A(d,2),A(d,3) xlabel(x)ylabel(y)zlabel(z)grid onview(3); rotate3d;endfunction pushbutto

47、n10_Callback(hObject, eventdata, handles) fid =fopen(實體建模.IGS,r);if (fid=-1) error(Cannot open filename .)endline=0;i=0;k=0;if fid=-1while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pb=strtok(str,;);c=str2num(b);m,n=size(c);if m=0&n=0&c(1,1)=116i=i+1;endd=strtok(str,P);e=str2num(d);p,q=size(e)

48、;if p=0&q=0&e(1,1)=128k=k+1;endendendendif k=6line=0;temp=0;B=;w=1;fid =fopen(實體建模.IGS,r); while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pd=strtok(str,P);e=str2num(d);p,q=size(e);if p=0&q=0&e(1,1)=128 line=line+1;str = fgetl(fid);h=strtok(str,;);l=str2num(h);p1,q1=size(l);for r=1:10B(w,r)=l

49、(1,r);endw=w+1;endendendfor s=1:48if B(s)0a1=B(s);break;endendfor s=2:48if B(s)0&B(s)=a1 a2=B(s);break;endendfor s=3:48if B(s)0&B(s)=a1&B(s)=a2a3=B(s);break;endendA=0,0,0;a1,0,0;0,a2,0;a1,a2,0;0,0,a3;a1,0,a3;0,a2,a3;a1,a2,a3; d=1 2 4 3 1 5 6 8 7 5 6 2 4 8 7 3plot3(A(d,1),A(d,2),A(d,3)xlabel(x)ylabel

50、(y)zlabel(z)grid onview(3); rotate3dendif i=8fid =fopen(實體建模.IGS,r);line=0;j=1;x=;y=;z=;while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pk=k+1;b=strtok(str,;);c=str2num(b);m,n=size(c);if m=0&n=0&c(1,1)=116x(j,1)=c(1,2)y(j,1)=c(1,3)z(j,1)=c(1,4)j=j+1;endendendA=x,y,zd=1 2 4 3 1 5 6 8 7 5 6 2 4

51、 8 7 3plot3(A(d,1),A(d,2),A(d,3)xlabel(x)ylabel(y)zlabel(z)grid onview(3); rotate3d;endfunctionhandles) figure1_WindowScrollWheelFcn(hObject, eventdata,function pushbutton11_Callback(hObject, eventdata, handles) fid =fopen(線框建模.IGS,r);line=0;i=0;k=0;if fid=-1while feof(fid)line=line+1;str = fgetl(fi

52、d);if str(73)=Pb=strtok(str,;);c=str2num(b);m,n=size(c);if m=0&n=0&c(1,1)=116 i=i+1;endd=strtok(str,P);e=str2num(d);p,q=size(e);if p=0&q=0&e(1,1)=128 k=k+1;endendendendif k=6line=0;temp=0;B=;w=1;fid =fopen(線框建模.IGS,r); while feof(fid)line=line+1;str = fgetl(fid);if str(73)=Pd=strtok(str,P);e=str2num

53、(d);p,q=size(e);if p=0&q=0&e(1,1)=128 line=line+1;str = fgetl(fid);h=strtok(str,;);l=str2num(h);p1,q1=size(l);for r=1:10B(w,r)=l(1,r);endw=w+1;endendendfor s=1:48if B(s)0a1=B(s);break;endendfor s=2:48if B(s)0&B(s)=a1a2=B(s);break;endendfor s=3:48if B(s)0&B(s)=a1&B(s)=a2a3=B(s);break;endendA=0,0,0;a1,0,0;0,a2,0;a1,a2,0;0,0,a3;a1,0,a3;0,a2,a3;a1,a2,a3; d=

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論