本系列教程整理了VectorDraw Developer Framework(VDF)最常见问题,教程整理的很齐全,非常适合新手学习,本节教程将会介绍如何在Shade / Render / Wire3D模式下正确绘制具有PenWidth的圆。
VectorDraw Developer Framework试用版下载
问:
在Shade / Render / Wire3D模式下,如何才能正确绘制具有PenWidth的圆/p>
答:
面对这个问题,我们需要先检查是否可以用OpenGL(这个圆圈的4个边缘)来解决这个圆的笔宽问题,如果发现由于OpenGL限制无法解决这个问题。那么,就建议避免使用带有penwidth的圆/椭圆/弧等对象,而是使用Hatch对象,例如:
vdCircle cir = new vdCircle(); // assume that this is the circle with penwidth inside your block.cir.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument);cir.setDocumentDefaults();cir.Center = new gPoint(3,3);cir.Radius=2;cir.PenWidth = .5;cir.PenColor.SystemColor = Color.Green;vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.AddItem(cir);vdCircle cir1 = new vdCircle();cir1=cir.Clone(vdFramedControl1.BaseControl.ActiveDocument) as vdCircle;cir1.Radius = cir.Radius - cir.PenWidth / 2.0;vdCircle cir2 = new vdCircle();cir2 = cir.Clone(vdFramedControl1.BaseControl.ActiveDocument) as vdCircle;cir2.Radius = cir.Radius + cir.PenWidth / 2.0;vdPolyhatch hatch = new vdPolyhatch(); // replace the circle with this objecthatch.SetUnRegisterDocument(vdFramedControl1.BaseControl.ActiveDocument);hatch.setDocumentDefaults();VectorDraw.Professional.vdCollections.vdCurves curs = new VectorDraw.Professional.vdCollections.vdCurves();curs.AddItem(cir1);curs.AddItem(cir2);hatch.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);hatch.HatchProperties.DrawBoundary = false;hatch.HatchProperties.FillColor = cir.PenColor;hatch.PolyCurves.AddItem(curs);vdFramedControl1.BaseControl.ActiveDocument.Model.Entities.AddItem(hatch);

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!