翻譯|使用教程|編輯:況魚(yú)杰|2019-10-24 10:47:46.963|閱讀 318 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常見(jiàn)問(wèn)題,教程整理的很齊全,非常適合新手學(xué)習(xí),本文章將會(huì)介紹如何使用FilletRadiousAtIndex來(lái)對(duì)多個(gè)頂點(diǎn)進(jìn)行圓角處理。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
點(diǎn)開(kāi)本篇文章,是否對(duì)矢量圖形工具感興趣呢?來(lái)看看最新的矢量圖形工具測(cè)評(píng)吧!點(diǎn)擊此處>>即可直達(dá)哦!
問(wèn):
我正在創(chuàng)建帶有某些頂點(diǎn)的折線,并希望使用FilletRadiousAtIndex方法對(duì)圓角進(jìn)行切角,例如段0、1和2,但是我的代碼無(wú)法正常工作。我怎樣才能做到這一點(diǎn) ?
答:
FilletRadiousAtIndex方法如果成功,則將向折線添加一個(gè)新頂點(diǎn),并且(可能是封閉的)它也可能改變點(diǎn)的順序。因此,像您發(fā)送的代碼那樣的代碼將無(wú)法工作,因?yàn)槭状握{(diào)用FilletRadiousAtIndex會(huì)改變點(diǎn)的順序,因?yàn)樾枰砑有碌狞c(diǎn),因此,您不能使用像這樣的代碼:
poly.FilletRadiusAtIndex(radious,0); poly.FilletRadiusAtIndex(radious,1); poly.FilletRadiusAtIndex(radious,2);
您需要遵循以下代碼中的其他方法,請(qǐng)參見(jiàn)以下代碼:
private void button5_Click(object sender, EventArgs e) { vdDocument doc = vdFramed1.BaseControl.ActiveDocument; doc.New(); doc.ZoomWindow(new gPoint(0, -10), new gPoint(240, 240)); Vertexes verts = new Vertexes(); verts.Add(40, 0, 0, 0); verts.Add(40, 200, 0, 0); verts.Add(20, 180, 0, 0); verts.Add(20, 230, 0, 0); verts.Add(200, 230, 0, 0); verts.Add(200, 180, 0, 0); verts.Add(180, 200, 0, 0); verts.Add(180, 0, 0, 0); vdPolyline poly = new vdPolyline(doc, verts); doc.Model.Entities.AddItem(poly); poly.Flag = VectorDraw.Professional.Constants.VdConstPlineFlag.PlFlagCLOSE; poly.Update(); double R1 = 9.0d; double R2 = 6.0d; double R3 = 3.0d; // alter these as you like gPoints pts_to_Fillet = new gPoints(); // to keep the “original” indexes that you need to fillet pts_to_Fillet.Add(new gPoint(poly.VertexList[0] as gPoint));// pt 0 -> R1 pts_to_Fillet.Add(new gPoint(poly.VertexList[2] as gPoint));// pt 1 -> R2 pts_to_Fillet.Add(new gPoint(poly.VertexList[3] as gPoint));// pt 2 -> R3 pts_to_Fillet.Add(new gPoint(poly.VertexList[4] as gPoint));// pt 3 -> R3 pts_to_Fillet.Add(new gPoint(poly.VertexList[5] as gPoint));// pt 4 -> R2 pts_to_Fillet.Add(new gPoint(poly.VertexList[7] as gPoint));// pt 5 -> R1 for (int i = 0; i < pts_to_Fillet.Count; i++) { double radious = 9.0; if (i == 0 || i == 5) radious = R1; else if (i == 1 || i == 4) radious = R2; else if (i == 2 || i == 3) radious = R3; int index_pl = poly.VertexList.FindVertexPoint(pts_to_Fillet[i]); // get the new index of the previously stored if (index_pl > -1) { poly.FilletRadiusAtIndex(radious, index_pl); // and fillet it poly.Update(); } else MessageBox.Show("point not found on polyline"); } poly.Invalidate(); }
對(duì)于以上問(wèn)答,如果您有任何的疑惑都可以在評(píng)論區(qū)留言,我們會(huì)及時(shí)回復(fù)。此系列的問(wèn)答教程我們會(huì)持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
相關(guān)資料推薦:
點(diǎn)擊此處還有VectorDraw Developer Framework的demo示例等著你來(lái)體驗(yàn)哦!
如果您對(duì)想要購(gòu)買(mǎi)正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系咨詢(xún)相關(guān)問(wèn)題。
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: