Angle of SimpleImport circular arc
Posted: 12 May 2006, 13:54
Hi,
There is a case where the angle of the Insert circular arc of SimpleImport reverses.
What is the problem?
There is a case where the angle of the Insert circular arc of SimpleImport reverses.
Code: Select all
<b>procedure</b> TForm1.ReadCADEntities(Entity: TsgDXFEntity);
<b>var</b>
.....
<b>begin</b>
C := EntColor(Entity, FCADParams.Insert);
L := EntStyle(Entity);
<b>if</b> Entity <b>is</b> TsgDXFArc <b>then
begin</b>
P := PtXMat(TsgDXFArc(Entity).Point, FCADParams.Matrix);
sa := TsgDXFArc(Entity).StartAngle;
ea := TsgDXFArc(Entity).EndAngle;
<b>if</b> FCADParams.Insert <> <b>nil then
if</b> FCADParams.Insert.Angle <> 0.0 <b>then
begin</b>
sa := sa + FCADParams.Insert.Angle;
ea := ea + FCADParams.Insert.Angle;
<b>end</b>;
<b>while</b> sa > ea <b>do</b> sa:=sa-360.0;
DB_AddArc(P.X, P.Y, TsgDXFArc(Entity).Radius, DegToRad(sa), DegToRad(ea), L, C);
<b>end</b>;
<b>end</b>;