Prod.: Engine, ver.: 6, ID: 60001443, HowTo : Circle with PenWidth is not drawn properly in Shade/Render/Wire3D modes

HowTo : Circle with PenWidth is not drawn properly in Shade/Render/Wire3D modes

Article60001443
TypeHowTo
ProductEngine
Version6
Date Added7/5/2011
Submitted byJungtae Ji
Keywords

Subject

Circle with PenWidth is not drawn properly in Shade/Render/Wire3D modes

Summary

Circle with PenWidth is not drawn properly in Shade/Render/Wire3D modes

Solution

We checked if is possible to solve the penwidth problem of this circle with OpenGL (the 4 edges of this circle) and we found out that we cannot solve this due to OpenGL limitations. So we recommend avoiding using such objects as circles/ellipses/arcs with penwidth and instead use Hatch objects, like :
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);