From 612b540d9d0fedca4253a32702406a9d9565f7be Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Thu, 12 Mar 2026 22:01:40 -0400 Subject: [PATCH] refactor: rename Size.Height to Size.Length across codebase "Length" is more natural than "height" for flat plate materials. Renames the field on OpenNest.Geometry.Size, Box.Height property, and all references across 38 files. Co-Authored-By: Claude Opus 4.6 --- OpenNest.Console/Program.cs | 2 +- OpenNest.Core/Geometry/Arc.cs | 2 +- OpenNest.Core/Geometry/BoundingBox.cs | 2 +- OpenNest.Core/Geometry/Box.cs | 20 ++++---- OpenNest.Core/Geometry/BoxSplitter.cs | 4 +- OpenNest.Core/Geometry/Circle.cs | 2 +- OpenNest.Core/Geometry/Line.cs | 4 +- OpenNest.Core/Geometry/Polygon.cs | 2 +- OpenNest.Core/Geometry/Size.cs | 16 +++---- OpenNest.Core/Part.cs | 2 +- OpenNest.Core/Plate.cs | 46 +++++++++---------- OpenNest.Engine/BestFit/PairEvaluator.cs | 2 +- .../BestFit/RotationSlideStrategy.cs | 6 +-- .../BestFit/Tiling/TileEvaluator.cs | 2 +- OpenNest.Engine/CirclePacking/FillEndEven.cs | 6 +-- OpenNest.Engine/CirclePacking/FillEndOdd.cs | 4 +- OpenNest.Engine/FillLinear.cs | 10 ++-- OpenNest.Engine/FillScore.cs | 2 +- OpenNest.Engine/NestEngine.cs | 20 ++++---- .../RectanglePacking/BinConverter.cs | 4 +- .../RectanglePacking/FillBestFit.cs | 12 ++--- .../RectanglePacking/FillEngine.cs | 2 +- .../RectanglePacking/FillNoRotation.cs | 8 ++-- OpenNest.Engine/RectanglePacking/Item.cs | 4 +- .../PackFirstFitDecreasing.cs | 10 ++-- OpenNest.IO/DxfExporter.cs | 16 +++---- OpenNest.IO/NestWriter.cs | 4 +- OpenNest.Mcp/Tools/InputTools.cs | 10 ++-- OpenNest.Mcp/Tools/InspectionTools.cs | 8 ++-- OpenNest.Mcp/Tools/NestingTools.cs | 2 +- OpenNest.Mcp/Tools/SetupTools.cs | 4 +- OpenNest/Actions/ActionSelectArea.cs | 2 +- OpenNest/Controls/DrawControl.cs | 2 +- OpenNest/Controls/PlateView.cs | 14 +++--- OpenNest/Forms/BestFitViewerForm.cs | 2 +- OpenNest/Forms/EditNestInfoForm.cs | 2 +- OpenNest/Forms/EditPlateForm.cs | 2 +- OpenNest/Forms/MainForm.cs | 4 +- 38 files changed, 133 insertions(+), 133 deletions(-) diff --git a/OpenNest.Console/Program.cs b/OpenNest.Console/Program.cs index 75a5258..fe2c97e 100644 --- a/OpenNest.Console/Program.cs +++ b/OpenNest.Console/Program.cs @@ -135,7 +135,7 @@ if (!keepParts) plate.Parts.Clear(); Console.WriteLine($"Nest: {nest.Name}"); -Console.WriteLine($"Plate: {plateIndex} ({plate.Size.Width:F1} x {plate.Size.Height:F1}), spacing={plate.PartSpacing:F2}"); +Console.WriteLine($"Plate: {plateIndex} ({plate.Size.Width:F1} x {plate.Size.Length:F1}), spacing={plate.PartSpacing:F2}"); Console.WriteLine($"Drawing: {drawing.Name}"); if (!keepParts) diff --git a/OpenNest.Core/Geometry/Arc.cs b/OpenNest.Core/Geometry/Arc.cs index 5d7393d..e63b652 100644 --- a/OpenNest.Core/Geometry/Arc.cs +++ b/OpenNest.Core/Geometry/Arc.cs @@ -388,7 +388,7 @@ namespace OpenNest.Geometry boundingBox.X = minX; boundingBox.Y = minY; boundingBox.Width = maxX - minX; - boundingBox.Height = maxY - minY; + boundingBox.Length = maxY - minY; } public override Entity OffsetEntity(double distance, OffsetSide side) diff --git a/OpenNest.Core/Geometry/BoundingBox.cs b/OpenNest.Core/Geometry/BoundingBox.cs index de057c3..bd6ab20 100644 --- a/OpenNest.Core/Geometry/BoundingBox.cs +++ b/OpenNest.Core/Geometry/BoundingBox.cs @@ -13,7 +13,7 @@ namespace OpenNest.Geometry double minX = boxes[0].X; double minY = boxes[0].Y; double maxX = boxes[0].X + boxes[0].Width; - double maxY = boxes[0].Y + boxes[0].Height; + double maxY = boxes[0].Y + boxes[0].Length; foreach (var box in boxes) { diff --git a/OpenNest.Core/Geometry/Box.cs b/OpenNest.Core/Geometry/Box.cs index e7a9755..6d4bcdc 100644 --- a/OpenNest.Core/Geometry/Box.cs +++ b/OpenNest.Core/Geometry/Box.cs @@ -15,14 +15,14 @@ namespace OpenNest.Geometry { Location = new Vector(x, y); Width = w; - Height = h; + Length = h; } public Vector Location; public Vector Center { - get { return new Vector(X + Width * 0.5, Y + Height * 0.5); } + get { return new Vector(X + Width * 0.5, Y + Length * 0.5); } } public Size Size; @@ -45,10 +45,10 @@ namespace OpenNest.Geometry set { Size.Width = value; } } - public double Height + public double Length { - get { return Size.Height; } - set { Size.Height = value; } + get { return Size.Length; } + set { Size.Length = value; } } public void MoveTo(double x, double y) @@ -86,7 +86,7 @@ namespace OpenNest.Geometry public double Top { - get { return Y + Height; } + get { return Y + Length; } } public double Bottom @@ -96,12 +96,12 @@ namespace OpenNest.Geometry public double Area() { - return Width * Height; + return Width * Length; } public double Perimeter() { - return Width * 2 + Height * 2; + return Width * 2 + Length * 2; } public bool Intersects(Box box) @@ -197,12 +197,12 @@ namespace OpenNest.Geometry public Box Offset(double d) { - return new Box(X - d, Y - d, Width + d * 2, Height + d * 2); + return new Box(X - d, Y - d, Width + d * 2, Length + d * 2); } public override string ToString() { - return string.Format("[Box: X={0}, Y={1}, Width={2}, Height={3}]", X, Y, Width, Height); + return string.Format("[Box: X={0}, Y={1}, Width={2}, Length={3}]", X, Y, Width, Length); } } } diff --git a/OpenNest.Core/Geometry/BoxSplitter.cs b/OpenNest.Core/Geometry/BoxSplitter.cs index bc09e80..938e31b 100644 --- a/OpenNest.Core/Geometry/BoxSplitter.cs +++ b/OpenNest.Core/Geometry/BoxSplitter.cs @@ -23,7 +23,7 @@ var x = large.Left; var y = large.Bottom; var w = small.Left - x; - var h = large.Height; + var h = large.Length; return new Box(x, y, w, h); } @@ -49,7 +49,7 @@ var x = small.Right; var y = large.Bottom; var w = large.Right - x; - var h = large.Height; + var h = large.Length; return new Box(x, y, w, h); } diff --git a/OpenNest.Core/Geometry/Circle.cs b/OpenNest.Core/Geometry/Circle.cs index 49f9979..859d51a 100644 --- a/OpenNest.Core/Geometry/Circle.cs +++ b/OpenNest.Core/Geometry/Circle.cs @@ -263,7 +263,7 @@ namespace OpenNest.Geometry boundingBox.X = Center.X - Radius; boundingBox.Y = Center.Y - Radius; boundingBox.Width = Diameter; - boundingBox.Height = Diameter; + boundingBox.Length = Diameter; } public override Entity OffsetEntity(double distance, OffsetSide side) diff --git a/OpenNest.Core/Geometry/Line.cs b/OpenNest.Core/Geometry/Line.cs index 5ee18ff..fde2123 100644 --- a/OpenNest.Core/Geometry/Line.cs +++ b/OpenNest.Core/Geometry/Line.cs @@ -381,12 +381,12 @@ namespace OpenNest.Geometry if (StartPoint.Y < EndPoint.Y) { boundingBox.Y = StartPoint.Y; - boundingBox.Height = EndPoint.Y - StartPoint.Y; + boundingBox.Length = EndPoint.Y - StartPoint.Y; } else { boundingBox.Y = EndPoint.Y; - boundingBox.Height = StartPoint.Y - EndPoint.Y; + boundingBox.Length = StartPoint.Y - EndPoint.Y; } } diff --git a/OpenNest.Core/Geometry/Polygon.cs b/OpenNest.Core/Geometry/Polygon.cs index 8aa8ac2..9efd3d3 100644 --- a/OpenNest.Core/Geometry/Polygon.cs +++ b/OpenNest.Core/Geometry/Polygon.cs @@ -312,7 +312,7 @@ namespace OpenNest.Geometry boundingBox.X = minX; boundingBox.Y = minY; boundingBox.Width = maxX - minX; - boundingBox.Height = maxY - minY; + boundingBox.Length = maxY - minY; } public override Entity OffsetEntity(double distance, OffsetSide side) diff --git a/OpenNest.Core/Geometry/Size.cs b/OpenNest.Core/Geometry/Size.cs index 8d96063..ae77887 100644 --- a/OpenNest.Core/Geometry/Size.cs +++ b/OpenNest.Core/Geometry/Size.cs @@ -1,16 +1,16 @@ -using System; +using System; namespace OpenNest.Geometry { public struct Size { - public Size(double width, double height) + public Size(double width, double length) { - Height = height; + Length = length; Width = width; } - public double Height; + public double Length; public double Width; @@ -21,10 +21,10 @@ namespace OpenNest.Geometry if (a.Length > 2) throw new FormatException("Invalid size format."); - var height = double.Parse(a[0]); + var length = double.Parse(a[0]); var width = double.Parse(a[1]); - return new Size(width, height); + return new Size(width, length); } public static bool TryParse(string s, out Size size) @@ -44,12 +44,12 @@ namespace OpenNest.Geometry public override string ToString() { - return string.Format("{0} x {1}", Height, Width); + return string.Format("{0} x {1}", Length, Width); } public string ToString(int decimalPlaces) { - return string.Format("{0} x {1}", System.Math.Round(Height, decimalPlaces), System.Math.Round(Width, decimalPlaces)); + return string.Format("{0} x {1}", System.Math.Round(Length, decimalPlaces), System.Math.Round(Width, decimalPlaces)); } } } diff --git a/OpenNest.Core/Part.cs b/OpenNest.Core/Part.cs index 09c3fe6..f190ce0 100644 --- a/OpenNest.Core/Part.cs +++ b/OpenNest.Core/Part.cs @@ -220,7 +220,7 @@ namespace OpenNest var part = new Part(BaseDrawing, clonedProgram, location + offset, new Box(BoundingBox.X + offset.X, BoundingBox.Y + offset.Y, - BoundingBox.Width, BoundingBox.Height)); + BoundingBox.Width, BoundingBox.Length)); return part; } diff --git a/OpenNest.Core/Plate.cs b/OpenNest.Core/Plate.cs index 2614922..4bc49b7 100644 --- a/OpenNest.Core/Plate.cs +++ b/OpenNest.Core/Plate.cs @@ -117,7 +117,7 @@ namespace OpenNest { const double oneAndHalfPI = System.Math.PI * 1.5; - Size = new Size(Size.Height, Size.Width); + Size = new Size(Size.Length, Size.Width); if (rotationDirection == RotationType.CW) { @@ -128,7 +128,7 @@ namespace OpenNest switch (Quadrant) { case 1: - Offset(0, Size.Height); + Offset(0, Size.Length); break; case 2: @@ -136,7 +136,7 @@ namespace OpenNest break; case 3: - Offset(0, -Size.Height); + Offset(0, -Size.Length); break; case 4: @@ -165,7 +165,7 @@ namespace OpenNest break; case 2: - Offset(0, Size.Height); + Offset(0, Size.Length); break; case 3: @@ -173,7 +173,7 @@ namespace OpenNest break; case 4: - Offset(0, -Size.Height); + Offset(0, -Size.Length); break; default: @@ -200,19 +200,19 @@ namespace OpenNest switch (Quadrant) { case 1: - centerpt = new Vector(Size.Width * 0.5, Size.Height * 0.5); + centerpt = new Vector(Size.Width * 0.5, Size.Length * 0.5); break; case 2: - centerpt = new Vector(-Size.Width * 0.5, Size.Height * 0.5); + centerpt = new Vector(-Size.Width * 0.5, Size.Length * 0.5); break; case 3: - centerpt = new Vector(-Size.Width * 0.5, -Size.Height * 0.5); + centerpt = new Vector(-Size.Width * 0.5, -Size.Length * 0.5); break; case 4: - centerpt = new Vector(Size.Width * 0.5, -Size.Height * 0.5); + centerpt = new Vector(Size.Width * 0.5, -Size.Length * 0.5); break; default: @@ -308,12 +308,12 @@ namespace OpenNest case 3: plateBox.X = (float)-Size.Width; - plateBox.Y = (float)-Size.Height; + plateBox.Y = (float)-Size.Length; break; case 4: plateBox.X = 0; - plateBox.Y = (float)-Size.Height; + plateBox.Y = (float)-Size.Length; break; default: @@ -321,7 +321,7 @@ namespace OpenNest } plateBox.Width = Size.Width; - plateBox.Height = Size.Height; + plateBox.Length = Size.Length; if (!includeParts) return plateBox; @@ -341,7 +341,7 @@ namespace OpenNest ? partsBox.Right - boundingBox.X : plateBox.Right - boundingBox.X; - boundingBox.Height = partsBox.Top > plateBox.Top + boundingBox.Length = partsBox.Top > plateBox.Top ? partsBox.Top - boundingBox.Y : plateBox.Top - boundingBox.Y; @@ -359,7 +359,7 @@ namespace OpenNest box.X += EdgeSpacing.Left; box.Y += EdgeSpacing.Bottom; box.Width -= EdgeSpacing.Left + EdgeSpacing.Right; - box.Height -= EdgeSpacing.Top + EdgeSpacing.Bottom; + box.Length -= EdgeSpacing.Top + EdgeSpacing.Bottom; return box; } @@ -383,28 +383,28 @@ namespace OpenNest var bounds = Parts.GetBoundingBox(); double width; - double height; + double length; switch (Quadrant) { case 1: width = System.Math.Abs(bounds.Right) + EdgeSpacing.Right; - height = System.Math.Abs(bounds.Top) + EdgeSpacing.Top; + length = System.Math.Abs(bounds.Top) + EdgeSpacing.Top; break; case 2: width = System.Math.Abs(bounds.Left) + EdgeSpacing.Left; - height = System.Math.Abs(bounds.Top) + EdgeSpacing.Top; + length = System.Math.Abs(bounds.Top) + EdgeSpacing.Top; break; case 3: width = System.Math.Abs(bounds.Left) + EdgeSpacing.Left; - height = System.Math.Abs(bounds.Bottom) + EdgeSpacing.Bottom; + length = System.Math.Abs(bounds.Bottom) + EdgeSpacing.Bottom; break; case 4: width = System.Math.Abs(bounds.Right) + EdgeSpacing.Right; - height = System.Math.Abs(bounds.Bottom) + EdgeSpacing.Bottom; + length = System.Math.Abs(bounds.Bottom) + EdgeSpacing.Bottom; break; default: @@ -413,7 +413,7 @@ namespace OpenNest Size = new Size( Helper.RoundUpToNearest(width, roundingFactor), - Helper.RoundUpToNearest(height, roundingFactor)); + Helper.RoundUpToNearest(length, roundingFactor)); } /// @@ -422,7 +422,7 @@ namespace OpenNest /// public double Area() { - return Size.Width * Size.Height; + return Size.Width * Size.Length; } /// @@ -503,7 +503,7 @@ namespace OpenNest if (maxRight < work.Right) { - var strip = new Box(maxRight, work.Bottom, work.Right - maxRight, work.Height); + var strip = new Box(maxRight, work.Bottom, work.Right - maxRight, work.Length); if (strip.Area() > 1.0) results.Add(strip); } @@ -548,7 +548,7 @@ namespace OpenNest if (minLeft > work.Left) { - var strip = new Box(work.Left, work.Bottom, minLeft - work.Left, work.Height); + var strip = new Box(work.Left, work.Bottom, minLeft - work.Left, work.Length); if (strip.Area() > 1.0) results.Add(strip); } diff --git a/OpenNest.Engine/BestFit/PairEvaluator.cs b/OpenNest.Engine/BestFit/PairEvaluator.cs index a91f0c6..5224820 100644 --- a/OpenNest.Engine/BestFit/PairEvaluator.cs +++ b/OpenNest.Engine/BestFit/PairEvaluator.cs @@ -57,7 +57,7 @@ namespace OpenNest.Engine.BestFit var combinedBox = ((IEnumerable)new IBoundable[] { part1, part2 }).GetBoundingBox(); bestArea = combinedBox.Area(); bestWidth = combinedBox.Width; - bestHeight = combinedBox.Height; + bestHeight = combinedBox.Length; bestRotation = 0; } diff --git a/OpenNest.Engine/BestFit/RotationSlideStrategy.cs b/OpenNest.Engine/BestFit/RotationSlideStrategy.cs index 4e09da2..f0e0771 100644 --- a/OpenNest.Engine/BestFit/RotationSlideStrategy.cs +++ b/OpenNest.Engine/BestFit/RotationSlideStrategy.cs @@ -64,15 +64,15 @@ namespace OpenNest.Engine.BestFit if (isHorizontalPush) { - perpMin = -(bbox2.Height + spacing); - perpMax = bbox1.Height + bbox2.Height + spacing; + perpMin = -(bbox2.Length + spacing); + perpMax = bbox1.Length + bbox2.Length + spacing; pushStartOffset = bbox1.Width + bbox2.Width + spacing * 2; } else { perpMin = -(bbox2.Width + spacing); perpMax = bbox1.Width + bbox2.Width + spacing; - pushStartOffset = bbox1.Height + bbox2.Height + spacing * 2; + pushStartOffset = bbox1.Length + bbox2.Length + spacing * 2; } // Pre-compute part1's offset lines (half-spacing outward) diff --git a/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs b/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs index 9a7ddb0..f498ae3 100644 --- a/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs +++ b/OpenNest.Engine/BestFit/Tiling/TileEvaluator.cs @@ -9,7 +9,7 @@ namespace OpenNest.Engine.BestFit.Tiling public TileResult Evaluate(BestFitResult bestFit, Plate plate) { var plateWidth = plate.Size.Width - plate.EdgeSpacing.Left - plate.EdgeSpacing.Right; - var plateHeight = plate.Size.Height - plate.EdgeSpacing.Top - plate.EdgeSpacing.Bottom; + var plateHeight = plate.Size.Length - plate.EdgeSpacing.Top - plate.EdgeSpacing.Bottom; var result1 = TryTile(bestFit, plateWidth, plateHeight, false); var result2 = TryTile(bestFit, plateWidth, plateHeight, true); diff --git a/OpenNest.Engine/CirclePacking/FillEndEven.cs b/OpenNest.Engine/CirclePacking/FillEndEven.cs index e3d6786..b343301 100644 --- a/OpenNest.Engine/CirclePacking/FillEndEven.cs +++ b/OpenNest.Engine/CirclePacking/FillEndEven.cs @@ -17,10 +17,10 @@ namespace OpenNest.CirclePacking Bin.Right - item.BoundingBox.Right + Tolerance.Epsilon, Bin.Top - item.BoundingBox.Top + Tolerance.Epsilon); - var rows = System.Math.Floor((Bin.Height + Tolerance.Epsilon) / (item.Diameter)); + var rows = System.Math.Floor((Bin.Length + Tolerance.Epsilon) / (item.Diameter)); var diameter = item.Diameter; - var remaining = Bin.Height - diameter * rows; + var remaining = Bin.Length - diameter * rows; var radius = diameter * 0.5; if (remaining < radius) @@ -47,7 +47,7 @@ namespace OpenNest.CirclePacking } else { - var yoffset = (Bin.Height - diameter) / (2 * rows - 1); + var yoffset = (Bin.Length - diameter) / (2 * rows - 1); var xoffset = Trigonometry.Base(yoffset, diameter); var yodd = Bin.Y + yoffset; diff --git a/OpenNest.Engine/CirclePacking/FillEndOdd.cs b/OpenNest.Engine/CirclePacking/FillEndOdd.cs index f048da8..44c8321 100644 --- a/OpenNest.Engine/CirclePacking/FillEndOdd.cs +++ b/OpenNest.Engine/CirclePacking/FillEndOdd.cs @@ -71,12 +71,12 @@ namespace OpenNest.CirclePacking Bin.Right - item.BoundingBox.Right + Tolerance.Epsilon, Bin.Top - item.BoundingBox.Top + Tolerance.Epsilon); - var count = System.Math.Floor((bin.Height + Tolerance.Epsilon) / item.Diameter); + var count = System.Math.Floor((bin.Length + Tolerance.Epsilon) / item.Diameter); if (count == 0) return bin; - var yoffset = (bin.Height - item.Diameter) / (count - 1); + var yoffset = (bin.Length - item.Diameter) / (count - 1); var xoffset = Trigonometry.Base(yoffset * 0.5, item.Diameter); int column = 0; diff --git a/OpenNest.Engine/FillLinear.cs b/OpenNest.Engine/FillLinear.cs index 63e32ae..ab3d919 100644 --- a/OpenNest.Engine/FillLinear.cs +++ b/OpenNest.Engine/FillLinear.cs @@ -9,7 +9,7 @@ namespace OpenNest public FillLinear(Box workArea, double partSpacing) { PartSpacing = partSpacing; - WorkArea = new Box(workArea.X, workArea.Y, workArea.Width, workArea.Height); + WorkArea = new Box(workArea.X, workArea.Y, workArea.Width, workArea.Length); } public Box WorkArea { get; } @@ -34,7 +34,7 @@ namespace OpenNest private static double GetDimension(Box box, NestDirection direction) { - return direction == NestDirection.Horizontal ? box.Width : box.Height; + return direction == NestDirection.Horizontal ? box.Width : box.Length; } private static double GetStart(Box box, NestDirection direction) @@ -321,7 +321,7 @@ namespace OpenNest template.Offset(WorkArea.Location - template.BoundingBox.Location); if (template.BoundingBox.Width > WorkArea.Width + Tolerance.Epsilon || - template.BoundingBox.Height > WorkArea.Height + Tolerance.Epsilon) + template.BoundingBox.Length > WorkArea.Length + Tolerance.Epsilon) return pattern; pattern.Parts.Add(template); @@ -472,7 +472,7 @@ namespace OpenNest if (width <= Tolerance.Epsilon) return new List(); - remainingStrip = new Box(left, WorkArea.Y, width, WorkArea.Height); + remainingStrip = new Box(left, WorkArea.Y, width, WorkArea.Length); } // Build rotation set: always try cardinal orientations (0° and 90°), @@ -601,7 +601,7 @@ namespace OpenNest var basePattern = pattern.Clone(offset); if (basePattern.BoundingBox.Width > WorkArea.Width + Tolerance.Epsilon || - basePattern.BoundingBox.Height > WorkArea.Height + Tolerance.Epsilon) + basePattern.BoundingBox.Length > WorkArea.Length + Tolerance.Epsilon) return new List(); return FillRecursive(basePattern, primaryAxis, depth: 0); diff --git a/OpenNest.Engine/FillScore.cs b/OpenNest.Engine/FillScore.cs index e06cc65..8c1dd2b 100644 --- a/OpenNest.Engine/FillScore.cs +++ b/OpenNest.Engine/FillScore.cs @@ -80,7 +80,7 @@ namespace OpenNest if (maxRight < workArea.Right) { var width = workArea.Right - maxRight; - var height = workArea.Height; + var height = workArea.Length; if (System.Math.Min(width, height) >= MinRemnantDimension) largest = System.Math.Max(largest, width * height); diff --git a/OpenNest.Engine/NestEngine.cs b/OpenNest.Engine/NestEngine.cs index 394660a..0893ed5 100644 --- a/OpenNest.Engine/NestEngine.cs +++ b/OpenNest.Engine/NestEngine.cs @@ -70,8 +70,8 @@ namespace OpenNest testPart.UpdateBounds(); - var partLongestSide = System.Math.Max(testPart.BoundingBox.Width, testPart.BoundingBox.Height); - var workAreaShortSide = System.Math.Min(workArea.Width, workArea.Height); + var partLongestSide = System.Math.Max(testPart.BoundingBox.Width, testPart.BoundingBox.Length); + var workAreaShortSide = System.Math.Min(workArea.Width, workArea.Length); if (workAreaShortSide < partLongestSide) { @@ -113,7 +113,7 @@ namespace OpenNest } var bestLinearScore = best != null ? FillScore.Compute(best, workArea) : default; - Debug.WriteLine($"[FindBestFill] Linear: {bestLinearScore.Count} parts, density={bestLinearScore.Density:P1} | WorkArea: {workArea.Width:F1}x{workArea.Height:F1} | Angles: {angles.Count}"); + Debug.WriteLine($"[FindBestFill] Linear: {bestLinearScore.Count} parts, density={bestLinearScore.Density:P1} | WorkArea: {workArea.Width:F1}x{workArea.Length:F1} | Angles: {angles.Count}"); // Try rectangle best-fit (mixes orientations to fill remnant strips). var rectResult = FillRectangleBestFit(item, workArea); @@ -143,7 +143,7 @@ namespace OpenNest var angles = RotationAnalysis.FindHullEdgeAngles(groupParts); var best = FillPattern(engine, groupParts, angles, workArea); - Debug.WriteLine($"[Fill(groupParts,Box)] Linear: {best?.Count ?? 0} parts | WorkArea: {workArea.Width:F1}x{workArea.Height:F1}"); + Debug.WriteLine($"[Fill(groupParts,Box)] Linear: {best?.Count ?? 0} parts | WorkArea: {workArea.Width:F1}x{workArea.Length:F1}"); if (groupParts.Count == 1) { @@ -213,7 +213,7 @@ namespace OpenNest private List FillWithPairs(NestItem item, Box workArea) { var bestFits = BestFitCache.GetOrCompute( - item.Drawing, Plate.Size.Width, Plate.Size.Height, + item.Drawing, Plate.Size.Width, Plate.Size.Length, Plate.PartSpacing); var candidates = SelectPairCandidates(bestFits, workArea); @@ -260,8 +260,8 @@ namespace OpenNest var kept = bestFits.Where(r => r.Keep).ToList(); var top = kept.Take(50).ToList(); - var workShortSide = System.Math.Min(workArea.Width, workArea.Height); - var plateShortSide = System.Math.Min(Plate.Size.Width, Plate.Size.Height); + var workShortSide = System.Math.Min(workArea.Width, workArea.Length); + var plateShortSide = System.Math.Min(Plate.Size.Width, Plate.Size.Length); // When the work area is significantly narrower than the plate, // include all pairs that fit the narrow dimension. @@ -356,7 +356,7 @@ namespace OpenNest var refDim = horizontal ? sorted.Max(p => p.BoundingBox.Width) - : sorted.Max(p => p.BoundingBox.Height); + : sorted.Max(p => p.BoundingBox.Length); var gapThreshold = refDim * 0.5; var clusters = new List>(); @@ -425,7 +425,7 @@ namespace OpenNest if (stripWidth <= 0) return null; - stripBox = new Box(stripLeft, workArea.Y, stripWidth, workArea.Height); + stripBox = new Box(stripLeft, workArea.Y, stripWidth, workArea.Length); } else { @@ -438,7 +438,7 @@ namespace OpenNest stripBox = new Box(workArea.X, stripBottom, workArea.Width, stripHeight); } - Debug.WriteLine($"[TryStripRefill] Strip: {stripBox.Width:F1}x{stripBox.Height:F1} at ({stripBox.X:F1},{stripBox.Y:F1})"); + Debug.WriteLine($"[TryStripRefill] Strip: {stripBox.Width:F1}x{stripBox.Length:F1} at ({stripBox.X:F1},{stripBox.Y:F1})"); var stripParts = FindBestFill(item, stripBox); diff --git a/OpenNest.Engine/RectanglePacking/BinConverter.cs b/OpenNest.Engine/RectanglePacking/BinConverter.cs index 930f180..bf9f4cd 100644 --- a/OpenNest.Engine/RectanglePacking/BinConverter.cs +++ b/OpenNest.Engine/RectanglePacking/BinConverter.cs @@ -15,7 +15,7 @@ namespace OpenNest.RectanglePacking }; bin.Width += partSpacing; - bin.Height += partSpacing; + bin.Length += partSpacing; return bin; } @@ -25,7 +25,7 @@ namespace OpenNest.RectanglePacking var box = item.Drawing.Program.BoundingBox(); box.Width += partSpacing; - box.Height += partSpacing; + box.Length += partSpacing; return new Item { diff --git a/OpenNest.Engine/RectanglePacking/FillBestFit.cs b/OpenNest.Engine/RectanglePacking/FillBestFit.cs index 8b8d74d..fb37247 100644 --- a/OpenNest.Engine/RectanglePacking/FillBestFit.cs +++ b/OpenNest.Engine/RectanglePacking/FillBestFit.cs @@ -44,11 +44,11 @@ namespace OpenNest.RectanglePacking int normalColumns = 0; int rotateColumns = 0; - if (!BestCombination.FindFrom2(item.Width, item.Height, bin.Width, out normalColumns, out rotateColumns)) + if (!BestCombination.FindFrom2(item.Width, item.Length, bin.Width, out normalColumns, out rotateColumns)) return bin; - var normalRows = (int)System.Math.Floor((bin.Height + Tolerance.Epsilon) / item.Height); - var rotateRows = (int)System.Math.Floor((bin.Height + Tolerance.Epsilon) / item.Width); + var normalRows = (int)System.Math.Floor((bin.Length + Tolerance.Epsilon) / item.Length); + var rotateRows = (int)System.Math.Floor((bin.Length + Tolerance.Epsilon) / item.Width); item.Location = bin.Location; @@ -69,17 +69,17 @@ namespace OpenNest.RectanglePacking int normalRows = 0; int rotateRows = 0; - if (!BestCombination.FindFrom2(item.Height, item.Width, Bin.Height, out normalRows, out rotateRows)) + if (!BestCombination.FindFrom2(item.Length, item.Width, Bin.Length, out normalRows, out rotateRows)) return bin; var normalColumns = (int)System.Math.Floor((Bin.Width + Tolerance.Epsilon) / item.Width); - var rotateColumns = (int)System.Math.Floor((Bin.Width + Tolerance.Epsilon) / item.Height); + var rotateColumns = (int)System.Math.Floor((Bin.Width + Tolerance.Epsilon) / item.Length); item.Location = bin.Location; bin.Items.AddRange(FillGrid(item, normalRows, normalColumns, int.MaxValue)); - item.Location.Y += item.Height * normalRows; + item.Location.Y += item.Length * normalRows; item.Rotate(); bin.Items.AddRange(FillGrid(item, rotateRows, rotateColumns, int.MaxValue)); diff --git a/OpenNest.Engine/RectanglePacking/FillEngine.cs b/OpenNest.Engine/RectanglePacking/FillEngine.cs index 2164351..5cca401 100644 --- a/OpenNest.Engine/RectanglePacking/FillEngine.cs +++ b/OpenNest.Engine/RectanglePacking/FillEngine.cs @@ -28,7 +28,7 @@ namespace OpenNest.RectanglePacking for (var j = 0; j < innerCount; j++) { var x = (columnMajor ? i : j) * item.Width + item.X; - var y = (columnMajor ? j : i) * item.Height + item.Y; + var y = (columnMajor ? j : i) * item.Length + item.Y; var clone = item.Clone() as Item; clone.Location = new Vector(x, y); diff --git a/OpenNest.Engine/RectanglePacking/FillNoRotation.cs b/OpenNest.Engine/RectanglePacking/FillNoRotation.cs index f248276..f56727a 100644 --- a/OpenNest.Engine/RectanglePacking/FillNoRotation.cs +++ b/OpenNest.Engine/RectanglePacking/FillNoRotation.cs @@ -15,7 +15,7 @@ namespace OpenNest.RectanglePacking public override void Fill(Item item) { - var ycount = (int)System.Math.Floor((Bin.Height + Tolerance.Epsilon) / item.Height); + var ycount = (int)System.Math.Floor((Bin.Length + Tolerance.Epsilon) / item.Length); var xcount = (int)System.Math.Floor((Bin.Width + Tolerance.Epsilon) / item.Width); for (int i = 0; i < xcount; i++) @@ -24,7 +24,7 @@ namespace OpenNest.RectanglePacking for (int j = 0; j < ycount; j++) { - var y = item.Height * j + Bin.Y; + var y = item.Length * j + Bin.Y; var addedItem = item.Clone() as Item; addedItem.Location = new Vector(x, y); @@ -36,7 +36,7 @@ namespace OpenNest.RectanglePacking public override void Fill(Item item, int maxCount) { - var ycount = (int)System.Math.Floor((Bin.Height + Tolerance.Epsilon) / item.Height); + var ycount = (int)System.Math.Floor((Bin.Length + Tolerance.Epsilon) / item.Length); var xcount = (int)System.Math.Floor((Bin.Width + Tolerance.Epsilon) / item.Width); var count = ycount * xcount; @@ -60,7 +60,7 @@ namespace OpenNest.RectanglePacking columns = (int)System.Math.Ceiling((double)maxCount / rows); } - Bin.Items.AddRange(FillGrid(item, rows, columns, maxCount, columnMajor: item.Width > item.Height)); + Bin.Items.AddRange(FillGrid(item, rows, columns, maxCount, columnMajor: item.Width > item.Length)); } } } diff --git a/OpenNest.Engine/RectanglePacking/Item.cs b/OpenNest.Engine/RectanglePacking/Item.cs index d1c25e2..a78c9d5 100644 --- a/OpenNest.Engine/RectanglePacking/Item.cs +++ b/OpenNest.Engine/RectanglePacking/Item.cs @@ -12,7 +12,7 @@ namespace OpenNest.RectanglePacking public void Rotate() { - Generic.Swap(ref Size.Width, ref Size.Height); + Generic.Swap(ref Size.Width, ref Size.Length); IsRotated = !IsRotated; } @@ -38,7 +38,7 @@ namespace OpenNest.RectanglePacking double minX = items[0].X; double minY = items[0].Y; double maxX = items[0].X + items[0].Width; - double maxY = items[0].Y + items[0].Height; + double maxY = items[0].Y + items[0].Length; foreach (var box in items) { diff --git a/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs b/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs index 2e3ebbf..b290d4d 100644 --- a/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs +++ b/OpenNest.Engine/RectanglePacking/PackFirstFitDecreasing.cs @@ -16,11 +16,11 @@ namespace OpenNest.RectanglePacking public override void Pack(List items) { - items = items.OrderBy(i => -i.Height).ToList(); + items = items.OrderBy(i => -i.Length).ToList(); foreach (var item in items) { - if (item.Height > Bin.Height) + if (item.Length > Bin.Length) continue; var level = FindLevel(item); @@ -36,7 +36,7 @@ namespace OpenNest.RectanglePacking { foreach (var level in levels) { - if (level.Height < item.Height) + if (level.Height < item.Length) continue; if (level.RemainingWidth < item.Width) @@ -58,12 +58,12 @@ namespace OpenNest.RectanglePacking var remaining = Bin.Top - y; - if (remaining < item.Height) + if (remaining < item.Length) return null; var level = new Level(Bin); level.Y = y; - level.Height = item.Height; + level.Height = item.Length; levels.Add(level); diff --git a/OpenNest.IO/DxfExporter.cs b/OpenNest.IO/DxfExporter.cs index 83de69d..aac67a3 100644 --- a/OpenNest.IO/DxfExporter.cs +++ b/OpenNest.IO/DxfExporter.cs @@ -145,29 +145,29 @@ namespace OpenNest.IO { case 1: pt1 = new XYZ(0, 0, 0); - pt2 = new XYZ(0, plate.Size.Height, 0); - pt3 = new XYZ(plate.Size.Width, plate.Size.Height, 0); + pt2 = new XYZ(0, plate.Size.Length, 0); + pt3 = new XYZ(plate.Size.Width, plate.Size.Length, 0); pt4 = new XYZ(plate.Size.Width, 0, 0); break; case 2: pt1 = new XYZ(0, 0, 0); - pt2 = new XYZ(0, plate.Size.Height, 0); - pt3 = new XYZ(-plate.Size.Width, plate.Size.Height, 0); + pt2 = new XYZ(0, plate.Size.Length, 0); + pt3 = new XYZ(-plate.Size.Width, plate.Size.Length, 0); pt4 = new XYZ(-plate.Size.Width, 0, 0); break; case 3: pt1 = new XYZ(0, 0, 0); - pt2 = new XYZ(0, -plate.Size.Height, 0); - pt3 = new XYZ(-plate.Size.Width, -plate.Size.Height, 0); + pt2 = new XYZ(0, -plate.Size.Length, 0); + pt3 = new XYZ(-plate.Size.Width, -plate.Size.Length, 0); pt4 = new XYZ(-plate.Size.Width, 0, 0); break; case 4: pt1 = new XYZ(0, 0, 0); - pt2 = new XYZ(0, -plate.Size.Height, 0); - pt3 = new XYZ(plate.Size.Width, -plate.Size.Height, 0); + pt2 = new XYZ(0, -plate.Size.Length, 0); + pt3 = new XYZ(plate.Size.Width, -plate.Size.Length, 0); pt4 = new XYZ(plate.Size.Width, 0, 0); break; diff --git a/OpenNest.IO/NestWriter.cs b/OpenNest.IO/NestWriter.cs index 842f825..4202a3d 100644 --- a/OpenNest.IO/NestWriter.cs +++ b/OpenNest.IO/NestWriter.cs @@ -82,7 +82,7 @@ namespace OpenNest.IO var pd = nest.PlateDefaults; return new PlateDefaultsDto { - Size = new SizeDto { Width = pd.Size.Width, Length = pd.Size.Height }, + Size = new SizeDto { Width = pd.Size.Width, Length = pd.Size.Length }, Thickness = pd.Thickness, Quadrant = pd.Quadrant, PartSpacing = pd.PartSpacing, @@ -161,7 +161,7 @@ namespace OpenNest.IO list.Add(new PlateDto { Id = i + 1, - Size = new SizeDto { Width = plate.Size.Width, Length = plate.Size.Height }, + Size = new SizeDto { Width = plate.Size.Width, Length = plate.Size.Length }, Thickness = plate.Thickness, Quadrant = plate.Quadrant, Quantity = plate.Quantity, diff --git a/OpenNest.Mcp/Tools/InputTools.cs b/OpenNest.Mcp/Tools/InputTools.cs index e3f1a28..1596959 100644 --- a/OpenNest.Mcp/Tools/InputTools.cs +++ b/OpenNest.Mcp/Tools/InputTools.cs @@ -40,10 +40,10 @@ namespace OpenNest.Mcp.Tools { var plate = nest.Plates[i]; var work = plate.WorkArea(); - sb.AppendLine($" Plate {i}: {plate.Size.Width:F1} x {plate.Size.Height:F1}, " + + sb.AppendLine($" Plate {i}: {plate.Size.Width:F1} x {plate.Size.Length:F1}, " + $"parts={plate.Parts.Count}, " + $"utilization={plate.Utilization():P1}, " + - $"work area={work.Width:F1} x {work.Height:F1}"); + $"work area={work.Width:F1} x {work.Length:F1}"); } sb.AppendLine($"Drawings: {nest.Drawings.Count}"); @@ -51,7 +51,7 @@ namespace OpenNest.Mcp.Tools foreach (var dwg in nest.Drawings) { var bbox = dwg.Program.BoundingBox(); - sb.AppendLine($" {dwg.Name}: bbox={bbox.Width:F2} x {bbox.Height:F2}, " + + sb.AppendLine($" {dwg.Name}: bbox={bbox.Width:F2} x {bbox.Length:F2}, " + $"required={dwg.Quantity.Required}, nested={dwg.Quantity.Nested}"); } @@ -85,7 +85,7 @@ namespace OpenNest.Mcp.Tools _session.Drawings.Add(drawing); var bbox = pgm.BoundingBox(); - return $"Imported drawing '{drawingName}': bbox={bbox.Width:F2} x {bbox.Height:F2}"; + return $"Imported drawing '{drawingName}': bbox={bbox.Width:F2} x {bbox.Length:F2}"; } [McpServerTool(Name = "create_drawing")] @@ -134,7 +134,7 @@ namespace OpenNest.Mcp.Tools _session.Drawings.Add(drawing); var bbox = pgm.BoundingBox(); - return $"Created drawing '{name}': bbox={bbox.Width:F2} x {bbox.Height:F2}"; + return $"Created drawing '{name}': bbox={bbox.Width:F2} x {bbox.Length:F2}"; } private static CncProgram CreateRectangle(double width, double height) diff --git a/OpenNest.Mcp/Tools/InspectionTools.cs b/OpenNest.Mcp/Tools/InspectionTools.cs index 50c95eb..905bd8d 100644 --- a/OpenNest.Mcp/Tools/InspectionTools.cs +++ b/OpenNest.Mcp/Tools/InspectionTools.cs @@ -32,13 +32,13 @@ namespace OpenNest.Mcp.Tools var sb = new StringBuilder(); sb.AppendLine($"Plate {plateIndex}:"); - sb.AppendLine($" Size: {plate.Size.Width:F1} x {plate.Size.Height:F1}"); + sb.AppendLine($" Size: {plate.Size.Width:F1} x {plate.Size.Length:F1}"); sb.AppendLine($" Quadrant: {plate.Quadrant}"); sb.AppendLine($" Thickness: {plate.Thickness:F2}"); sb.AppendLine($" Material: {plate.Material.Name}"); sb.AppendLine($" Part spacing: {plate.PartSpacing:F2}"); sb.AppendLine($" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}"); - sb.AppendLine($" Work area: {work.X:F1},{work.Y:F1} {work.Width:F1}x{work.Height:F1}"); + sb.AppendLine($" Work area: {work.X:F1},{work.Y:F1} {work.Width:F1}x{work.Length:F1}"); sb.AppendLine($" Parts: {plate.Parts.Count}"); sb.AppendLine($" Utilization: {plate.Utilization():P1}"); sb.AppendLine($" Quantity: {plate.Quantity}"); @@ -57,7 +57,7 @@ namespace OpenNest.Mcp.Tools for (var i = 0; i < remnants.Count; i++) { var r = remnants[i]; - sb.AppendLine($" Remnant {i}: ({r.X:F1},{r.Y:F1}) {r.Width:F1}x{r.Height:F1}, area={r.Area():F1}"); + sb.AppendLine($" Remnant {i}: ({r.X:F1},{r.Y:F1}) {r.Width:F1}x{r.Length:F1}, area={r.Area():F1}"); } return sb.ToString(); @@ -90,7 +90,7 @@ namespace OpenNest.Mcp.Tools sb.AppendLine($" [{i}] {part.BaseDrawing.Name}: " + $"loc=({part.Location.X:F2},{part.Location.Y:F2}), " + $"rot={rotDeg:F1} deg, " + - $"bbox=({bbox.X:F2},{bbox.Y:F2} {bbox.Width:F2}x{bbox.Height:F2})"); + $"bbox=({bbox.X:F2},{bbox.Y:F2} {bbox.Width:F2}x{bbox.Length:F2})"); } if (plate.Parts.Count > limit) diff --git a/OpenNest.Mcp/Tools/NestingTools.cs b/OpenNest.Mcp/Tools/NestingTools.cs index 46b865d..76cc3ca 100644 --- a/OpenNest.Mcp/Tools/NestingTools.cs +++ b/OpenNest.Mcp/Tools/NestingTools.cs @@ -121,7 +121,7 @@ namespace OpenNest.Mcp.Tools var added = plate.Parts.Count - countBefore; totalAdded += added; - sb.AppendLine($" Remnant {i}: ({remnant.X:F1},{remnant.Y:F1} {remnant.Width:F1}x{remnant.Height:F1}) -> {added} parts {(success ? "" : "(no fit)")}"); + sb.AppendLine($" Remnant {i}: ({remnant.X:F1},{remnant.Y:F1} {remnant.Width:F1}x{remnant.Length:F1}) -> {added} parts {(success ? "" : "(no fit)")}"); } sb.AppendLine($"Total parts added: {totalAdded}"); diff --git a/OpenNest.Mcp/Tools/SetupTools.cs b/OpenNest.Mcp/Tools/SetupTools.cs index d093738..154503d 100644 --- a/OpenNest.Mcp/Tools/SetupTools.cs +++ b/OpenNest.Mcp/Tools/SetupTools.cs @@ -41,11 +41,11 @@ namespace OpenNest.Mcp.Tools var work = plate.WorkArea(); var sb = new StringBuilder(); - sb.AppendLine($"Created plate {index}: {plate.Size.Width:F1} x {plate.Size.Height:F1}"); + sb.AppendLine($"Created plate {index}: {plate.Size.Width:F1} x {plate.Size.Length:F1}"); sb.AppendLine($" Quadrant: {plate.Quadrant}"); sb.AppendLine($" Part spacing: {plate.PartSpacing:F2}"); sb.AppendLine($" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}"); - sb.AppendLine($" Work area: {work.Width:F1} x {work.Height:F1}"); + sb.AppendLine($" Work area: {work.Width:F1} x {work.Length:F1}"); return sb.ToString(); } diff --git a/OpenNest/Actions/ActionSelectArea.cs b/OpenNest/Actions/ActionSelectArea.cs index 631db37..d65c46b 100644 --- a/OpenNest/Actions/ActionSelectArea.cs +++ b/OpenNest/Actions/ActionSelectArea.cs @@ -95,7 +95,7 @@ namespace OpenNest.Actions var location = plateView.PointWorldToGraph(SelectedArea.Location); var size = new SizeF( plateView.LengthWorldToGui(SelectedArea.Width), - plateView.LengthWorldToGui(SelectedArea.Height)); + plateView.LengthWorldToGui(SelectedArea.Length)); var rect = new System.Drawing.RectangleF(location.X, location.Y - size.Height, size.Width, size.Height); diff --git a/OpenNest/Controls/DrawControl.cs b/OpenNest/Controls/DrawControl.cs index 98ebaf6..3d9f2fc 100644 --- a/OpenNest/Controls/DrawControl.cs +++ b/OpenNest/Controls/DrawControl.cs @@ -205,7 +205,7 @@ namespace OpenNest.Controls public virtual void ZoomToArea(Box box, bool redraw = true) { - ZoomToArea(box.X, box.Y, box.Width, box.Height, redraw); + ZoomToArea(box.X, box.Y, box.Width, box.Length, redraw); } public virtual void ZoomToArea(double x, double y, double width, double height, bool redraw = true) diff --git a/OpenNest/Controls/PlateView.cs b/OpenNest/Controls/PlateView.cs index fd91a16..8bd6d5e 100644 --- a/OpenNest/Controls/PlateView.cs +++ b/OpenNest/Controls/PlateView.cs @@ -384,13 +384,13 @@ namespace OpenNest.Controls var plateRect = new RectangleF { Width = LengthWorldToGui(Plate.Size.Width), - Height = LengthWorldToGui(Plate.Size.Height) + Height = LengthWorldToGui(Plate.Size.Length) }; var edgeSpacingRect = new RectangleF { Width = LengthWorldToGui(Plate.Size.Width - Plate.EdgeSpacing.Left - Plate.EdgeSpacing.Right), - Height = LengthWorldToGui(Plate.Size.Height - Plate.EdgeSpacing.Top - Plate.EdgeSpacing.Bottom) + Height = LengthWorldToGui(Plate.Size.Length - Plate.EdgeSpacing.Top - Plate.EdgeSpacing.Bottom) }; switch (Plate.Quadrant) @@ -410,17 +410,17 @@ namespace OpenNest.Controls break; case 3: - plateRect.Location = PointWorldToGraph(-Plate.Size.Width, -Plate.Size.Height); + plateRect.Location = PointWorldToGraph(-Plate.Size.Width, -Plate.Size.Length); edgeSpacingRect.Location = PointWorldToGraph( Plate.EdgeSpacing.Left - Plate.Size.Width, - Plate.EdgeSpacing.Bottom - Plate.Size.Height); + Plate.EdgeSpacing.Bottom - Plate.Size.Length); break; case 4: - plateRect.Location = PointWorldToGraph(0, -Plate.Size.Height); + plateRect.Location = PointWorldToGraph(0, -Plate.Size.Length); edgeSpacingRect.Location = PointWorldToGraph( Plate.EdgeSpacing.Left, - Plate.EdgeSpacing.Bottom - Plate.Size.Height); + Plate.EdgeSpacing.Bottom - Plate.Size.Length); break; default: @@ -590,7 +590,7 @@ namespace OpenNest.Controls { Location = PointWorldToGraph(box.Location), Width = LengthWorldToGui(box.Width), - Height = LengthWorldToGui(box.Height) + Height = LengthWorldToGui(box.Length) }; g.DrawRectangle(ColorScheme.BoundingBoxPen, rect.X, rect.Y - rect.Height, rect.Width, rect.Height); diff --git a/OpenNest/Forms/BestFitViewerForm.cs b/OpenNest/Forms/BestFitViewerForm.cs index 8d1f438..2b52a4d 100644 --- a/OpenNest/Forms/BestFitViewerForm.cs +++ b/OpenNest/Forms/BestFitViewerForm.cs @@ -56,7 +56,7 @@ namespace OpenNest.Forms var sw = Stopwatch.StartNew(); var results = BestFitCache.GetOrCompute( - drawing, plate.Size.Width, plate.Size.Height, plate.PartSpacing); + drawing, plate.Size.Width, plate.Size.Length, plate.PartSpacing); var findMs = sw.ElapsedMilliseconds; var total = results.Count; diff --git a/OpenNest/Forms/EditNestInfoForm.cs b/OpenNest/Forms/EditNestInfoForm.cs index 1c9c950..5143fbf 100644 --- a/OpenNest/Forms/EditNestInfoForm.cs +++ b/OpenNest/Forms/EditNestInfoForm.cs @@ -173,7 +173,7 @@ namespace OpenNest.Forms return; } - if (TopSpacing + BottomSpacing >= size.Height) + if (TopSpacing + BottomSpacing >= size.Length) { applyButton.Enabled = false; return; diff --git a/OpenNest/Forms/EditPlateForm.cs b/OpenNest/Forms/EditPlateForm.cs index 4349cc5..1409a18 100644 --- a/OpenNest/Forms/EditPlateForm.cs +++ b/OpenNest/Forms/EditPlateForm.cs @@ -145,7 +145,7 @@ namespace OpenNest.Forms return; } - if (TopSpacing + BottomSpacing >= size.Height) + if (TopSpacing + BottomSpacing >= size.Length) { applyButton.Enabled = false; return; diff --git a/OpenNest/Forms/MainForm.cs b/OpenNest/Forms/MainForm.cs index 9a4341c..2cfeac9 100644 --- a/OpenNest/Forms/MainForm.cs +++ b/OpenNest/Forms/MainForm.cs @@ -43,8 +43,8 @@ namespace OpenNest.Forms UpdateStatus(); UpdateGpuStatus(); - if (GpuEvaluatorFactory.GpuAvailable) - BestFitCache.CreateEvaluator = (drawing, spacing) => GpuEvaluatorFactory.Create(drawing, spacing); + //if (GpuEvaluatorFactory.GpuAvailable) + // BestFitCache.CreateEvaluator = (drawing, spacing) => GpuEvaluatorFactory.Create(drawing, spacing); } private string GetNestName(DateTime date, int id)