VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。
VectorDraw web library (javascript)不仅能打开CAD图纸,而且能显示任何支持HTML5标准平台上的通用矢量对象,如Windows,安卓,iOS和Linux。无需任何安装,VectorDraw web library (javascript)就可以运行在任何支持canvas标签和Javascript的主流浏览器(Chrome, Firefox, Safari, Opera, Dolphin, Boat等等)中。这意味着可以用DXF,DWG,DGN,SKP(Google的Sketchup),VDML等多种格式在任何台式、平板电脑,智能手机和便携式笔记本上展现出你的业务。
问:
在Shade / Render / Wire3D模式下,如何才能正确绘制具有PenWidth的圆?
答:
面对这个问题,我们需要先检查是否可以用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 object
hatch.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);