資源簡(jiǎn)介
實(shí)現(xiàn)anyCAD開發(fā)工具對(duì)三維點(diǎn)數(shù)據(jù)的顯示,并實(shí)現(xiàn)簡(jiǎn)單畫圖功能,能夠繪制圓形矩形三角形以及特殊的圖形(需要導(dǎo)入圖形的點(diǎn)數(shù)據(jù),這里涉及到圖形STL文件的層切,不做贅述)
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Diagnostics;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading;
using?System.Windows.Forms;
using?振鏡3D打印.硬件控制;
using?AnyCAD.Presentation;
using?AnyCAD.Platform;
using?System.IO;
using?振鏡3D打印.硬件控制.anyCAD;
using?振鏡3D打印.shape;
namespace?振鏡3D打印
{
????public?partial?class?mainForm?:?DevExpress.XtraEditors.XtraForm
????{
????????
????????private?RenderWindow3d?m_RenderView?=?null;
????????//private?Feature?m_CurrentFeature?=?null;
????????public?AnyCAD.Presentation.RenderWindow3d?RenderView
????????{
????????????get?{?return?m_RenderView;?}
????????????set?{?m_RenderView?=?value;?}
????????}
????????public?mainForm()
????????{??????????
????????????InitializeComponent();
???????????//?Add?3D?RenderView?to?container.
???????????var?container?=?this.panelControl1;
????????????m_RenderView?=?new?RenderWindow3d();
????????????m_RenderView.Size?=?container.ClientSize;
????????????m_RenderView.Dock?=?System.Windows.Forms.Dockstyle.Fill;
????????????container.Controls.Add(m_RenderView);
????????}
????????private?void?mainForm_Load(object?sender?EventArgs?e)
????????{
???????????
????????}
????????#region?三維圖形顯示
????????string?path?=?““;
????????List?listpoint?=?new?List();
????????///?
????????///?打開并選擇stl輸出文件,顯示圖形
????????///?
????????///?
????????///?
????????private?void?btopen_Click(object?sender?EventArgs?e)
????????{
????????????ShowOpenFileDialog();
????????????listpoint.Clear();
????????????if?(File.Exists(path))//如果文件存在,則進(jìn)行讀取
????????????{
????????????????using?(StreamReader?file?=?new?StreamReader(File.Open(path?FileMode.Open)))
????????????????{
????????????????????char[]?separator?=?{?‘?‘?‘‘?};//用于分割字符串的標(biāo)示符號(hào),即空格
???????????????????
????????????????????string?line?=?file.ReadLine();//讀取行;
????????????????????do
????????????????????{
????????????????????????string[]?newstr?=?line.Trim().Split(separator);
????????????????????????foreach?(var?item?in?newstr)
????????????????????????{
????????????????????????????listpoint.Add(float.Parse(item));
????????????????????????}
????????????????????????line?=?file.ReadLine();//讀取行????????????????????????????
????????????????????}?while?(line?!=?null);
????????????????????float[]?news?=?listpoint.ToArray();
????????????????????FeatureContext?context?=?new?FeatureContext(RenderView);
????????????????????//if?(m_CurrentFeature?!=?null)
????????????????????//????m_CurrentFeature.OnExit(context);
????????????????????m_RenderView.ClearScene();
????????????????????if?(GraphMarker.PointsMake(context?news))
????????????????????{
????????????????????????m_RenderView.FitAll();
????????????????????}
????????????????????m_RenderView.RequestDraw();
???????????????}
??????
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-15?17:40??三維顯示\
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\
?????目錄???????????0??2019-03-15?17:40??三維顯示\.vs\振鏡3D打印\v15\
?????文件??????124928??2019-03-15?17:40??三維顯示\.vs\振鏡3D打印\v15\.suo
?????文件?????3715072??2019-02-14?18:05??三維顯示\.vs\振鏡3D打印\v15\Browse.VC.db
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\v15\ipch\
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\v15\ipch\AutoPCH\
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\v15\ipch\AutoPCH\56565811c598ac1f\
?????文件????26279936??2019-02-14?13:43??三維顯示\.vs\振鏡3D打印\v15\ipch\AutoPCH\56565811c598ac1f\CSC_USB_TESTDEMO.ipch
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\v15\ipch\AutoPCH\89fbcc110b6fc38f\
?????文件????26279936??2019-02-14?15:19??三維顯示\.vs\振鏡3D打印\v15\ipch\AutoPCH\89fbcc110b6fc38f\CSC_USB_TESTDEMO.ipch
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\v15\Server\
?????目錄???????????0??2019-03-04?15:13??三維顯示\.vs\振鏡3D打印\v15\Server\sqlite3\
?????文件????????1780??2019-03-14?16:20??三維顯示\z實(shí)體點(diǎn).lin
?????文件?????2241235??2019-03-04?15:07??三維顯示\三維視頻演示.wmv
?????目錄???????????0??2019-03-15?17:40??三維顯示\振鏡3D打印\
?????文件????????1844??2019-03-15?17:40??三維顯示\振鏡3D打印.sln
?????目錄???????????0??2019-03-04?15:13??三維顯示\振鏡3D打印\anyCAD\
?????文件????????1007??2019-02-28?13:26??三維顯示\振鏡3D打印\anyCAD\Closemessagebox.cs
?????文件?????????541??2019-02-28?10:57??三維顯示\振鏡3D打印\anyCAD\Feature.cs
?????文件????????1123??2019-02-28?11:34??三維顯示\振鏡3D打印\anyCAD\FeatureContext.cs
?????文件?????????710??2019-02-28?10:59??三維顯示\振鏡3D打印\anyCAD\FeatureManager.cs
?????文件????????3911??2019-03-04?11:11??三維顯示\振鏡3D打印\anyCAD\GraphMarker.cs
?????文件?????????755??2019-03-01?09:24??三維顯示\振鏡3D打印\anyCAD\RenderingModule.cs
?????目錄???????????0??2019-03-04?15:15??三維顯示\振鏡3D打印\bin\
?????文件??????????72??2018-04-06?09:28??三維顯示\振鏡3D打印\bin\Readme.txt
?????目錄???????????0??2019-03-04?15:13??三維顯示\振鏡3D打印\bin\x64\
?????目錄???????????0??2019-03-04?15:15??三維顯示\振鏡3D打印\bin\x64\debug\
?????文件??????128512??2018-03-20?17:51??三維顯示\振鏡3D打印\bin\x64\debug\AnyCAD.Basic.pdb
?????文件???????28160??2018-03-20?17:51??三維顯示\振鏡3D打印\bin\x64\debug\AnyCAD.Designer.pdb
............此處省略3099個(gè)文件信息
評(píng)論
共有 條評(píng)論