diff --git a/OpenNest.Console/Program.cs b/OpenNest.Console/Program.cs index a4f750a..1150770 100644 --- a/OpenNest.Console/Program.cs +++ b/OpenNest.Console/Program.cs @@ -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); diff --git a/OpenNest.Core/Align.cs b/OpenNest.Core/Align.cs index 3de4469..40f36e4 100644 --- a/OpenNest.Core/Align.cs +++ b/OpenNest.Core/Align.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; -using OpenNest.Geometry; +using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest { diff --git a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs index 30455be..8812b49 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/CuttingResult.cs b/OpenNest.Core/CNC/CuttingStrategy/CuttingResult.cs index 933db14..682936a 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/CuttingResult.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/CuttingResult.cs @@ -1,4 +1,3 @@ -using OpenNest.CNC; using OpenNest.Geometry; namespace OpenNest.CNC.CuttingStrategy diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/ArcLeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/ArcLeadIn.cs index e76c9ce..67af1b9 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/ArcLeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/ArcLeadIn.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/CleanHoleLeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/CleanHoleLeadIn.cs index d30f0e6..b0750ff 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/CleanHoleLeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/CleanHoleLeadIn.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LeadIn.cs index 83be504..bc9eff4 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LeadIn.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineArcLeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineArcLeadIn.cs index a816593..2fac024 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineArcLeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineArcLeadIn.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLeadIn.cs index e7922cf..c20e8d9 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLeadIn.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLineLeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLineLeadIn.cs index f5700cb..d646694 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLineLeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/LineLineLeadIn.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/NoLeadIn.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/NoLeadIn.cs index 7100487..a751727 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadIns/NoLeadIn.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadIns/NoLeadIn.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/ArcLeadOut.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/ArcLeadOut.cs index 95d8724..ed47977 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/ArcLeadOut.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/ArcLeadOut.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LeadOut.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LeadOut.cs index 6915c5f..804427b 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LeadOut.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LeadOut.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LineLeadOut.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LineLeadOut.cs index c72847b..954858a 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LineLeadOut.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/LineLeadOut.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/MicrotabLeadOut.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/MicrotabLeadOut.cs index 13dc799..1b75e6f 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/MicrotabLeadOut.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/MicrotabLeadOut.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/NoLeadOut.cs b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/NoLeadOut.cs index 8a45cc8..0e3b53f 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/NoLeadOut.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/LeadOuts/NoLeadOut.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/Tabs/BreakerTab.cs b/OpenNest.Core/CNC/CuttingStrategy/Tabs/BreakerTab.cs index 3921491..bb306a6 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/Tabs/BreakerTab.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/Tabs/BreakerTab.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/Tabs/MachineTab.cs b/OpenNest.Core/CNC/CuttingStrategy/Tabs/MachineTab.cs index b6e5fbd..10d2954 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/Tabs/MachineTab.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/Tabs/MachineTab.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/Tabs/NormalTab.cs b/OpenNest.Core/CNC/CuttingStrategy/Tabs/NormalTab.cs index de3e16c..908746a 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/Tabs/NormalTab.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/Tabs/NormalTab.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/CuttingStrategy/Tabs/Tab.cs b/OpenNest.Core/CNC/CuttingStrategy/Tabs/Tab.cs index 504eec5..87a8d85 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/Tabs/Tab.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/Tabs/Tab.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.CNC.CuttingStrategy { diff --git a/OpenNest.Core/CNC/Program.cs b/OpenNest.Core/CNC/Program.cs index 6f61c1b..43d6237 100644 --- a/OpenNest.Core/CNC/Program.cs +++ b/OpenNest.Core/CNC/Program.cs @@ -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 { diff --git a/OpenNest.Core/Converters/ConvertGeometry.cs b/OpenNest.Core/Converters/ConvertGeometry.cs index 6c95e56..8c89945 100644 --- a/OpenNest.Core/Converters/ConvertGeometry.cs +++ b/OpenNest.Core/Converters/ConvertGeometry.cs @@ -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 { diff --git a/OpenNest.Core/Converters/ConvertProgram.cs b/OpenNest.Core/Converters/ConvertProgram.cs index 97efe77..f7dff54 100644 --- a/OpenNest.Core/Converters/ConvertProgram.cs +++ b/OpenNest.Core/Converters/ConvertProgram.cs @@ -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 { diff --git a/OpenNest.Core/Drawing.cs b/OpenNest.Core/Drawing.cs index 2adc038..a55cd80 100644 --- a/OpenNest.Core/Drawing.cs +++ b/OpenNest.Core/Drawing.cs @@ -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 { diff --git a/OpenNest.Core/DwgQty.cs b/OpenNest.Core/DwgQty.cs index 6d4b60f..6fa3e07 100644 --- a/OpenNest.Core/DwgQty.cs +++ b/OpenNest.Core/DwgQty.cs @@ -8,10 +8,10 @@ public int Remaining { - get + get { var x = Required - Nested; - return x < 0 ? 0: x; + return x < 0 ? 0 : x; } } } diff --git a/OpenNest.Core/Geometry/Arc.cs b/OpenNest.Core/Geometry/Arc.cs index bbd2d3f..002cd09 100644 --- a/OpenNest.Core/Geometry/Arc.cs +++ b/OpenNest.Core/Geometry/Arc.cs @@ -1,6 +1,6 @@ -using System; +using OpenNest.Math; +using System; using System.Collections.Generic; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/Circle.cs b/OpenNest.Core/Geometry/Circle.cs index 82a0b3e..dd0148f 100644 --- a/OpenNest.Core/Geometry/Circle.cs +++ b/OpenNest.Core/Geometry/Circle.cs @@ -1,6 +1,5 @@ -using System; +using OpenNest.Math; using System.Collections.Generic; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/Entity.cs b/OpenNest.Core/Geometry/Entity.cs index 2f055d6..d32702d 100644 --- a/OpenNest.Core/Geometry/Entity.cs +++ b/OpenNest.Core/Geometry/Entity.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using OpenNest.Math; +using System.Collections.Generic; using System.Drawing; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/GeometryOptimizer.cs b/OpenNest.Core/Geometry/GeometryOptimizer.cs index db9eedd..dfe5b9a 100644 --- a/OpenNest.Core/Geometry/GeometryOptimizer.cs +++ b/OpenNest.Core/Geometry/GeometryOptimizer.cs @@ -1,7 +1,7 @@ +using OpenNest.Math; using System; using System.Collections.Generic; using System.Threading.Tasks; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/Intersect.cs b/OpenNest.Core/Geometry/Intersect.cs index 8af27e1..bdbcb1c 100644 --- a/OpenNest.Core/Geometry/Intersect.cs +++ b/OpenNest.Core/Geometry/Intersect.cs @@ -1,6 +1,6 @@ +using OpenNest.Math; using System.Collections.Generic; using System.Linq; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/Line.cs b/OpenNest.Core/Geometry/Line.cs index d4c5cc2..696ee97 100644 --- a/OpenNest.Core/Geometry/Line.cs +++ b/OpenNest.Core/Geometry/Line.cs @@ -1,6 +1,6 @@ -using System; +using OpenNest.Math; +using System; using System.Collections.Generic; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/NoFitPolygon.cs b/OpenNest.Core/Geometry/NoFitPolygon.cs index c4effa0..3e89222 100644 --- a/OpenNest.Core/Geometry/NoFitPolygon.cs +++ b/OpenNest.Core/Geometry/NoFitPolygon.cs @@ -1,6 +1,5 @@ -using System.Collections.Generic; -using System.Linq; using Clipper2Lib; +using System.Collections.Generic; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/PolyLabel.cs b/OpenNest.Core/Geometry/PolyLabel.cs index 9f3af4b..e6b2c9d 100644 --- a/OpenNest.Core/Geometry/PolyLabel.cs +++ b/OpenNest.Core/Geometry/PolyLabel.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; namespace OpenNest.Geometry diff --git a/OpenNest.Core/Geometry/Polygon.cs b/OpenNest.Core/Geometry/Polygon.cs index 2f09e65..4ff2a37 100644 --- a/OpenNest.Core/Geometry/Polygon.cs +++ b/OpenNest.Core/Geometry/Polygon.cs @@ -1,7 +1,7 @@ -using System; +using OpenNest.Math; +using System; using System.Collections.Generic; using System.Linq; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/RotatingCalipers.cs b/OpenNest.Core/Geometry/RotatingCalipers.cs index 15742fd..cc7ff08 100644 --- a/OpenNest.Core/Geometry/RotatingCalipers.cs +++ b/OpenNest.Core/Geometry/RotatingCalipers.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/ShapeBuilder.cs b/OpenNest.Core/Geometry/ShapeBuilder.cs index 8ae4cae..a4311f8 100644 --- a/OpenNest.Core/Geometry/ShapeBuilder.cs +++ b/OpenNest.Core/Geometry/ShapeBuilder.cs @@ -1,6 +1,6 @@ +using OpenNest.Math; using System.Collections.Generic; using System.Diagnostics; -using OpenNest.Math; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Geometry/Size.cs b/OpenNest.Core/Geometry/Size.cs index e5aead9..ca225e7 100644 --- a/OpenNest.Core/Geometry/Size.cs +++ b/OpenNest.Core/Geometry/Size.cs @@ -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)}"; } } diff --git a/OpenNest.Core/Geometry/SpatialQuery.cs b/OpenNest.Core/Geometry/SpatialQuery.cs index 39a226b..e34d345 100644 --- a/OpenNest.Core/Geometry/SpatialQuery.cs +++ b/OpenNest.Core/Geometry/SpatialQuery.cs @@ -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; } } diff --git a/OpenNest.Core/Geometry/Vector.cs b/OpenNest.Core/Geometry/Vector.cs index 22eccda..ebae254 100644 --- a/OpenNest.Core/Geometry/Vector.cs +++ b/OpenNest.Core/Geometry/Vector.cs @@ -1,5 +1,5 @@ -using System; -using OpenNest.Math; +using OpenNest.Math; +using System; namespace OpenNest.Geometry { diff --git a/OpenNest.Core/Math/Angle.cs b/OpenNest.Core/Math/Angle.cs index d052660..7b2aaea 100644 --- a/OpenNest.Core/Math/Angle.cs +++ b/OpenNest.Core/Math/Angle.cs @@ -1,6 +1,4 @@ -using System; - -namespace OpenNest.Math +namespace OpenNest.Math { public static class Angle { diff --git a/OpenNest.Core/Math/Tolerance.cs b/OpenNest.Core/Math/Tolerance.cs index 105b529..4a5d150 100644 --- a/OpenNest.Core/Math/Tolerance.cs +++ b/OpenNest.Core/Math/Tolerance.cs @@ -1,6 +1,4 @@ -using System; - -namespace OpenNest.Math +namespace OpenNest.Math { public static class Tolerance { diff --git a/OpenNest.Core/Math/Trigonometry.cs b/OpenNest.Core/Math/Trigonometry.cs index 4349f5f..117a8ae 100644 --- a/OpenNest.Core/Math/Trigonometry.cs +++ b/OpenNest.Core/Math/Trigonometry.cs @@ -1,6 +1,4 @@ -using System; - -namespace OpenNest.Math +namespace OpenNest.Math { public static class Trigonometry { diff --git a/OpenNest.Core/Nest.cs b/OpenNest.Core/Nest.cs index 00a61b7..7169100 100644 --- a/OpenNest.Core/Nest.cs +++ b/OpenNest.Core/Nest.cs @@ -1,6 +1,6 @@ -using System; -using OpenNest.Collections; +using OpenNest.Collections; using OpenNest.Geometry; +using System; namespace OpenNest { diff --git a/OpenNest.Core/NestConstraints.cs b/OpenNest.Core/NestConstraints.cs index 89827ed..86ccca5 100644 --- a/OpenNest.Core/NestConstraints.cs +++ b/OpenNest.Core/NestConstraints.cs @@ -1,5 +1,4 @@ -using System; -using OpenNest.Math; +using OpenNest.Math; namespace OpenNest { diff --git a/OpenNest.Core/Part.cs b/OpenNest.Core/Part.cs index 37b12f0..e0c3b0d 100644 --- a/OpenNest.Core/Part.cs +++ b/OpenNest.Core/Part.cs @@ -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 { diff --git a/OpenNest.Core/PartGeometry.cs b/OpenNest.Core/PartGeometry.cs index 3b9234f..6ff64ab 100644 --- a/OpenNest.Core/PartGeometry.cs +++ b/OpenNest.Core/PartGeometry.cs @@ -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; } diff --git a/OpenNest.Core/Plate.cs b/OpenNest.Core/Plate.cs index 87c257a..6186cd1 100644 --- a/OpenNest.Core/Plate.cs +++ b/OpenNest.Core/Plate.cs @@ -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 { diff --git a/OpenNest.Core/Sequence.cs b/OpenNest.Core/Sequence.cs index 250bd76..f45e5d6 100644 --- a/OpenNest.Core/Sequence.cs +++ b/OpenNest.Core/Sequence.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; -using OpenNest.Geometry; +using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest { diff --git a/OpenNest.Core/Shapes/CircleShape.cs b/OpenNest.Core/Shapes/CircleShape.cs index 6288cef..1b3ac64 100644 --- a/OpenNest.Core/Shapes/CircleShape.cs +++ b/OpenNest.Core/Shapes/CircleShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/FlangeShape.cs b/OpenNest.Core/Shapes/FlangeShape.cs index e9183d7..b08d87f 100644 --- a/OpenNest.Core/Shapes/FlangeShape.cs +++ b/OpenNest.Core/Shapes/FlangeShape.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/IsoscelesTriangleShape.cs b/OpenNest.Core/Shapes/IsoscelesTriangleShape.cs index 125127f..c4d65f3 100644 --- a/OpenNest.Core/Shapes/IsoscelesTriangleShape.cs +++ b/OpenNest.Core/Shapes/IsoscelesTriangleShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/LShape.cs b/OpenNest.Core/Shapes/LShape.cs index 3712aa2..701e54f 100644 --- a/OpenNest.Core/Shapes/LShape.cs +++ b/OpenNest.Core/Shapes/LShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/OctagonShape.cs b/OpenNest.Core/Shapes/OctagonShape.cs index 66a99ed..c73f392 100644 --- a/OpenNest.Core/Shapes/OctagonShape.cs +++ b/OpenNest.Core/Shapes/OctagonShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/RectangleShape.cs b/OpenNest.Core/Shapes/RectangleShape.cs index ad70466..c56ec56 100644 --- a/OpenNest.Core/Shapes/RectangleShape.cs +++ b/OpenNest.Core/Shapes/RectangleShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/RightTriangleShape.cs b/OpenNest.Core/Shapes/RightTriangleShape.cs index e7549ca..5aa1c01 100644 --- a/OpenNest.Core/Shapes/RightTriangleShape.cs +++ b/OpenNest.Core/Shapes/RightTriangleShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/RingShape.cs b/OpenNest.Core/Shapes/RingShape.cs index 2b22783..1cb1e66 100644 --- a/OpenNest.Core/Shapes/RingShape.cs +++ b/OpenNest.Core/Shapes/RingShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/RoundedRectangleShape.cs b/OpenNest.Core/Shapes/RoundedRectangleShape.cs index 1294ffa..dcc5726 100644 --- a/OpenNest.Core/Shapes/RoundedRectangleShape.cs +++ b/OpenNest.Core/Shapes/RoundedRectangleShape.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/ShapeDefinition.cs b/OpenNest.Core/Shapes/ShapeDefinition.cs index 4327935..b0890c4 100644 --- a/OpenNest.Core/Shapes/ShapeDefinition.cs +++ b/OpenNest.Core/Shapes/ShapeDefinition.cs @@ -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 { diff --git a/OpenNest.Core/Shapes/TShape.cs b/OpenNest.Core/Shapes/TShape.cs index 15a0c95..4231de0 100644 --- a/OpenNest.Core/Shapes/TShape.cs +++ b/OpenNest.Core/Shapes/TShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Shapes/TrapezoidShape.cs b/OpenNest.Core/Shapes/TrapezoidShape.cs index 1c56eeb..b50e0a2 100644 --- a/OpenNest.Core/Shapes/TrapezoidShape.cs +++ b/OpenNest.Core/Shapes/TrapezoidShape.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Shapes { diff --git a/OpenNest.Core/Timing.cs b/OpenNest.Core/Timing.cs index 7e1b401..9b6ce47 100644 --- a/OpenNest.Core/Timing.cs +++ b/OpenNest.Core/Timing.cs @@ -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; diff --git a/OpenNest.Core/Units.cs b/OpenNest.Core/Units.cs index 3b538b4..c695143 100644 --- a/OpenNest.Core/Units.cs +++ b/OpenNest.Core/Units.cs @@ -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; } } diff --git a/OpenNest.Engine/BestFit/BestFitFinder.cs b/OpenNest.Engine/BestFit/BestFitFinder.cs index 49a4121..95861b5 100644 --- a/OpenNest.Engine/BestFit/BestFitFinder.cs +++ b/OpenNest.Engine/BestFit/BestFitFinder.cs @@ -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 { diff --git a/OpenNest.Engine/BestFit/BestFitResult.cs b/OpenNest.Engine/BestFit/BestFitResult.cs index 97ce07c..60fc093 100644 --- a/OpenNest.Engine/BestFit/BestFitResult.cs +++ b/OpenNest.Engine/BestFit/BestFitResult.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.Engine.BestFit { diff --git a/OpenNest.Engine/BestFit/RotationSlideStrategy.cs b/OpenNest.Engine/BestFit/RotationSlideStrategy.cs index 9308ec3..7ad834d 100644 --- a/OpenNest.Engine/BestFit/RotationSlideStrategy.cs +++ b/OpenNest.Engine/BestFit/RotationSlideStrategy.cs @@ -1,6 +1,6 @@ +using OpenNest.Geometry; using System.Collections.Generic; using System.Linq; -using OpenNest.Geometry; namespace OpenNest.Engine.BestFit { diff --git a/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs b/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs index 8db666e..c0aa95e 100644 --- a/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs +++ b/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.Engine.BestFit.Tiling { diff --git a/OpenNest.Engine/BestFit/Tiling/TileResult.cs b/OpenNest.Engine/BestFit/Tiling/TileResult.cs index a3f1181..7464d4e 100644 --- a/OpenNest.Engine/BestFit/Tiling/TileResult.cs +++ b/OpenNest.Engine/BestFit/Tiling/TileResult.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Engine.BestFit.Tiling { diff --git a/OpenNest.Engine/CirclePacking/Bin.cs b/OpenNest.Engine/CirclePacking/Bin.cs index f191714..9dc3ab3 100644 --- a/OpenNest.Engine/CirclePacking/Bin.cs +++ b/OpenNest.Engine/CirclePacking/Bin.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using OpenNest.Geometry; +using System.Collections.Generic; using System.Linq; -using OpenNest.Geometry; namespace OpenNest.CirclePacking { diff --git a/OpenNest.Engine/CirclePacking/FillEndEven.cs b/OpenNest.Engine/CirclePacking/FillEndEven.cs index b343301..62ece31 100644 --- a/OpenNest.Engine/CirclePacking/FillEndEven.cs +++ b/OpenNest.Engine/CirclePacking/FillEndEven.cs @@ -1,6 +1,6 @@ -using System; -using OpenNest.Geometry; +using OpenNest.Geometry; using OpenNest.Math; +using System; namespace OpenNest.CirclePacking { diff --git a/OpenNest.Engine/CirclePacking/FillEndOdd.cs b/OpenNest.Engine/CirclePacking/FillEndOdd.cs index 44c8321..08415c7 100644 --- a/OpenNest.Engine/CirclePacking/FillEndOdd.cs +++ b/OpenNest.Engine/CirclePacking/FillEndOdd.cs @@ -1,6 +1,6 @@ -using System; -using OpenNest.Geometry; +using OpenNest.Geometry; using OpenNest.Math; +using System; namespace OpenNest.CirclePacking { diff --git a/OpenNest.Engine/Fill/BestCombination.cs b/OpenNest.Engine/Fill/BestCombination.cs index f0bc2ab..69bb186 100644 --- a/OpenNest.Engine/Fill/BestCombination.cs +++ b/OpenNest.Engine/Fill/BestCombination.cs @@ -1,5 +1,4 @@ -using System; -using OpenNest.Math; +using OpenNest.Math; namespace OpenNest { diff --git a/OpenNest.Engine/ML/AnglePredictor.cs b/OpenNest.Engine/ML/AnglePredictor.cs index da864a8..37cb749 100644 --- a/OpenNest.Engine/ML/AnglePredictor.cs +++ b/OpenNest.Engine/ML/AnglePredictor.cs @@ -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 { diff --git a/OpenNest.Engine/ML/BruteForceRunner.cs b/OpenNest.Engine/ML/BruteForceRunner.cs index a29e272..7aaaa32 100644 --- a/OpenNest.Engine/ML/BruteForceRunner.cs +++ b/OpenNest.Engine/ML/BruteForceRunner.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using OpenNest.Geometry; namespace OpenNest.Engine.ML { diff --git a/OpenNest.Engine/ML/FeatureExtractor.cs b/OpenNest.Engine/ML/FeatureExtractor.cs index c940105..7103065 100644 --- a/OpenNest.Engine/ML/FeatureExtractor.cs +++ b/OpenNest.Engine/ML/FeatureExtractor.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; using OpenNest.Geometry; +using System.Linq; namespace OpenNest.Engine.ML { diff --git a/OpenNest.Engine/NestProgress.cs b/OpenNest.Engine/NestProgress.cs index 49ae0ba..d7dccb8 100644 --- a/OpenNest.Engine/NestProgress.cs +++ b/OpenNest.Engine/NestProgress.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest { diff --git a/OpenNest.Engine/PlateProcessor.cs b/OpenNest.Engine/PlateProcessor.cs index 9601933..99391b8 100644 --- a/OpenNest.Engine/PlateProcessor.cs +++ b/OpenNest.Engine/PlateProcessor.cs @@ -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 { diff --git a/OpenNest.Engine/PlateResult.cs b/OpenNest.Engine/PlateResult.cs index 7209be7..cc7a67a 100644 --- a/OpenNest.Engine/PlateResult.cs +++ b/OpenNest.Engine/PlateResult.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.CNC; using OpenNest.Engine.RapidPlanning; +using System.Collections.Generic; namespace OpenNest.Engine { diff --git a/OpenNest.Engine/RapidPlanning/DirectRapidPlanner.cs b/OpenNest.Engine/RapidPlanning/DirectRapidPlanner.cs index 154e525..7784c48 100644 --- a/OpenNest.Engine/RapidPlanning/DirectRapidPlanner.cs +++ b/OpenNest.Engine/RapidPlanning/DirectRapidPlanner.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Engine.RapidPlanning { diff --git a/OpenNest.Engine/RapidPlanning/IRapidPlanner.cs b/OpenNest.Engine/RapidPlanning/IRapidPlanner.cs index edae37c..c33f36e 100644 --- a/OpenNest.Engine/RapidPlanning/IRapidPlanner.cs +++ b/OpenNest.Engine/RapidPlanning/IRapidPlanner.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Engine.RapidPlanning { diff --git a/OpenNest.Engine/RapidPlanning/RapidPath.cs b/OpenNest.Engine/RapidPlanning/RapidPath.cs index 8ff6eb4..f62b8d7 100644 --- a/OpenNest.Engine/RapidPlanning/RapidPath.cs +++ b/OpenNest.Engine/RapidPlanning/RapidPath.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Engine.RapidPlanning { diff --git a/OpenNest.Engine/RapidPlanning/SafeHeightRapidPlanner.cs b/OpenNest.Engine/RapidPlanning/SafeHeightRapidPlanner.cs index 6de4db6..c090224 100644 --- a/OpenNest.Engine/RapidPlanning/SafeHeightRapidPlanner.cs +++ b/OpenNest.Engine/RapidPlanning/SafeHeightRapidPlanner.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.Engine.RapidPlanning { diff --git a/OpenNest.Engine/RectanglePacking/Bin.cs b/OpenNest.Engine/RectanglePacking/Bin.cs index 5ecff28..815913d 100644 --- a/OpenNest.Engine/RectanglePacking/Bin.cs +++ b/OpenNest.Engine/RectanglePacking/Bin.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using OpenNest.Geometry; +using System.Collections.Generic; using System.Linq; -using OpenNest.Geometry; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/RectanglePacking/BinConverter.cs b/OpenNest.Engine/RectanglePacking/BinConverter.cs index bf9f4cd..1b5c7d9 100644 --- a/OpenNest.Engine/RectanglePacking/BinConverter.cs +++ b/OpenNest.Engine/RectanglePacking/BinConverter.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/RectanglePacking/FillEngine.cs b/OpenNest.Engine/RectanglePacking/FillEngine.cs index 5cca401..ac2ae46 100644 --- a/OpenNest.Engine/RectanglePacking/FillEngine.cs +++ b/OpenNest.Engine/RectanglePacking/FillEngine.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; -using OpenNest.Geometry; +using OpenNest.Geometry; +using System.Collections.Generic; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/RectanglePacking/FillNoRotation.cs b/OpenNest.Engine/RectanglePacking/FillNoRotation.cs index f56727a..3fe6443 100644 --- a/OpenNest.Engine/RectanglePacking/FillNoRotation.cs +++ b/OpenNest.Engine/RectanglePacking/FillNoRotation.cs @@ -1,5 +1,4 @@ -using System; -using OpenNest.Geometry; +using OpenNest.Geometry; using OpenNest.Math; namespace OpenNest.RectanglePacking diff --git a/OpenNest.Engine/RectanglePacking/FillSameRotation.cs b/OpenNest.Engine/RectanglePacking/FillSameRotation.cs index a7c1504..a7b5a64 100644 --- a/OpenNest.Engine/RectanglePacking/FillSameRotation.cs +++ b/OpenNest.Engine/RectanglePacking/FillSameRotation.cs @@ -1,5 +1,4 @@ -using OpenNest.Geometry; -using OpenNest.Math; +using OpenNest.Math; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/RectanglePacking/Item.cs b/OpenNest.Engine/RectanglePacking/Item.cs index a78c9d5..5eccda9 100644 --- a/OpenNest.Engine/RectanglePacking/Item.cs +++ b/OpenNest.Engine/RectanglePacking/Item.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using OpenNest.Geometry; +using OpenNest.Geometry; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/RectanglePacking/PackBottomLeft.cs b/OpenNest.Engine/RectanglePacking/PackBottomLeft.cs index 7ce8a6a..6548432 100644 --- a/OpenNest.Engine/RectanglePacking/PackBottomLeft.cs +++ b/OpenNest.Engine/RectanglePacking/PackBottomLeft.cs @@ -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; } diff --git a/OpenNest.Engine/RectanglePacking/PackEngine.cs b/OpenNest.Engine/RectanglePacking/PackEngine.cs index c8459a0..9c4f7b3 100644 --- a/OpenNest.Engine/RectanglePacking/PackEngine.cs +++ b/OpenNest.Engine/RectanglePacking/PackEngine.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using OpenNest.Geometry; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs b/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs index b290d4d..6c1a078 100644 --- a/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs +++ b/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using OpenNest.Geometry; +using System.Collections.Generic; using System.Linq; -using OpenNest.Geometry; namespace OpenNest.RectanglePacking { diff --git a/OpenNest.Engine/Sequencing/AdvancedSequencer.cs b/OpenNest.Engine/Sequencing/AdvancedSequencer.cs index 106b60c..862d50b 100644 --- a/OpenNest.Engine/Sequencing/AdvancedSequencer.cs +++ b/OpenNest.Engine/Sequencing/AdvancedSequencer.cs @@ -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 { diff --git a/OpenNest.Engine/Sequencing/EdgeStartSequencer.cs b/OpenNest.Engine/Sequencing/EdgeStartSequencer.cs index 187a599..3ce47a9 100644 --- a/OpenNest.Engine/Sequencing/EdgeStartSequencer.cs +++ b/OpenNest.Engine/Sequencing/EdgeStartSequencer.cs @@ -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)); } diff --git a/OpenNest.Engine/Sequencing/LeastCodeSequencer.cs b/OpenNest.Engine/Sequencing/LeastCodeSequencer.cs index 63b0e2a..045cb1e 100644 --- a/OpenNest.Engine/Sequencing/LeastCodeSequencer.cs +++ b/OpenNest.Engine/Sequencing/LeastCodeSequencer.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; using OpenNest.Math; +using System.Collections.Generic; namespace OpenNest.Engine.Sequencing { diff --git a/OpenNest.Engine/Sequencing/PartSequencerFactory.cs b/OpenNest.Engine/Sequencing/PartSequencerFactory.cs index 0e29d1e..57444eb 100644 --- a/OpenNest.Engine/Sequencing/PartSequencerFactory.cs +++ b/OpenNest.Engine/Sequencing/PartSequencerFactory.cs @@ -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.") }; diff --git a/OpenNest.Gpu/GpuEvaluatorFactory.cs b/OpenNest.Gpu/GpuEvaluatorFactory.cs index 9ee04f4..22c2e5e 100644 --- a/OpenNest.Gpu/GpuEvaluatorFactory.cs +++ b/OpenNest.Gpu/GpuEvaluatorFactory.cs @@ -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 { diff --git a/OpenNest.Gpu/GpuPairEvaluator.cs b/OpenNest.Gpu/GpuPairEvaluator.cs index 4a6e502..7ff20f7 100644 --- a/OpenNest.Gpu/GpuPairEvaluator.cs +++ b/OpenNest.Gpu/GpuPairEvaluator.cs @@ -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 { diff --git a/OpenNest.Gpu/GpuSlideComputer.cs b/OpenNest.Gpu/GpuSlideComputer.cs index b6c2ea0..4e00511 100644 --- a/OpenNest.Gpu/GpuSlideComputer.cs +++ b/OpenNest.Gpu/GpuSlideComputer.cs @@ -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, // stationaryPrep ArrayView1D, // 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(_lastStationaryData).SequenceEqual(new ReadOnlySpan(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(_lastMovingData).SequenceEqual(new ReadOnlySpan(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); } diff --git a/OpenNest.Gpu/PartBitmap.cs b/OpenNest.Gpu/PartBitmap.cs index 9b729ef..f75c2b3 100644 --- a/OpenNest.Gpu/PartBitmap.cs +++ b/OpenNest.Gpu/PartBitmap.cs @@ -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 { diff --git a/OpenNest.IO/DxfExporter.cs b/OpenNest.IO/DxfExporter.cs index 2cfa222..ff7faf7 100644 --- a/OpenNest.IO/DxfExporter.cs +++ b/OpenNest.IO/DxfExporter.cs @@ -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 { diff --git a/OpenNest.IO/DxfImporter.cs b/OpenNest.IO/DxfImporter.cs index c604a69..3aca509 100644 --- a/OpenNest.IO/DxfImporter.cs +++ b/OpenNest.IO/DxfImporter.cs @@ -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 { diff --git a/OpenNest.IO/Extensions.cs b/OpenNest.IO/Extensions.cs index faa1f71..a7d4be3 100644 --- a/OpenNest.IO/Extensions.cs +++ b/OpenNest.IO/Extensions.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; using ACadSharp.Entities; using CSMath; using OpenNest.Geometry; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; namespace OpenNest.IO { @@ -26,9 +25,9 @@ namespace OpenNest.IO arc.Center.X, arc.Center.Y, arc.Radius, arc.StartAngle, arc.EndAngle) - { - Layer = arc.Layer.ToOpenNest() - }; + { + Layer = arc.Layer.ToOpenNest() + }; result.ApplyDxfProperties(arc); return result; } @@ -38,9 +37,9 @@ namespace OpenNest.IO var result = new Geometry.Circle( circle.Center.X, circle.Center.Y, circle.Radius) - { - Layer = circle.Layer.ToOpenNest() - }; + { + Layer = circle.Layer.ToOpenNest() + }; result.ApplyDxfProperties(circle); return result; } @@ -50,9 +49,9 @@ namespace OpenNest.IO var result = new Geometry.Line( line.StartPoint.X, line.StartPoint.Y, line.EndPoint.X, line.EndPoint.Y) - { - Layer = line.Layer.ToOpenNest() - }; + { + Layer = line.Layer.ToOpenNest() + }; result.ApplyDxfProperties(line); return result; } @@ -76,7 +75,9 @@ namespace OpenNest.IO lines.Add(new Geometry.Line(lastPoint, nextPoint) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); lastPoint = nextPoint; @@ -85,7 +86,9 @@ namespace OpenNest.IO if (spline.IsClosed) lines.Add(new Geometry.Line(lastPoint, pts[0].ToOpenNest()) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); return lines; @@ -109,7 +112,9 @@ namespace OpenNest.IO lines.Add(new Geometry.Line(lastPoint, nextPoint) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); lastPoint = nextPoint; @@ -120,7 +125,9 @@ namespace OpenNest.IO if (isClosed) lines.Add(new Geometry.Line(lastPoint, polyline.Vertices[0].Location.ToOpenNest()) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); return lines; @@ -144,7 +151,9 @@ namespace OpenNest.IO lines.Add(new Geometry.Line(lastPoint, nextPoint) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); lastPoint = nextPoint; @@ -155,7 +164,9 @@ namespace OpenNest.IO if (isClosed) lines.Add(new Geometry.Line(lastPoint, polyline.Vertices[0].ToOpenNest()) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); return lines; @@ -204,7 +215,9 @@ namespace OpenNest.IO { lines.Add(new Geometry.Line(points[i], points[i + 1]) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); } @@ -215,7 +228,9 @@ namespace OpenNest.IO var last = lines.Last(); lines.Add(new Geometry.Line(last.EndPoint, first.StartPoint) { - Layer = layer, Color = color, LineTypeName = lineTypeName + Layer = layer, + Color = color, + LineTypeName = lineTypeName }); } diff --git a/OpenNest.IO/NestReader.cs b/OpenNest.IO/NestReader.cs index e88889e..99efcec 100644 --- a/OpenNest.IO/NestReader.cs +++ b/OpenNest.IO/NestReader.cs @@ -1,3 +1,6 @@ +using OpenNest.CNC; +using OpenNest.Engine.BestFit; +using OpenNest.Geometry; using System; using System.Collections.Generic; using System.Drawing; @@ -5,9 +8,6 @@ using System.IO; using System.IO.Compression; using System.Linq; using System.Text.Json; -using OpenNest.CNC; -using OpenNest.Engine.BestFit; -using OpenNest.Geometry; using static OpenNest.IO.NestFormat; namespace OpenNest.IO diff --git a/OpenNest.IO/NestWriter.cs b/OpenNest.IO/NestWriter.cs index d9583c5..1d7f978 100644 --- a/OpenNest.IO/NestWriter.cs +++ b/OpenNest.IO/NestWriter.cs @@ -1,3 +1,5 @@ +using OpenNest.CNC; +using OpenNest.Engine.BestFit; using System; using System.Collections.Generic; using System.IO; @@ -5,10 +7,6 @@ using System.IO.Compression; using System.Linq; using System.Text; using System.Text.Json; -using OpenNest.CNC; -using OpenNest.Engine.BestFit; -using OpenNest.Geometry; -using OpenNest.Math; using static OpenNest.IO.NestFormat; namespace OpenNest.IO diff --git a/OpenNest.IO/ProgramReader.cs b/OpenNest.IO/ProgramReader.cs index 6776d22..316f42a 100644 --- a/OpenNest.IO/ProgramReader.cs +++ b/OpenNest.IO/ProgramReader.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; +using OpenNest.CNC; +using OpenNest.Geometry; +using System.Collections.Generic; using System.IO; using System.Text; -using OpenNest.CNC; -using OpenNest.Geometry; namespace OpenNest.IO { diff --git a/OpenNest.Mcp/Program.cs b/OpenNest.Mcp/Program.cs index c924f9f..3ff768a 100644 --- a/OpenNest.Mcp/Program.cs +++ b/OpenNest.Mcp/Program.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using ModelContextProtocol.Server; using OpenNest.Mcp; var builder = Host.CreateApplicationBuilder(args); diff --git a/OpenNest.Mcp/Tools/InputTools.cs b/OpenNest.Mcp/Tools/InputTools.cs index 95c1329..9e0a546 100644 --- a/OpenNest.Mcp/Tools/InputTools.cs +++ b/OpenNest.Mcp/Tools/InputTools.cs @@ -1,11 +1,10 @@ +using ModelContextProtocol.Server; +using OpenNest.Converters; +using OpenNest.IO; +using OpenNest.Shapes; using System.ComponentModel; using System.IO; using System.Text; -using ModelContextProtocol.Server; -using OpenNest.Converters; -using OpenNest.Geometry; -using OpenNest.IO; -using OpenNest.Shapes; using CncProgram = OpenNest.CNC.Program; namespace OpenNest.Mcp.Tools diff --git a/OpenNest.Mcp/Tools/SetupTools.cs b/OpenNest.Mcp/Tools/SetupTools.cs index 154503d..fa0bf71 100644 --- a/OpenNest.Mcp/Tools/SetupTools.cs +++ b/OpenNest.Mcp/Tools/SetupTools.cs @@ -1,7 +1,7 @@ -using System.ComponentModel; -using System.Text; using ModelContextProtocol.Server; using OpenNest.Geometry; +using System.ComponentModel; +using System.Text; namespace OpenNest.Mcp.Tools { diff --git a/OpenNest.Mcp/Tools/TestTools.cs b/OpenNest.Mcp/Tools/TestTools.cs index afea628..11ccf19 100644 --- a/OpenNest.Mcp/Tools/TestTools.cs +++ b/OpenNest.Mcp/Tools/TestTools.cs @@ -1,8 +1,8 @@ +using ModelContextProtocol.Server; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Text; -using ModelContextProtocol.Server; namespace OpenNest.Mcp.Tools { diff --git a/OpenNest.Tests/CuttingResultTests.cs b/OpenNest.Tests/CuttingResultTests.cs index 58cbefc..389985d 100644 --- a/OpenNest.Tests/CuttingResultTests.cs +++ b/OpenNest.Tests/CuttingResultTests.cs @@ -1,7 +1,6 @@ using OpenNest.CNC; using OpenNest.CNC.CuttingStrategy; using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests; diff --git a/OpenNest.Tests/PartFlagTests.cs b/OpenNest.Tests/PartFlagTests.cs index f140dd2..43a9e8f 100644 --- a/OpenNest.Tests/PartFlagTests.cs +++ b/OpenNest.Tests/PartFlagTests.cs @@ -1,6 +1,5 @@ using OpenNest.CNC; using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests; diff --git a/OpenNest.Tests/PlateProcessorTests.cs b/OpenNest.Tests/PlateProcessorTests.cs index 73d5a98..3c891ff 100644 --- a/OpenNest.Tests/PlateProcessorTests.cs +++ b/OpenNest.Tests/PlateProcessorTests.cs @@ -1,12 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using OpenNest.CNC; using OpenNest.CNC.CuttingStrategy; using OpenNest.Engine; using OpenNest.Engine.RapidPlanning; using OpenNest.Engine.Sequencing; -using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests; diff --git a/OpenNest.Tests/RapidPlanning/DirectRapidPlannerTests.cs b/OpenNest.Tests/RapidPlanning/DirectRapidPlannerTests.cs index ca6a00b..793876e 100644 --- a/OpenNest.Tests/RapidPlanning/DirectRapidPlannerTests.cs +++ b/OpenNest.Tests/RapidPlanning/DirectRapidPlannerTests.cs @@ -1,7 +1,5 @@ -using System.Collections.Generic; using OpenNest.Engine.RapidPlanning; using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests.RapidPlanning; diff --git a/OpenNest.Tests/RapidPlanning/SafeHeightRapidPlannerTests.cs b/OpenNest.Tests/RapidPlanning/SafeHeightRapidPlannerTests.cs index 3db408f..1fa0c41 100644 --- a/OpenNest.Tests/RapidPlanning/SafeHeightRapidPlannerTests.cs +++ b/OpenNest.Tests/RapidPlanning/SafeHeightRapidPlannerTests.cs @@ -1,7 +1,5 @@ -using System.Collections.Generic; using OpenNest.Engine.RapidPlanning; using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests.RapidPlanning; diff --git a/OpenNest.Tests/Sequencing/AdvancedSequencerTests.cs b/OpenNest.Tests/Sequencing/AdvancedSequencerTests.cs index 69f540f..1ddf277 100644 --- a/OpenNest.Tests/Sequencing/AdvancedSequencerTests.cs +++ b/OpenNest.Tests/Sequencing/AdvancedSequencerTests.cs @@ -1,9 +1,5 @@ -using System.Collections.Generic; -using OpenNest.CNC; using OpenNest.CNC.CuttingStrategy; using OpenNest.Engine.Sequencing; -using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests.Sequencing; diff --git a/OpenNest.Tests/Sequencing/DirectionalSequencerTests.cs b/OpenNest.Tests/Sequencing/DirectionalSequencerTests.cs index 0a64a98..13dfc8f 100644 --- a/OpenNest.Tests/Sequencing/DirectionalSequencerTests.cs +++ b/OpenNest.Tests/Sequencing/DirectionalSequencerTests.cs @@ -1,8 +1,4 @@ -using System.Collections.Generic; -using OpenNest.CNC; using OpenNest.Engine.Sequencing; -using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests.Sequencing; diff --git a/OpenNest.Tests/Sequencing/EdgeStartSequencerTests.cs b/OpenNest.Tests/Sequencing/EdgeStartSequencerTests.cs index 3f002de..b6a07d1 100644 --- a/OpenNest.Tests/Sequencing/EdgeStartSequencerTests.cs +++ b/OpenNest.Tests/Sequencing/EdgeStartSequencerTests.cs @@ -1,8 +1,4 @@ -using System.Collections.Generic; -using OpenNest.CNC; using OpenNest.Engine.Sequencing; -using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests.Sequencing; diff --git a/OpenNest.Tests/Sequencing/LeastCodeSequencerTests.cs b/OpenNest.Tests/Sequencing/LeastCodeSequencerTests.cs index a5929c5..51e9f25 100644 --- a/OpenNest.Tests/Sequencing/LeastCodeSequencerTests.cs +++ b/OpenNest.Tests/Sequencing/LeastCodeSequencerTests.cs @@ -1,8 +1,4 @@ -using System.Collections.Generic; -using OpenNest.CNC; using OpenNest.Engine.Sequencing; -using OpenNest.Geometry; -using Xunit; namespace OpenNest.Tests.Sequencing; diff --git a/OpenNest.Tests/Sequencing/PartSequencerFactoryTests.cs b/OpenNest.Tests/Sequencing/PartSequencerFactoryTests.cs index 1c6a22e..61e920f 100644 --- a/OpenNest.Tests/Sequencing/PartSequencerFactoryTests.cs +++ b/OpenNest.Tests/Sequencing/PartSequencerFactoryTests.cs @@ -1,7 +1,5 @@ -using System; using OpenNest.CNC.CuttingStrategy; using OpenNest.Engine.Sequencing; -using Xunit; namespace OpenNest.Tests.Sequencing; diff --git a/OpenNest.Tests/Shapes/FlangeShapeTests.cs b/OpenNest.Tests/Shapes/FlangeShapeTests.cs index eca87c4..931582d 100644 --- a/OpenNest.Tests/Shapes/FlangeShapeTests.cs +++ b/OpenNest.Tests/Shapes/FlangeShapeTests.cs @@ -1,4 +1,3 @@ -using OpenNest.CNC; using OpenNest.Shapes; namespace OpenNest.Tests.Shapes; diff --git a/OpenNest.Training/Program.cs b/OpenNest.Training/Program.cs index eecc276..77ebedb 100644 --- a/OpenNest.Training/Program.cs +++ b/OpenNest.Training/Program.cs @@ -1,15 +1,15 @@ +using OpenNest; +using OpenNest.Engine.BestFit; +using OpenNest.Engine.ML; +using OpenNest.Geometry; +using OpenNest.Gpu; +using OpenNest.IO; +using OpenNest.Training; using System; using System.Diagnostics; using System.IO; using System.Linq; -using OpenNest; -using OpenNest.Geometry; -using OpenNest.IO; using Color = System.Drawing.Color; -using OpenNest.Engine.BestFit; -using OpenNest.Engine.ML; -using OpenNest.Gpu; -using OpenNest.Training; // Parse arguments. var dbPath = "OpenNestTraining"; diff --git a/OpenNest.Training/TrainingDatabase.cs b/OpenNest.Training/TrainingDatabase.cs index 97eb46e..a89e025 100644 --- a/OpenNest.Training/TrainingDatabase.cs +++ b/OpenNest.Training/TrainingDatabase.cs @@ -1,12 +1,12 @@ +using Microsoft.EntityFrameworkCore; +using OpenNest.Engine.ML; +using OpenNest.IO; +using OpenNest.Training.Data; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using Microsoft.EntityFrameworkCore; -using OpenNest.Engine.ML; -using OpenNest.IO; -using OpenNest.Training.Data; namespace OpenNest.Training { diff --git a/OpenNest/Actions/ActionFillArea.cs b/OpenNest/Actions/ActionFillArea.cs index 4101232..8307184 100644 --- a/OpenNest/Actions/ActionFillArea.cs +++ b/OpenNest/Actions/ActionFillArea.cs @@ -1,10 +1,10 @@ +using OpenNest.Controls; using System; using System.Collections.Generic; using System.ComponentModel; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; -using OpenNest.Controls; namespace OpenNest.Actions { diff --git a/OpenNest/Actions/ActionSelect.cs b/OpenNest/Actions/ActionSelect.cs index 4ed0eff..228cfec 100644 --- a/OpenNest/Actions/ActionSelect.cs +++ b/OpenNest/Actions/ActionSelect.cs @@ -1,8 +1,8 @@ -using System.ComponentModel; +using OpenNest.Controls; +using OpenNest.Geometry; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -using OpenNest.Controls; -using OpenNest.Geometry; namespace OpenNest.Actions { diff --git a/OpenNest/Actions/ActionSelectArea.cs b/OpenNest/Actions/ActionSelectArea.cs index 77b3ff3..542ed8c 100644 --- a/OpenNest/Actions/ActionSelectArea.cs +++ b/OpenNest/Actions/ActionSelectArea.cs @@ -1,11 +1,9 @@ -using System; +using OpenNest.Controls; +using OpenNest.Geometry; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using System.Linq; using System.Windows.Forms; -using OpenNest.Controls; -using OpenNest.Geometry; namespace OpenNest.Actions { @@ -94,12 +92,12 @@ namespace OpenNest.Actions var location = plateView.PointWorldToGraph(SelectedArea.Location); var size = new SizeF( - plateView.LengthWorldToGui(SelectedArea.Width), + plateView.LengthWorldToGui(SelectedArea.Width), plateView.LengthWorldToGui(SelectedArea.Length)); var rect = new System.Drawing.RectangleF(location.X, location.Y - size.Height, size.Width, size.Height); - e.Graphics.DrawRectangle(pen, + e.Graphics.DrawRectangle(pen, rect.X, rect.Y, rect.Width, @@ -109,9 +107,9 @@ namespace OpenNest.Actions e.Graphics.DrawString( SelectedArea.Size.ToString(2), - font, - Brushes.Green, - rect, + font, + Brushes.Green, + rect, stringFormat); } diff --git a/OpenNest/Actions/ActionSetSequence.cs b/OpenNest/Actions/ActionSetSequence.cs index fb2ed33..eaf87d0 100644 --- a/OpenNest/Actions/ActionSetSequence.cs +++ b/OpenNest/Actions/ActionSetSequence.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; +using OpenNest.Controls; +using OpenNest.Converters; +using OpenNest.Forms; +using OpenNest.Geometry; +using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; -using OpenNest.Controls; -using OpenNest.Converters; -using OpenNest.Forms; -using OpenNest.Geometry; namespace OpenNest.Actions { diff --git a/OpenNest/Actions/ActionZoomWindow.cs b/OpenNest/Actions/ActionZoomWindow.cs index 51736fb..e9843f0 100644 --- a/OpenNest/Actions/ActionZoomWindow.cs +++ b/OpenNest/Actions/ActionZoomWindow.cs @@ -1,8 +1,8 @@ -using System.ComponentModel; +using OpenNest.Controls; +using OpenNest.Geometry; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; -using OpenNest.Controls; -using OpenNest.Geometry; namespace OpenNest.Actions { diff --git a/OpenNest/Controls/BestFitCell.cs b/OpenNest/Controls/BestFitCell.cs index 39dc192..eed1fab 100644 --- a/OpenNest/Controls/BestFitCell.cs +++ b/OpenNest/Controls/BestFitCell.cs @@ -1,8 +1,8 @@ +using OpenNest.Engine.BestFit; +using OpenNest.Math; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -using OpenNest.Engine.BestFit; -using OpenNest.Math; namespace OpenNest.Controls { diff --git a/OpenNest/Controls/DrawControl.cs b/OpenNest/Controls/DrawControl.cs index 3d9f2fc..6f0b271 100644 --- a/OpenNest/Controls/DrawControl.cs +++ b/OpenNest/Controls/DrawControl.cs @@ -1,8 +1,8 @@ -using System; +using OpenNest.Geometry; +using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -using OpenNest.Geometry; namespace OpenNest.Controls { diff --git a/OpenNest/Controls/DrawingListBox.cs b/OpenNest/Controls/DrawingListBox.cs index 2a1b444..916ed00 100644 --- a/OpenNest/Controls/DrawingListBox.cs +++ b/OpenNest/Controls/DrawingListBox.cs @@ -1,5 +1,4 @@ -using System; -using System.Drawing; +using System.Drawing; using System.Windows.Forms; namespace OpenNest.Controls diff --git a/OpenNest/Controls/EntityView.cs b/OpenNest/Controls/EntityView.cs index 98db8dd..485c3f5 100644 --- a/OpenNest/Controls/EntityView.cs +++ b/OpenNest/Controls/EntityView.cs @@ -1,10 +1,9 @@ -using System; +using OpenNest.Geometry; +using OpenNest.Math; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -using OpenNest.Geometry; -using OpenNest.Math; namespace OpenNest.Controls { @@ -137,7 +136,7 @@ namespace OpenNest.Controls var diameter = radius * 2.0f; var startAngle = arc.IsReversed - ? -(float)Angle.ToDegrees(arc.EndAngle) + ? -(float)Angle.ToDegrees(arc.EndAngle) : -(float)Angle.ToDegrees(arc.StartAngle); g.DrawArc( diff --git a/OpenNest/Controls/NumericUpDown.cs b/OpenNest/Controls/NumericUpDown.cs index 3518fb8..bc9557a 100644 --- a/OpenNest/Controls/NumericUpDown.cs +++ b/OpenNest/Controls/NumericUpDown.cs @@ -6,7 +6,7 @@ namespace OpenNest.Controls { private string suffix; - + public NumericUpDown() { @@ -16,8 +16,8 @@ namespace OpenNest.Controls public string Suffix { get { return suffix; } - set - { + set + { suffix = value; UpdateEditText(); } diff --git a/OpenNest/Document.cs b/OpenNest/Document.cs index 6b4b256..90c4f14 100644 --- a/OpenNest/Document.cs +++ b/OpenNest/Document.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using OpenNest.IO; +using System; using System.IO; -using System.Linq; -using System.Text; -using OpenNest.IO; namespace OpenNest { diff --git a/OpenNest/Forms/BestFitViewerForm.cs b/OpenNest/Forms/BestFitViewerForm.cs index e168c50..15eff4d 100644 --- a/OpenNest/Forms/BestFitViewerForm.cs +++ b/OpenNest/Forms/BestFitViewerForm.cs @@ -1,9 +1,9 @@ +using OpenNest.Controls; +using OpenNest.Engine.BestFit; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; -using OpenNest.Controls; -using OpenNest.Engine.BestFit; namespace OpenNest.Forms { diff --git a/OpenNest/Forms/CadConverterForm.cs b/OpenNest/Forms/CadConverterForm.cs index 9a7ad83..240f047 100644 --- a/OpenNest/Forms/CadConverterForm.cs +++ b/OpenNest/Forms/CadConverterForm.cs @@ -1,17 +1,16 @@ -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; -using OpenNest.CNC; +using OpenNest.CNC; using OpenNest.Converters; using OpenNest.Geometry; using OpenNest.IO; using OpenNest.Properties; -using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Linq; using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; namespace OpenNest.Forms { @@ -101,7 +100,7 @@ namespace OpenNest.Forms if (entities.Count == 0) continue; - + var drawing = new Drawing(item.Name); drawing.Color = GetNextColor(); drawing.Customer = item.Customer; diff --git a/OpenNest/Forms/CutParametersForm.cs b/OpenNest/Forms/CutParametersForm.cs index ae0561d..a44453b 100644 --- a/OpenNest/Forms/CutParametersForm.cs +++ b/OpenNest/Forms/CutParametersForm.cs @@ -47,7 +47,7 @@ namespace OpenNest.Forms var suffix = UnitsHelper.GetShortTimeUnitPair(units); numericUpDown1.Suffix = " " + suffix; - numericUpDown2.Suffix = " " + suffix; + numericUpDown2.Suffix = " " + suffix; } public CutParameters GetCutParameters() diff --git a/OpenNest/Forms/EditNestForm.cs b/OpenNest/Forms/EditNestForm.cs index e85f678..ec1d6a1 100644 --- a/OpenNest/Forms/EditNestForm.cs +++ b/OpenNest/Forms/EditNestForm.cs @@ -1,20 +1,18 @@ -using System; +using OpenNest.Actions; +using OpenNest.CNC.CuttingStrategy; +using OpenNest.Collections; +using OpenNest.Controls; +using OpenNest.Engine.Sequencing; +using OpenNest.IO; +using OpenNest.Math; +using OpenNest.Properties; +using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System.Windows.Forms; -using OpenNest.Actions; -using OpenNest.CNC.CuttingStrategy; -using OpenNest.Collections; -using OpenNest.Controls; -using OpenNest.Engine; -using OpenNest.Engine.RapidPlanning; -using OpenNest.Engine.Sequencing; -using OpenNest.IO; -using OpenNest.Math; -using OpenNest.Properties; using Timer = System.Timers.Timer; namespace OpenNest.Forms diff --git a/OpenNest/Forms/EditNestInfoForm.cs b/OpenNest/Forms/EditNestInfoForm.cs index 5143fbf..1b28f7d 100644 --- a/OpenNest/Forms/EditNestInfoForm.cs +++ b/OpenNest/Forms/EditNestInfoForm.cs @@ -1,6 +1,6 @@ -using System; +using OpenNest.Geometry; +using System; using System.Windows.Forms; -using OpenNest.Geometry; using Timer = System.Timers.Timer; namespace OpenNest.Forms diff --git a/OpenNest/Forms/EditPlateForm.cs b/OpenNest/Forms/EditPlateForm.cs index 1409a18..5781329 100644 --- a/OpenNest/Forms/EditPlateForm.cs +++ b/OpenNest/Forms/EditPlateForm.cs @@ -1,6 +1,5 @@ using System; using System.Windows.Forms; -using OpenNest.Geometry; using Timer = System.Timers.Timer; namespace OpenNest.Forms @@ -15,7 +14,7 @@ namespace OpenNest.Forms public EditPlateForm(Plate plate) { InitializeComponent(); - + this.plate = plate; timer = new Timer @@ -57,7 +56,7 @@ namespace OpenNest.Forms else increment = 1; - var controls = new [] + var controls = new[] { numericUpDownThickness, numericUpDownPartSpacing, diff --git a/OpenNest/Forms/FillPlateForm.cs b/OpenNest/Forms/FillPlateForm.cs index f838b4e..c51d1b8 100644 --- a/OpenNest/Forms/FillPlateForm.cs +++ b/OpenNest/Forms/FillPlateForm.cs @@ -1,8 +1,8 @@ -using System.Drawing; -using System.Windows.Forms; -using OpenNest.Collections; +using OpenNest.Collections; using OpenNest.Controls; using OpenNest.Geometry; +using System.Drawing; +using System.Windows.Forms; namespace OpenNest.Forms { diff --git a/OpenNest/Forms/OptionsForm.cs b/OpenNest/Forms/OptionsForm.cs index 48896f7..7bb6d15 100644 --- a/OpenNest/Forms/OptionsForm.cs +++ b/OpenNest/Forms/OptionsForm.cs @@ -1,5 +1,5 @@ -using System.Windows.Forms; -using OpenNest.Properties; +using OpenNest.Properties; +using System.Windows.Forms; namespace OpenNest.Forms { diff --git a/OpenNest/GraphicsHelper.cs b/OpenNest/GraphicsHelper.cs index 5fa3ba1..f08130b 100644 --- a/OpenNest/GraphicsHelper.cs +++ b/OpenNest/GraphicsHelper.cs @@ -1,9 +1,8 @@ -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using OpenNest.CNC; +using OpenNest.CNC; using OpenNest.Geometry; using OpenNest.Math; +using System.Drawing; +using System.Drawing.Drawing2D; namespace OpenNest { @@ -53,7 +52,7 @@ namespace OpenNest var img = new Bitmap(size.Width, size.Height); var path = pgm.GetGraphicsPath(); var bounds = path.GetBounds(); - + var scalex = (size.Height - 10) / bounds.Height; var scaley = (size.Width - 10) / bounds.Width; var scale = scalex < scaley ? scalex : scaley; @@ -132,9 +131,9 @@ namespace OpenNest var sweepAngle = (endAngle - startAngle); path.AddArc( - pt.X, pt.Y, + pt.X, pt.Y, size, size, - (float)startAngle, + (float)startAngle, (float)sweepAngle); if (arc.Layer == LayerType.Leadin || arc.Layer == LayerType.Leadout) diff --git a/OpenNest/LayoutPart.cs b/OpenNest/LayoutPart.cs index d737bb3..05bfb76 100644 --- a/OpenNest/LayoutPart.cs +++ b/OpenNest/LayoutPart.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using OpenNest.Controls; +using OpenNest.Converters; +using OpenNest.Geometry; +using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; using System.Windows.Forms; -using OpenNest.Controls; -using OpenNest.Converters; -using OpenNest.Geometry; namespace OpenNest { @@ -49,7 +49,7 @@ namespace OpenNest internal bool IsDirty { get; set; } public bool IsSelected { get; set; } - + public GraphicsPath Path { get; private set; } public Color Color diff --git a/OpenNest/MainApp.cs b/OpenNest/MainApp.cs index 67660c0..952cdfc 100644 --- a/OpenNest/MainApp.cs +++ b/OpenNest/MainApp.cs @@ -1,6 +1,6 @@ +using OpenNest.Forms; using System; using System.Windows.Forms; -using OpenNest.Forms; namespace OpenNest { diff --git a/OpenNest/ToolStripRenderer.cs b/OpenNest/ToolStripRenderer.cs index 3158aee..6b41021 100644 --- a/OpenNest/ToolStripRenderer.cs +++ b/OpenNest/ToolStripRenderer.cs @@ -151,7 +151,8 @@ namespace OpenNest return hot ? (int)MenuPopupItemStates.Hover : (int)MenuPopupItemStates.Normal; return hot ? (int)MenuPopupItemStates.DisabledHover : (int)MenuPopupItemStates.Disabled; } - else { + else + { if (item.Pressed) return item.Enabled ? (int)MenuBarItemStates.Pushed : (int)MenuBarItemStates.DisabledPushed; if (item.Enabled) @@ -265,7 +266,8 @@ namespace OpenNest e.Graphics.Clip = oldClip; } } - else { + else + { base.OnRenderToolStripBorder(e); } } @@ -299,7 +301,8 @@ namespace OpenNest Rectangle bgRect = GetBackgroundRectangle(e.Item); renderer.DrawBackground(e.Graphics, bgRect, bgRect); } - else { + else + { base.OnRenderMenuItemBackground(e); } } @@ -314,7 +317,8 @@ namespace OpenNest { renderer.SetParameters(RebarClass, RebarBackground, 0); } - else { + else + { renderer.SetParameters(RebarClass, 0, 0); } @@ -325,7 +329,8 @@ namespace OpenNest e.Handled = true; } - else { + else + { base.OnRenderToolStripPanelBackground(e); } } @@ -339,7 +344,8 @@ namespace OpenNest { renderer.SetParameters(MenuClass, (int)MenuParts.PopupBackground, 0); } - else { + else + { // It's a MenuStrip or a ToolStrip. If it's contained inside a larger panel, it should have a // transparent background, showing the panel's background. @@ -350,7 +356,8 @@ namespace OpenNest // if someone does that.) return; } - else { + else + { // A lone toolbar/menubar should act like it's inside a toolbox, I guess. // Maybe I should use the MenuClass in the case of a MenuStrip, although that would break // the other themes... @@ -366,7 +373,8 @@ namespace OpenNest renderer.DrawBackground(e.Graphics, e.ToolStrip.ClientRectangle, e.AffectedBounds); } - else { + else + { base.OnRenderToolStripBackground(e); } } @@ -383,7 +391,8 @@ namespace OpenNest // It doesn't matter what colour of arrow we tell it to draw. OnRenderArrow will compute it from the item anyway. OnRenderArrow(new ToolStripArrowRenderEventArgs(e.Graphics, sb, sb.DropDownButtonBounds, Color.Red, ArrowDirection.Down)); } - else { + else + { base.OnRenderSplitButtonBackground(e); } } @@ -426,13 +435,15 @@ namespace OpenNest rect = new Rectangle(rect.X - extraWidth, rect.Y, sepWidth, rect.Height); rect.X += sepWidth; } - else { + else + { rect = new Rectangle(rect.Width + extraWidth - sepWidth, rect.Y, sepWidth, rect.Height); } renderer.DrawBackground(e.Graphics, rect); } } - else { + else + { base.OnRenderImageMargin(e); } } @@ -447,10 +458,10 @@ namespace OpenNest } else { - e.Graphics.DrawLine(Pens.LightGray, - e.Item.ContentRectangle.X, - e.Item.ContentRectangle.Y, - e.Item.ContentRectangle.X, + e.Graphics.DrawLine(Pens.LightGray, + e.Item.ContentRectangle.X, + e.Item.ContentRectangle.Y, + e.Item.ContentRectangle.X, e.Item.ContentRectangle.Y + e.Item.Height - 6); } } @@ -478,7 +489,8 @@ namespace OpenNest renderer.DrawBackground(e.Graphics, checkRect); } - else { + else + { base.OnRenderItemCheck(e); } } @@ -510,7 +522,8 @@ namespace OpenNest renderer.SetParameters(rebarClass, VisualStyleElement.Rebar.Chevron.Normal.Part, state); renderer.DrawBackground(e.Graphics, new Rectangle(Point.Empty, e.Item.Size)); } - else { + else + { base.OnRenderOverflowButtonBackground(e); } }