diff --git a/.gitignore b/.gitignore index 42980d2..ba3fcdf 100644 --- a/.gitignore +++ b/.gitignore @@ -351,3 +351,7 @@ MigrationBackup/ # Custom /samples/out/ + +# Temporal files +*.dwl +*.dwl2 diff --git a/samples/export_sample.dwg b/samples/export_sample.dwg index c2f66c6..b1f9aed 100644 Binary files a/samples/export_sample.dwg and b/samples/export_sample.dwg differ diff --git a/samples/export_sample.pdf b/samples/export_sample.pdf deleted file mode 100644 index e69de29..0000000 diff --git a/src/ACadSharp b/src/ACadSharp index f2f8e99..e34847e 160000 --- a/src/ACadSharp +++ b/src/ACadSharp @@ -1 +1 @@ -Subproject commit f2f8e99ec34333b5ed184976b98f52571083a775 +Subproject commit e34847eb83028f470ce917018b722e3560578a87 diff --git a/src/ACadSharp.Pdf.sln b/src/ACadSharp.Pdf.sln index a00b1b3..d2f879c 100644 --- a/src/ACadSharp.Pdf.sln +++ b/src/ACadSharp.Pdf.sln @@ -26,10 +26,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{78F0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{52E48994-8A32-45F5-BB03-1D578AD6457E}" ProjectSection(SolutionItems) = preProject - ..\.github\workflows\coveralls.yml = ..\.github\workflows\coveralls.yml ..\.github\workflows\auto-version.yml = ..\.github\workflows\auto-version.yml - ..\.github\workflows\publish.yml = ..\.github\workflows\publish.yml + ..\.github\workflows\coveralls.yml = ..\.github\workflows\coveralls.yml ..\.github\workflows\csharp.yml = ..\.github\workflows\csharp.yml + ..\.github\workflows\publish.yml = ..\.github\workflows\publish.yml ..\.github\workflows\wiki-gen.yml = ..\.github\workflows\wiki-gen.yml EndProjectSection EndProject diff --git a/src/ACadSharp.Pdf/ACadSharp.Pdf.csproj b/src/ACadSharp.Pdf/ACadSharp.Pdf.csproj index 1740a88..af36f77 100644 --- a/src/ACadSharp.Pdf/ACadSharp.Pdf.csproj +++ b/src/ACadSharp.Pdf/ACadSharp.Pdf.csproj @@ -9,7 +9,7 @@ MIT git https://github.com/DomCR/ACadSharp.Pdf - Copyright (c) 2024 Albert Domenech + Copyright (c) 2026 Albert Domenech Library to generate Pdf files from dwg and dxf files read by ACadSharp. True diff --git a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs index 43a67d6..d96b123 100644 --- a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs +++ b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs @@ -63,6 +63,9 @@ public void DrawEntity(Entity entity, Transform transform) case Ellipse ellipse: this.drawEllpise(ellipse, transform); break; + case Hatch hatch: + this.drawHatch(hatch, transform); + break; case Line line: this.drawLine(line, transform); break; @@ -86,9 +89,21 @@ public void DrawEntity(Entity entity, Transform transform) this.writeEntityEnd(entity); } + private void drawHatch(Hatch hatch, Transform transform) + { + var lines = hatch.ExplodePattern(); + + foreach (var line in lines) + { + this.DrawEntity(line, transform); + } + + //throw new NotImplementedException(); + } + public override string ToString() { - return _sb.ToString(); + return this._sb.ToString(); } private void appendArray(string key, params double[] arr) @@ -295,13 +310,13 @@ private void drawViewport(Viewport viewport) this._sb.AppendLine(PdfKey.Stroke); //Draw rectangle - this.appendArray(PdfKey.Rectangle, box.Min.X, box.Min.Y, box.Width, box.Height); + this.appendArray(PdfKey.Rectangle, box.Min.X, box.Min.Y, box.LengthX, box.LengthY); this._sb.AppendLine(PdfKey.Stroke); //Limit viewport view this._sb.AppendLine(PdfKey.StackStart); - this.appendArray(PdfKey.Rectangle, box.Min.X, box.Min.Y, box.Width, box.Height); + this.appendArray(PdfKey.Rectangle, box.Min.X, box.Min.Y, box.LengthX, box.LengthY); this._sb.AppendLine("W n"); var modelBox = viewport.GetModelBoundingBox();