Skip to content

Commit

Permalink
Merge pull request #505 from DomCR/issue-504_hatchpattern-lineangle-n…
Browse files Browse the repository at this point in the history
…-offset-public

issue 504
  • Loading branch information
DomCR authored Dec 14, 2024
2 parents 33bd2fc + c900a9f commit 319dba0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 31 deletions.
39 changes: 39 additions & 0 deletions src/ACadSharp/Entities/HatchPattern.Line.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using ACadSharp.Attributes;
using CSMath;
using System.Collections.Generic;

namespace ACadSharp.Entities
{
public partial class HatchPattern
{
public class Line
{
/// <summary>
/// Pattern line angle
/// </summary>
[DxfCodeValue(DxfReferenceType.IsAngle, 53)]
public double Angle { get; set; }

/// <summary>
/// Pattern line base point
/// </summary>
[DxfCodeValue(43, 44)]
public XY BasePoint { get; set; }

/// <summary>
/// Pattern line offset
/// </summary>
[DxfCodeValue(45, 46)]
public XY Offset { get; set; }

public List<double> DashLengths { get; set; } = new List<double>();

public Line Clone()
{
Line clone = (Line)this.MemberwiseClone();
clone.DashLengths = new List<double>(this.DashLengths);
return clone;
}
}
}
}
32 changes: 1 addition & 31 deletions src/ACadSharp/Entities/HatchPattern.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,10 @@

namespace ACadSharp.Entities
{
public class HatchPattern
public partial class HatchPattern
{
public static HatchPattern Solid { get { return new HatchPattern("SOLID"); } }

public class Line
{
/// <summary>
/// Pattern line angle
/// </summary>
[DxfCodeValue(DxfReferenceType.IsAngle, 53)]
public double Angle { get; internal set; }

/// <summary>
/// Pattern line base point
/// </summary>
[DxfCodeValue(43, 44)]
public XY BasePoint { get; internal set; }

/// <summary>
/// Pattern line offset
/// </summary>
[DxfCodeValue(45, 46)]
public XY Offset { get; internal set; }

public List<double> DashLengths { get; set; } = new List<double>();

public Line Clone()
{
Line clone = (Line)this.MemberwiseClone();
clone.DashLengths = new List<double>(this.DashLengths);
return clone;
}
}

[DxfCodeValue(2)]
public string Name { get; set; }

Expand Down

0 comments on commit 319dba0

Please sign in to comment.