From 241854e71b3afe3260ae8c198fc7f48b6216e81a Mon Sep 17 00:00:00 2001 From: DomCR Date: Mon, 4 Nov 2024 11:49:19 +0100 Subject: [PATCH 1/9] init --- src/ACadSharp.Pdf/Core/IO/PdfPen.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs index 0c72590..8b3ace4 100644 --- a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs +++ b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs @@ -3,6 +3,7 @@ using ACadSharp.Objects; using ACadSharp.Pdf.Extensions; using CSMath; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -45,6 +46,9 @@ public void DrawEntity(Entity entity, Transform transform) case Circle circle: this.drawCircle(circle, transform); break; + case Hatch hatch: + this.drawHatch(hatch, transform); + break; case Line line: this.drawLine(line, transform); break; @@ -63,6 +67,11 @@ public void DrawEntity(Entity entity, Transform transform) } } + private void drawHatch(Hatch hatch, Transform transform) + { + throw new NotImplementedException(); + } + public override string ToString() { return _sb.ToString(); From 0a094938eadb16cc64e4a0b21712a6d3195f65ed Mon Sep 17 00:00:00 2001 From: DomCR Date: Tue, 16 Jun 2026 08:40:54 +0200 Subject: [PATCH 2/9] Update ACadSharp submodule to latest commit Updated the ACadSharp submodule reference from f2f8e99 to adca68f2, bringing in the latest changes from the upstream repository. --- src/ACadSharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp b/src/ACadSharp index f2f8e99..adca68f 160000 --- a/src/ACadSharp +++ b/src/ACadSharp @@ -1 +1 @@ -Subproject commit f2f8e99ec34333b5ed184976b98f52571083a775 +Subproject commit adca68f217c5172fe041cbddd55a9d90e86ae835 From f6bf531921f491361733557dc5549c24cdcebbdf Mon Sep 17 00:00:00 2001 From: DomCR Date: Tue, 16 Jun 2026 08:42:04 +0200 Subject: [PATCH 3/9] mit year --- src/ACadSharp.Pdf/ACadSharp.Pdf.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 49477f09121058ddacd7f8f69af95c821525fa75 Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 17 Jun 2026 17:37:47 +0200 Subject: [PATCH 4/9] Implement hatch drawing in PdfPen and fix ToString Implemented the drawHatch method to explode hatch patterns and draw each resulting line entity. Removed the NotImplementedException. Updated ToString to use this._sb.ToString() for consistency. --- src/ACadSharp.Pdf/Core/IO/PdfPen.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs index 0716037..627fb03 100644 --- a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs +++ b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs @@ -91,12 +91,20 @@ public void DrawEntity(Entity entity, Transform transform) private void drawHatch(Hatch hatch, Transform transform) { - throw new NotImplementedException(); + 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) From c5bad39e1aaa29920d0523e99aa70eff7b675d77 Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 17 Jun 2026 18:05:13 +0200 Subject: [PATCH 5/9] submodules --- src/ACadSharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp b/src/ACadSharp index adca68f..8321bde 160000 --- a/src/ACadSharp +++ b/src/ACadSharp @@ -1 +1 @@ -Subproject commit adca68f217c5172fe041cbddd55a9d90e86ae835 +Subproject commit 8321bde8003ddf5fd8053caa970be3d67b3a801b From a5eac5cb03b077c0412b6a71d024c541dbae3932 Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 17 Jun 2026 19:26:36 +0200 Subject: [PATCH 6/9] submodule --- src/ACadSharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp b/src/ACadSharp index 8321bde..7f74a76 160000 --- a/src/ACadSharp +++ b/src/ACadSharp @@ -1 +1 @@ -Subproject commit 8321bde8003ddf5fd8053caa970be3d67b3a801b +Subproject commit 7f74a76c6c112a71c7eac2b23d6d146256c75d98 From f0fededf881edc79f8fecddd1a9021a82233c1c6 Mon Sep 17 00:00:00 2001 From: DomCR Date: Wed, 17 Jun 2026 19:29:39 +0200 Subject: [PATCH 7/9] Update rectangle drawing to use LengthX and LengthY Replaced box.Width and box.Height with box.LengthX and box.LengthY when drawing rectangles using appendArray and PdfKey.Rectangle for improved accuracy and consistency. --- src/ACadSharp.Pdf/Core/IO/PdfPen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs index 627fb03..f39c5ea 100644 --- a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs +++ b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs @@ -311,13 +311,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(); From 15dea0c5daf100f1527f64468e5182294edd48ab Mon Sep 17 00:00:00 2001 From: DomCR Date: Sat, 20 Jun 2026 18:32:50 +0200 Subject: [PATCH 8/9] Update ACadSharp submodule to latest commit Updated the ACadSharp submodule reference from 7f74a76c6c1 to e34847eb8302, pointing to a newer version of the submodule. This brings in the latest changes and improvements from the ACadSharp repository. --- src/ACadSharp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp b/src/ACadSharp index 7f74a76..e34847e 160000 --- a/src/ACadSharp +++ b/src/ACadSharp @@ -1 +1 @@ -Subproject commit 7f74a76c6c112a71c7eac2b23d6d146256c75d98 +Subproject commit e34847eb83028f470ce917018b722e3560578a87 From 43b0e1fdc395fff2761bcaa73c8158765506dce8 Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 17 Sep 2026 08:49:21 +0200 Subject: [PATCH 9/9] save --- src/ACadSharp.Pdf/Core/IO/PdfPen.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs index f39c5ea..d96b123 100644 --- a/src/ACadSharp.Pdf/Core/IO/PdfPen.cs +++ b/src/ACadSharp.Pdf/Core/IO/PdfPen.cs @@ -93,7 +93,6 @@ private void drawHatch(Hatch hatch, Transform transform) { var lines = hatch.ExplodePattern(); - foreach (var line in lines) { this.DrawEntity(line, transform);