• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 27019790767

05 Jun 2026 02:09PM UTC coverage: 76.573% (-0.4%) from 76.999%
27019790767

Pull #1105

github

web-flow
Merge b11aedac1 into 2addb6ad2
Pull Request #1105: Hatch explode

8653 of 12269 branches covered (70.53%)

Branch coverage included in aggregate %.

350 of 644 new or added lines in 10 files covered. (54.35%)

78 existing lines in 14 files now uncovered.

31223 of 39807 relevant lines covered (78.44%)

156015.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/src/ACadSharp/Entities/HatchPattern.Line.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using CSMath.Geometry;
4
using System;
5
using System.Collections.Generic;
6

7
namespace ACadSharp.Entities;
8

9
public partial class HatchPattern
10
{
11
        public class Line
12
        {
13
                /// <summary>
14
                /// Pattern line angle.
15
                /// </summary>
16
                [DxfCodeValue(DxfReferenceType.IsAngle, 53)]
17
                public double Angle { get; set; }
199,510✔
18

19
                /// <summary>
20
                /// Pattern line base point.
21
                /// </summary>
22
                [DxfCodeValue(43, 44)]
23
                public XY BasePoint { get; set; }
190,103✔
24

25
                /// <summary>
26
                /// Line dashes.
27
                /// </summary>
28
                [DxfCodeValue(DxfReferenceType.Count, 79)]
29
                [DxfCollectionCodeValue(49)]
30
                public List<double> DashLengths { get; set; } = new List<double>();
540,982✔
31

32
                /// <summary>
33
                /// Gets the direction vector of the pattern line based on the specified angle.
34
                /// </summary>
35
                public XY Direction
36
                {
37
                        get
UNCOV
38
                        {
×
NEW
39
                                double cos = Math.Cos(this.Angle);
×
NEW
40
                                double sin = Math.Sin(this.Angle);
×
NEW
41
                                return new XY(cos, sin);
×
UNCOV
42
                        }
×
43
                }
44

45
                /// <summary>
46
                /// Perpendicular distance for the next line to be located.
47
                /// </summary>
48
                public double LineOffset
49
                {
50
                        get
51
                        {
68✔
52
                                double cos = Math.Cos(0.0 - this.Angle);
68✔
53
                                double sin = Math.Sin(0.0 - this.Angle);
68✔
54

55
                                return this.Offset.X * sin + this.Offset.Y * cos;
68✔
56
                        }
68✔
57
                }
58

59
                /// <summary>
60
                /// Gets or sets the local displacements between lines of the same family.
61
                /// </summary>
62
                [DxfCodeValue(45, 46)]
63
                public XY Offset { get; set; }
303,723✔
64

65
                /// <summary>
66
                /// Gets the horizontal shift of the offset after applying the specified angle transformation.
67
                /// </summary>
68
                public double Shift
69
                {
70
                        get
71
                        {
×
NEW
72
                                double cos = Math.Cos(0.0 - this.Angle);
×
NEW
73
                                double sin = Math.Sin(0.0 - this.Angle);
×
74

NEW
75
                                return this.Offset.X * cos - this.Offset.Y * sin;
×
UNCOV
76
                        }
×
77
                }
78

79
                /// <summary>
80
                /// Clones this line.
81
                /// </summary>
82
                /// <returns></returns>
83
                public Line Clone()
NEW
84
                {
×
NEW
85
                        Line clone = (Line)this.MemberwiseClone();
×
NEW
86
                        clone.DashLengths = new List<double>(this.DashLengths);
×
NEW
87
                        return clone;
×
NEW
88
                }
×
89

90
                public Line2D ToLine2D()
NEW
91
                {
×
NEW
92
                        return new Line2D(this.BasePoint, this.Direction);
×
NEW
93
                }
×
94
        }
95
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc