style: apply CSharpier formatting to all C# sources

Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and
line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests
pass after reformat, full solution builds 0 errors.

Added .csharpierignore so csproj/config XML keeps its existing layout
(CSharpier's XML wrapping churns attributes with zero benefit).

Formatting is now enforceable: dotnet csharpier check . passes.
This commit is contained in:
aj
2026-09-20 16:41:50 -04:00
parent 8e6fa677fb
commit aec0523062
476 changed files with 16592 additions and 7800 deletions
@@ -21,7 +21,8 @@ namespace OpenNest.Posts.GravographIS
/// </summary>
public List<List<Vector>> Extract(Nest nest)
{
if (nest == null) throw new ArgumentNullException(nameof(nest));
if (nest == null)
throw new ArgumentNullException(nameof(nest));
var result = new List<List<Vector>>();
@@ -53,7 +54,8 @@ namespace OpenNest.Posts.GravographIS
private void ExtractPart(Part part, List<List<Vector>> sink)
{
var program = part.Program;
if (program == null) return;
if (program == null)
return;
// The walk below treats Motion.EndPoint as absolute. Convert a working
// copy to absolute mode so G91 programs (the form OpenNest's UI writes)
@@ -122,8 +124,13 @@ namespace OpenNest.Posts.GravographIS
// (G-code I/J in this codebase are stored as the absolute center), arc.EndPoint
// is absolute end. The starting point is assumed to already be in the polyline;
// intermediate samples and the endpoint are appended.
private static void TessellateArc(Vector start, ArcMove arc, Vector offset,
double chordTol, List<Vector> sink)
private static void TessellateArc(
Vector start,
ArcMove arc,
Vector offset,
double chordTol,
List<Vector> sink
)
{
var c = arc.CenterPoint;
var r = c.DistanceTo(start);
@@ -140,18 +147,22 @@ namespace OpenNest.Posts.GravographIS
if (arc.Rotation == RotationType.CW)
{
sweep = a0 - a1;
if (sweep <= 0) sweep += 2 * System.Math.PI;
if (sweep <= 0)
sweep += 2 * System.Math.PI;
}
else
{
sweep = a1 - a0;
if (sweep <= 0) sweep += 2 * System.Math.PI;
if (sweep <= 0)
sweep += 2 * System.Math.PI;
}
// Treat a near-zero sweep with coincident start/end as a full circle.
if (sweep < 1e-9 &&
System.Math.Abs(start.X - arc.EndPoint.X) < 1e-9 &&
System.Math.Abs(start.Y - arc.EndPoint.Y) < 1e-9)
if (
sweep < 1e-9
&& System.Math.Abs(start.X - arc.EndPoint.X) < 1e-9
&& System.Math.Abs(start.Y - arc.EndPoint.Y) < 1e-9
)
{
sweep = 2 * System.Math.PI;
}
@@ -162,7 +173,8 @@ namespace OpenNest.Posts.GravographIS
maxAngleStep = System.Math.PI / 32;
var steps = (int)System.Math.Ceiling(sweep / maxAngleStep);
if (steps < 1) steps = 1;
if (steps < 1)
steps = 1;
var direction = arc.Rotation == RotationType.CW ? -1.0 : 1.0;
for (int i = 1; i < steps; i++)