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

DomCR / ACadSharp / 27296103586

10 Jun 2026 06:06PM UTC coverage: 77.029% (+0.03%) from 76.999%
27296103586

Pull #1105

github

web-flow
Merge fabaddbbc into 5027f0b2b
Pull Request #1105: Hatch explode

8744 of 12313 branches covered (71.01%)

Branch coverage included in aggregate %.

608 of 850 new or added lines in 12 files covered. (71.53%)

304 existing lines in 21 files now uncovered.

31490 of 39919 relevant lines covered (78.88%)

155672.14 hits per line

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

51.85
/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,786✔
18

19
                /// <summary>
20
                /// Pattern line base point.
21
                /// </summary>
22
                [DxfCodeValue(43, 44)]
23
                public XY BasePoint { get; set; }
190,159✔
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,996✔
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
38
                        {
124✔
39
                                double cos = Math.Cos(this.Angle);
124✔
40
                                double sin = Math.Sin(this.Angle);
124✔
41
                                return new XY(cos, sin);
124✔
42
                        }
124✔
43
                }
44

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

55
                                return this.Offset.X * sin + this.Offset.Y * cos;
80✔
56
                        }
80✔
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,795✔
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 TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc