翻譯|使用教程|編輯:況魚杰|2019-08-20 11:34:14.840|閱讀 304 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見問題,教程整理的很齊全,非常適合新手學習,本節教程將會介紹如何在縱向或橫向創建3D視圖。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
VectorDraw Developer Framework(VDF)是一個用于應用程序可視化的圖形引擎庫。有了VDF提供的功能,您可以輕松地創建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問:
想要縱向或橫向創建3D視圖。它應該是由...... CommandAction.View3D(VFront)創建的視圖,但該線的方向與x軸或Y軸不平行。應該怎么做?
答:
您無法通過兩個點或單個線來定義平面。為此,您需要3點或2行具有共同點(如他們的起點)。請參閱下面的代碼:
private void Set_View_by_3_Points() { //or by 2 lines that have a common point (their startpoint) and that define one plane vdDocument doc = vdFramedControl1.BaseControl.ActiveDocument; doc.New(); vdLine linY = new vdLine(); // this line will define the Y axis linY.SetUnRegisterDocument(doc); linY.setDocumentDefaults(); linY.StartPoint = new gPoint(1.1152,2.5053,-2.3408); //pt1 linY.EndPoint = new gPoint(0.6050,3.3411,-2.5438); //pt2 linY.PenColor.FromSystemColor(Color.Green); doc.Model.Entities.AddItem(linY); vdLine linX = new vdLine();// this line will define the X axis linX.SetUnRegisterDocument(doc); linX.setDocumentDefaults(); linX.StartPoint = new gPoint(1.1152,2.5053,-2.3408); //pt1 : same as linY.StartPoint linX.EndPoint = new gPoint(1.8271,2.7833,-2.9858); //pt3 linX.PenColor.FromSystemColor(Color.Red); doc.Model.Entities.AddItem(linX); vdCircle cir = new vdCircle(); //is created just to see the plane where these two lines are cir.SetUnRegisterDocument(doc); cir.setDocumentDefaults(); cir.Center = new gPoint(linX.StartPoint); cir.Radius = 0.5; cir.ExtrusionVector = new Vector(0.4826, 0.4735, 0.7368); cir.PenColor.FromSystemColor(Color.Gray); doc.Model.Entities.AddItem(cir); doc.CommandAction.Zoom("E", 0, 0); // now UCS is PlanWorld, View is XY plane of PlanWorld MessageBox.Show("3D lines created"); doc.World2ViewMatrix.SetFrom(new gPoint(linX.StartPoint), new Vector(linX.StartPoint, linX.EndPoint), new Vector(linY.StartPoint, linY.EndPoint)); // the call above sets the View to be the plane that LinX and LinY define doc.CommandAction.Zoom("E", 0, 0); MessageBox.Show("View changed to be the plane that these lines define"); doc.UCS("View"); // this is not a call that you need, it just sets the UCS to be the same as the View }
關注慧聚IT微信公眾號 ???,了解產品的最新動態及最新資訊。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: