Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,7 @@ MigrationBackup/

# Custom
/samples/out/

# Temporal files
*.dwl
*.dwl2
Binary file modified samples/export_sample.dwg
Binary file not shown.
Empty file removed samples/export_sample.pdf
Empty file.
2 changes: 1 addition & 1 deletion src/ACadSharp
Submodule ACadSharp updated 328 files
4 changes: 2 additions & 2 deletions src/ACadSharp.Pdf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ACadSharp.Pdf/ACadSharp.Pdf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/DomCR/ACadSharp.Pdf</PackageProjectUrl>
<Copyright>Copyright (c) 2024 Albert Domenech</Copyright>
<Copyright>Copyright (c) 2026 Albert Domenech</Copyright>
<Description>Library to generate Pdf files from dwg and dxf files read by ACadSharp.</Description>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">True</GeneratePackageOnBuild>
</PropertyGroup>
Expand Down
21 changes: 18 additions & 3 deletions src/ACadSharp.Pdf/Core/IO/PdfPen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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();
Expand Down
Loading