mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-25 14:01:07 -04:00
fix(report): display stock dimensions as width by length
This commit is contained in:
1 parent
ef6ca80e6d
commit
afa50c5a12
4 files changed
+6
-4
No files matched your search
@@ -532,7 +532,7 @@ public static class NestPdfWriter
|
||||
snapshot.Thickness > 0 ? $"{Number(snapshot.Thickness)} {snapshot.Units}" : "Not specified";
|
||||
|
||||
private static string SheetSize(NestReportSnapshot snapshot, ReportPlate plate) =>
|
||||
$"{Number(plate.Bounds.Length)} x {Number(plate.Bounds.Width)} {snapshot.Units}";
|
||||
$"{Number(plate.Bounds.Width)} x {Number(plate.Bounds.Length)} {snapshot.Units}";
|
||||
|
||||
private static string Number(double value) => value.ToString("0.####", Invariant);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public sealed class NestPdfLayoutTests : IDisposable
|
||||
Assert.Matches(@"R002\s+Rotated\s+1\s+3\s+0\s+2\s+1, 3", summary);
|
||||
Assert.Matches(@"R003\s+Bracket\s+7\s+3\s+4\s+0\s+1, 3", summary);
|
||||
Assert.Matches(@"R004\s+Unplaced\s+3\s+0\s+3\s+0\s+-", summary);
|
||||
Assert.Matches(@"3\s+60 x 30 in\s+1\s+2", summary);
|
||||
Assert.Matches(@"3\s+30 x 60 in\s+1\s+2", summary);
|
||||
for (var plate = 1; plate <= 4; plate++)
|
||||
{
|
||||
var page = pages[plate];
|
||||
@@ -143,7 +143,7 @@ public sealed class NestPdfLayoutTests : IDisposable
|
||||
Assert.Equal(5, pages.Length);
|
||||
Assert.Contains("millimeters (mm)", pages[0]);
|
||||
Assert.Contains("3 mm", pages[0]);
|
||||
Assert.Matches(@"48 x 24 mm", pages[2]);
|
||||
Assert.Matches(@"24 x 48 mm", pages[2]);
|
||||
using var pdf = PdfReader.Open(path, PdfDocumentOpenMode.Import);
|
||||
var stream = ReportPdf.ContentStreams(pdf.Pages[1]).Last();
|
||||
stream = stream[(stream.IndexOf("W* n", StringComparison.Ordinal) + 4)..];
|
||||
|
||||
@@ -47,7 +47,7 @@ public sealed class NestPdfWriterTests : IDisposable
|
||||
Assert.Contains("2026-09-29 12:00 +00:00", summary);
|
||||
Assert.Matches(@"Distinct layouts:\s+1", summary);
|
||||
Assert.Matches(@"Total physical sheets:\s+2", summary);
|
||||
Assert.Matches(@"1\s+48 x 24 in\s+2\s+4\s+\d+\.\d%", summary);
|
||||
Assert.Matches(@"1\s+24 x 48 in\s+2\s+4\s+\d+\.\d%", summary);
|
||||
Assert.Matches(@"R001\s+Bracket\s+5\s+4\s+1\s+0\s+1", summary);
|
||||
Assert.Matches(@"R002\s+Rotated\s+1\s+2\s+0\s+1\s+1", summary);
|
||||
Assert.Matches(@"R003\s+Bracket\s+7\s+2\s+5\s+0\s+1", summary);
|
||||
|
||||
@@ -54,6 +54,8 @@ each plate's part table across pages with the heading row repeated, and notes
|
||||
flow as an ordinary paragraph. No row, table or note text is ever dropped or
|
||||
truncated to fit a page.
|
||||
|
||||
Stock sizes read **width x length** in job units.
|
||||
|
||||
Each part ID is centered on its part's pole of inaccessibility (`PolyLabel`,
|
||||
the same method `PlateView`'s `LayoutPart` uses), computed on a
|
||||
placement-independent quantized copy so identical parts always get the
|
||||
|
||||
Reference in new issue
Block a user