chore: sort using directives

Auto-formatter reordering of using statements across the solution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-18 16:47:42 -04:00
parent 6102dd5b85
commit 1d9bcc63d2
144 changed files with 378 additions and 426 deletions

View File

@@ -1,13 +1,13 @@
using OpenNest;
using OpenNest.Converters;
using OpenNest.Geometry;
using OpenNest.IO;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using OpenNest;
using OpenNest.Converters;
using OpenNest.Geometry;
using OpenNest.IO;
return NestConsole.Run(args);

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,4 +1,3 @@
using OpenNest.CNC;
using OpenNest.Geometry;
namespace OpenNest.CNC.CuttingStrategy

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.CNC.CuttingStrategy
{

View File

@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using OpenNest.Converters;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.CNC
{

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using OpenNest;
using OpenNest.CNC;
using OpenNest.CNC;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Converters
{

View File

@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using OpenNest;
using OpenNest.CNC;
using OpenNest.CNC;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.Converters
{

View File

@@ -1,9 +1,9 @@
using System.Drawing;
using System.Linq;
using System.Threading;
using OpenNest.CNC;
using OpenNest.CNC;
using OpenNest.Converters;
using OpenNest.Geometry;
using System.Drawing;
using System.Linq;
using System.Threading;
namespace OpenNest
{

View File

@@ -8,10 +8,10 @@
public int Remaining
{
get
get
{
var x = Required - Nested;
return x < 0 ? 0: x;
return x < 0 ? 0 : x;
}
}
}

View File

@@ -1,6 +1,6 @@
using System;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,5 @@
using System;
using OpenNest.Math;
using System.Collections.Generic;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Math;
using System.Collections.Generic;
using System.Drawing;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,7 +1,7 @@
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,6 @@
using OpenNest.Math;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,6 @@
using System;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Clipper2Lib;
using System.Collections.Generic;
namespace OpenNest.Geometry
{

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
namespace OpenNest.Geometry

View File

@@ -1,7 +1,7 @@
using System;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,6 @@
using OpenNest.Math;
using System.Collections.Generic;
using System.Diagnostics;
using OpenNest.Math;
namespace OpenNest.Geometry
{

View File

@@ -43,7 +43,7 @@ namespace OpenNest.Geometry
}
public override string ToString() => $"{Width} x {Length}";
public string ToString(int decimalPlaces) => $"{System.Math.Round(Width, decimalPlaces)} x {System.Math.Round(Length, decimalPlaces)}";
}
}

View File

@@ -1,7 +1,6 @@
using System;
using OpenNest.Math;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Math;
namespace OpenNest.Geometry
{
@@ -30,41 +29,41 @@ namespace OpenNest.Geometry
{
case PushDirection.Left:
case PushDirection.Right:
{
var dy = p2y - p1y;
if (System.Math.Abs(dy) < Tolerance.Epsilon)
{
var dy = p2y - p1y;
if (System.Math.Abs(dy) < Tolerance.Epsilon)
return double.MaxValue;
var t = (vy - p1y) / dy;
if (t < -Tolerance.Epsilon || t > 1.0 + Tolerance.Epsilon)
return double.MaxValue;
var ix = p1x + t * (p2x - p1x);
var dist = direction == PushDirection.Left ? vx - ix : ix - vx;
if (dist > Tolerance.Epsilon) return dist;
if (dist >= -Tolerance.Epsilon) return 0;
return double.MaxValue;
var t = (vy - p1y) / dy;
if (t < -Tolerance.Epsilon || t > 1.0 + Tolerance.Epsilon)
return double.MaxValue;
var ix = p1x + t * (p2x - p1x);
var dist = direction == PushDirection.Left ? vx - ix : ix - vx;
if (dist > Tolerance.Epsilon) return dist;
if (dist >= -Tolerance.Epsilon) return 0;
return double.MaxValue;
}
}
case PushDirection.Down:
case PushDirection.Up:
{
var dx = p2x - p1x;
if (System.Math.Abs(dx) < Tolerance.Epsilon)
{
var dx = p2x - p1x;
if (System.Math.Abs(dx) < Tolerance.Epsilon)
return double.MaxValue;
var t = (vx - p1x) / dx;
if (t < -Tolerance.Epsilon || t > 1.0 + Tolerance.Epsilon)
return double.MaxValue;
var iy = p1y + t * (p2y - p1y);
var dist = direction == PushDirection.Down ? vy - iy : iy - vy;
if (dist > Tolerance.Epsilon) return dist;
if (dist >= -Tolerance.Epsilon) return 0;
return double.MaxValue;
var t = (vx - p1x) / dx;
if (t < -Tolerance.Epsilon || t > 1.0 + Tolerance.Epsilon)
return double.MaxValue;
var iy = p1y + t * (p2y - p1y);
var dist = direction == PushDirection.Down ? vy - iy : iy - vy;
if (dist > Tolerance.Epsilon) return dist;
if (dist >= -Tolerance.Epsilon) return 0;
return double.MaxValue;
}
}
default:
return double.MaxValue;
@@ -363,10 +362,10 @@ namespace OpenNest.Geometry
{
switch (direction)
{
case PushDirection.Left: return box.Left - boundary.Left;
case PushDirection.Left: return box.Left - boundary.Left;
case PushDirection.Right: return boundary.Right - box.Right;
case PushDirection.Up: return boundary.Top - box.Top;
case PushDirection.Down: return box.Bottom - boundary.Bottom;
case PushDirection.Up: return boundary.Top - box.Top;
case PushDirection.Down: return box.Bottom - boundary.Bottom;
default: return double.MaxValue;
}
}
@@ -375,10 +374,10 @@ namespace OpenNest.Geometry
{
switch (direction)
{
case PushDirection.Left: return new Vector(-distance, 0);
case PushDirection.Left: return new Vector(-distance, 0);
case PushDirection.Right: return new Vector(distance, 0);
case PushDirection.Up: return new Vector(0, distance);
case PushDirection.Down: return new Vector(0, -distance);
case PushDirection.Up: return new Vector(0, distance);
case PushDirection.Down: return new Vector(0, -distance);
default: return new Vector();
}
}
@@ -387,10 +386,10 @@ namespace OpenNest.Geometry
{
switch (direction)
{
case PushDirection.Left: return from.Left - to.Right;
case PushDirection.Left: return from.Left - to.Right;
case PushDirection.Right: return to.Left - from.Right;
case PushDirection.Up: return to.Bottom - from.Top;
case PushDirection.Down: return from.Bottom - to.Top;
case PushDirection.Up: return to.Bottom - from.Top;
case PushDirection.Down: return from.Bottom - to.Top;
default: return double.MaxValue;
}
}

View File

@@ -1,5 +1,5 @@
using System;
using OpenNest.Math;
using OpenNest.Math;
using System;
namespace OpenNest.Geometry
{

View File

@@ -1,6 +1,4 @@
using System;
namespace OpenNest.Math
namespace OpenNest.Math
{
public static class Angle
{

View File

@@ -1,6 +1,4 @@
using System;
namespace OpenNest.Math
namespace OpenNest.Math
{
public static class Tolerance
{

View File

@@ -1,6 +1,4 @@
using System;
namespace OpenNest.Math
namespace OpenNest.Math
{
public static class Trigonometry
{

View File

@@ -1,6 +1,6 @@
using System;
using OpenNest.Collections;
using OpenNest.Collections;
using OpenNest.Geometry;
using System;
namespace OpenNest
{

View File

@@ -1,5 +1,4 @@
using System;
using OpenNest.Math;
using OpenNest.Math;
namespace OpenNest
{

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using OpenNest.CNC;
using OpenNest.CNC;
using OpenNest.Converters;
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using OpenNest.Converters;
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest
{
@@ -174,10 +174,10 @@ namespace OpenNest
switch (facingDirection)
{
case PushDirection.Left: keep = -sign * dy > 0; break;
case PushDirection.Right: keep = sign * dy > 0; break;
case PushDirection.Up: keep = -sign * dx > 0; break;
case PushDirection.Down: keep = sign * dx > 0; break;
case PushDirection.Left: keep = -sign * dy > 0; break;
case PushDirection.Right: keep = sign * dy > 0; break;
case PushDirection.Up: keep = -sign * dx > 0; break;
case PushDirection.Down: keep = sign * dx > 0; break;
default: keep = true; break;
}

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Collections;
using OpenNest.Collections;
using OpenNest.Geometry;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,9 +1,9 @@
using OpenNest.Converters;
using OpenNest.Geometry;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using OpenNest.Converters;
using OpenNest.Geometry;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Shapes
{

View File

@@ -1,8 +1,8 @@
using System;
using System.Linq;
using OpenNest.CNC;
using OpenNest.CNC;
using OpenNest.Converters;
using OpenNest.Geometry;
using System;
using System.Linq;
namespace OpenNest
{
@@ -83,7 +83,7 @@ namespace OpenNest
time += TimeSpan.FromSeconds(info.TravelDistance / cutParams.RapidTravelRate);
break;
}
time += TimeSpan.FromTicks(info.PierceCount * cutParams.PierceTime.Ticks);
return time;

View File

@@ -19,7 +19,7 @@ namespace OpenNest
case Units.Millimeters:
return "mm";
default:
default:
return string.Empty;
}
}
@@ -34,7 +34,7 @@ namespace OpenNest
case Units.Millimeters:
return "millimeters";
default:
default:
return string.Empty;
}
}
@@ -49,7 +49,7 @@ namespace OpenNest
case Units.Millimeters:
return "sec";
default:
default:
return string.Empty;
}
}

View File

@@ -1,11 +1,11 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using OpenNest.Converters;
using OpenNest.Engine.BestFit.Tiling;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace OpenNest.Engine.BestFit
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.Engine.BestFit
{

View File

@@ -1,6 +1,6 @@
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
namespace OpenNest.Engine.BestFit
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.Engine.BestFit.Tiling
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Engine.BestFit.Tiling
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
namespace OpenNest.CirclePacking
{

View File

@@ -1,6 +1,6 @@
using System;
using OpenNest.Geometry;
using OpenNest.Geometry;
using OpenNest.Math;
using System;
namespace OpenNest.CirclePacking
{

View File

@@ -1,6 +1,6 @@
using System;
using OpenNest.Geometry;
using OpenNest.Geometry;
using OpenNest.Math;
using System;
namespace OpenNest.CirclePacking
{

View File

@@ -1,5 +1,4 @@
using System;
using OpenNest.Math;
using OpenNest.Math;
namespace OpenNest
{

View File

@@ -1,11 +1,11 @@
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Microsoft.ML.OnnxRuntime;
using Microsoft.ML.OnnxRuntime.Tensors;
using OpenNest.Math;
namespace OpenNest.Engine.ML
{

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using OpenNest.Geometry;
namespace OpenNest.Engine.ML
{

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
using System.Linq;
namespace OpenNest.Engine.ML
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest
{

View File

@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using OpenNest.CNC;
using OpenNest.CNC.CuttingStrategy;
using OpenNest.Engine.RapidPlanning;
using OpenNest.Engine.Sequencing;
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest.Engine
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.CNC;
using OpenNest.Engine.RapidPlanning;
using System.Collections.Generic;
namespace OpenNest.Engine
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Engine.RapidPlanning
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Engine.RapidPlanning
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Engine.RapidPlanning
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.Engine.RapidPlanning
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,5 +1,5 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Geometry;
using System.Collections.Generic;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,5 +1,4 @@
using System;
using OpenNest.Geometry;
using OpenNest.Geometry;
using OpenNest.Math;
namespace OpenNest.RectanglePacking

View File

@@ -1,5 +1,4 @@
using OpenNest.Geometry;
using OpenNest.Math;
using OpenNest.Math;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
using OpenNest.Geometry;
using OpenNest.Math;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest.RectanglePacking
{
@@ -71,7 +71,7 @@ namespace OpenNest.RectanglePacking
if (pt.X != double.MaxValue && pt.Y != double.MaxValue)
return pt;
return null;
}

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using OpenNest.Geometry;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using OpenNest.Geometry;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Geometry;
namespace OpenNest.RectanglePacking
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using OpenNest.CNC.CuttingStrategy;
using OpenNest.Math;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest.Engine.Sequencing
{

View File

@@ -25,10 +25,10 @@ namespace OpenNest.Engine.Sequencing
private static double MinEdgeDistance(OpenNest.Geometry.Vector center, OpenNest.Geometry.Box plateBox)
{
var distLeft = center.X - plateBox.Left;
var distRight = plateBox.Right - center.X;
var distLeft = center.X - plateBox.Left;
var distRight = plateBox.Right - center.X;
var distBottom = center.Y - plateBox.Bottom;
var distTop = plateBox.Top - center.Y;
var distTop = plateBox.Top - center.Y;
return System.Math.Min(System.Math.Min(distLeft, distRight), System.Math.Min(distBottom, distTop));
}

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using OpenNest.Math;
using System.Collections.Generic;
namespace OpenNest.Engine.Sequencing
{

View File

@@ -1,5 +1,5 @@
using System;
using OpenNest.CNC.CuttingStrategy;
using System;
namespace OpenNest.Engine.Sequencing
{
@@ -9,12 +9,12 @@ namespace OpenNest.Engine.Sequencing
{
return parameters.Method switch
{
SequenceMethod.RightSide => new RightSideSequencer(),
SequenceMethod.LeftSide => new LeftSideSequencer(),
SequenceMethod.RightSide => new RightSideSequencer(),
SequenceMethod.LeftSide => new LeftSideSequencer(),
SequenceMethod.BottomSide => new BottomSideSequencer(),
SequenceMethod.EdgeStart => new EdgeStartSequencer(),
SequenceMethod.LeastCode => new LeastCodeSequencer(),
SequenceMethod.Advanced => new AdvancedSequencer(parameters),
SequenceMethod.EdgeStart => new EdgeStartSequencer(),
SequenceMethod.LeastCode => new LeastCodeSequencer(),
SequenceMethod.Advanced => new AdvancedSequencer(parameters),
_ => throw new NotSupportedException(
$"Sequence method '{parameters.Method}' is not supported.")
};

View File

@@ -1,8 +1,8 @@
using System;
using System.Diagnostics;
using ILGPU;
using ILGPU.Runtime;
using OpenNest.Engine.BestFit;
using System;
using System.Diagnostics;
namespace OpenNest.Gpu
{

View File

@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ILGPU;
using ILGPU.Runtime;
using OpenNest.Converters;
using OpenNest.Engine.BestFit;
using OpenNest.Geometry;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace OpenNest.Gpu
{

View File

@@ -1,8 +1,8 @@
using System;
using ILGPU;
using ILGPU.Runtime;
using ILGPU.Algorithms;
using ILGPU.Runtime;
using OpenNest.Engine.BestFit;
using System;
namespace OpenNest.Gpu
{
@@ -13,7 +13,7 @@ namespace OpenNest.Gpu
private readonly object _lock = new object();
// ── Kernels ──────────────────────────────────────────────────
private readonly Action<Index1D,
ArrayView1D<double, Stride1D.Dense>, // stationaryPrep
ArrayView1D<double, Stride1D.Dense>, // movingPrep
@@ -152,12 +152,12 @@ namespace OpenNest.Gpu
private void EnsureStationary(double[] data, int count)
{
// Fast check: if same object or content is identical, skip upload
if (_gpuStationaryPrep != null &&
_lastStationaryData != null &&
if (_gpuStationaryPrep != null &&
_lastStationaryData != null &&
_lastStationaryData.Length == data.Length)
{
// Reference equality or content equality
if (_lastStationaryData == data ||
if (_lastStationaryData == data ||
new ReadOnlySpan<double>(_lastStationaryData).SequenceEqual(new ReadOnlySpan<double>(data)))
{
return;
@@ -178,11 +178,11 @@ namespace OpenNest.Gpu
private void EnsureMoving(double[] data, int count)
{
if (_gpuMovingPrep != null &&
_lastMovingData != null &&
_lastMovingData.Length == data.Length)
if (_gpuMovingPrep != null &&
_lastMovingData != null &&
_lastMovingData.Length == data.Length)
{
if (_lastMovingData == data ||
if (_lastMovingData == data ||
new ReadOnlySpan<double>(_lastMovingData).SequenceEqual(new ReadOnlySpan<double>(data)))
{
return;
@@ -240,7 +240,7 @@ namespace OpenNest.Gpu
var dx = x2 - x1;
var dy = y2 - y1;
// invD is used for parameter 't'. We use a small epsilon for stability.
prepared[index * 10 + 4] = (XMath.Abs(dx) < 1e-9) ? 0 : 1.0 / dx;
prepared[index * 10 + 5] = (XMath.Abs(dy) < 1e-9) ? 0 : 1.0 / dy;
@@ -265,7 +265,7 @@ namespace OpenNest.Gpu
var dx = offsets[index * 2];
var dy = offsets[index * 2 + 1];
results[index] = ComputeSlideLean(
stationaryPrep, movingPrep, dx, dy, sCount, mCount, direction);
}

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenNest.Converters;
using OpenNest.Geometry;
using OpenNest.Math;
using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest.Gpu
{

View File

@@ -1,13 +1,10 @@
using System;
using System.Diagnostics;
using System.IO;
using ACadSharp;
using ACadSharp.Entities;
using ACadSharp.IO;
using ACadSharp.Tables;
using CSMath;
using OpenNest.CNC;
using OpenNest.Math;
using System.Diagnostics;
using System.IO;
namespace OpenNest.IO
{

View File

@@ -1,10 +1,10 @@
using ACadSharp;
using ACadSharp.IO;
using OpenNest.Geometry;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using ACadSharp;
using ACadSharp.IO;
using OpenNest.Geometry;
namespace OpenNest.IO
{

Some files were not shown because too many files have changed in this diff Show More