diff --git a/PepLib.Core.Tests/IO/DrawingDxfExporterTests.cs b/PepLib.Core.Tests/IO/DrawingDxfExporterTests.cs index 35509a8..bb6492c 100644 --- a/PepLib.Core.Tests/IO/DrawingDxfExporterTests.cs +++ b/PepLib.Core.Tests/IO/DrawingDxfExporterTests.cs @@ -59,5 +59,9 @@ public class DrawingDxfExporterTests var arcs = doc.Entities.OfType().ToList(); Assert.Single(lines); Assert.Single(arcs); + var arc = doc.Entities.OfType().Single(); + // Angles must be in degrees (0..360), not radians (0..6.28) + Assert.InRange(arc.StartAngle, 0, 360); + Assert.InRange(arc.EndAngle, 0, 360); } } diff --git a/PepLib.Core/IO/DrawingDxfExporter.cs b/PepLib.Core/IO/DrawingDxfExporter.cs index 4eeb0f4..917bc8b 100644 --- a/PepLib.Core/IO/DrawingDxfExporter.cs +++ b/PepLib.Core/IO/DrawingDxfExporter.cs @@ -1,4 +1,4 @@ -using ACadSharp; +using ACadSharp; using ACadSharp.IO; using ACadSharp.Tables; using CSMath; @@ -77,8 +77,8 @@ public static class DrawingDxfExporter { Center = ToXYZ(arcCenter), Radius = radius, - StartAngle = startAngle, - EndAngle = endAngle, + StartAngle = startAngle * (180.0 / Math.PI), + EndAngle = endAngle * (180.0 / Math.PI), Layer = layer }); } @@ -104,3 +104,4 @@ public static class DrawingDxfExporter private static XYZ ToXYZ(Vector v) => new XYZ(v.X, v.Y, 0); } +