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

DomCR / ACadSharp / 16285634917

15 Jul 2025 06:16AM UTC coverage: 75.087% (+0.05%) from 75.034%
16285634917

Pull #559

github

web-flow
Merge 8083a9183 into 87b78fd03
Pull Request #559: Issue 557 dimension block

5943 of 8713 branches covered (68.21%)

Branch coverage included in aggregate %.

288 of 389 new or added lines in 14 files covered. (74.04%)

13 existing lines in 3 files now uncovered.

23654 of 30704 relevant lines covered (77.04%)

80317.09 hits per line

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

77.78
/src/ACadSharp/Entities/DimensionAngular2Line.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using CSMath.Geometry;
4

5
namespace ACadSharp.Entities
6
{
7
        /// <summary>
8
        /// Represents a <see cref="DimensionAngular2Line"/> entity.
9
        /// </summary>
10
        /// <remarks>
11
        /// Object name <see cref="DxfFileToken.EntityDimension"/> <br/>
12
        /// Dxf class name <see cref="DxfSubclassMarker.Angular2LineDimension"/>
13
        /// </remarks>
14
        [DxfName(DxfFileToken.EntityDimension)]
15
        [DxfSubClass(DxfSubclassMarker.Angular2LineDimension)]
16
        public class DimensionAngular2Line : Dimension
17
        {
18
                /// <summary>
19
                /// Definition point for diameter, radius, and angular dimensions (in WCS).
20
                /// </summary>
21
                [DxfCodeValue(15, 25, 35)]
22
                public XYZ AngleVertex { get; set; }
1,604✔
23

24
                /// <summary>
25
                /// Point defining dimension arc for angular dimensions (in OCS).
26
                /// </summary>
27
                [DxfCodeValue(16, 26, 36)]
28
                public XYZ DimensionArc { get; set; }
1,556✔
29

30
                /// <summary>
31
                /// Definition point for linear and angular dimensions (in WCS).
32
                /// </summary>
33
                [DxfCodeValue(13, 23, 33)]
34
                public XYZ FirstPoint { get; set; }
1,618✔
35

36
                /// <inheritdoc/>
37
                public override double Measurement
38
                {
39
                        get
40
                        {
40✔
41
                                XY v1 = (XY)(this.SecondPoint - this.FirstPoint);
40✔
42
                                XY v2 = (XY)(this.DefinitionPoint - this.AngleVertex);
40✔
43

44
                                return v1.AngleBetweenVectors(v2);
40✔
45
                        }
40✔
46
                }
47

48
                /// <summary>
49
                /// Gets the center point of the measured arc.
50
                /// </summary>
51
                public XYZ Center
52
                {
53
                        get
54
                        {
1✔
55
                                Line3D l1 = LineExtensions.CreateFromPoints<Line3D, XYZ>(this.DefinitionPoint, this.AngleVertex);
1✔
56
                                Line3D l2 = LineExtensions.CreateFromPoints<Line3D, XYZ>(this.FirstPoint, this.SecondPoint);
1✔
57

58
                                return l1.FindIntersection(l2);
1✔
59
                        }
1✔
60
                }
61

62
                /// <summary>
63
                /// Definition point offset relative to the <see cref="Center"/>.
64
                /// </summary>
65
                public virtual double Offset
66
                {
UNCOV
67
                        get { return this.SecondPoint.DistanceFrom(this.DefinitionPoint); }
×
68
                        set
69
                        {
13✔
70
                                XYZ dir = this.SecondPoint - this.FirstPoint;
13✔
71
                                XYZ v = XYZ.Cross(this.Normal, dir).Normalize(); //Perpendicular to SecondPoint
13✔
72

73
                                this.DefinitionPoint = this.SecondPoint + v * value;
13✔
74
                        }
13✔
75
                }
76

77
                /// <inheritdoc/>
78
                public override string ObjectName => DxfFileToken.EntityDimension;
849✔
79

80
                /// <inheritdoc/>
81
                public override ObjectType ObjectType => ObjectType.DIMENSION_ANG_2_Ln;
17✔
82

83
                /// <summary>
84
                /// Definition point for linear and angular dimensions (in WCS).
85
                /// </summary>
86
                [DxfCodeValue(14, 24, 34)]
87
                public XYZ SecondPoint { get; set; }
1,631✔
88

89
                /// <inheritdoc/>
90
                public override string SubclassMarker => DxfSubclassMarker.Angular2LineDimension;
2,738✔
91

92
                /// <summary>
93
                /// Default constructor.
94
                /// </summary>
95
                public DimensionAngular2Line() : base(DimensionType.Angular)
393✔
96
                {
393✔
97
                }
393✔
98

99
                /// <inheritdoc/>
100
                public override void ApplyTransform(Transform transform)
101
                {
×
102
                        base.ApplyTransform(transform);
×
103

104
                        this.FirstPoint = transform.ApplyTransform(this.FirstPoint);
×
105
                        this.SecondPoint = transform.ApplyTransform(this.SecondPoint);
×
106
                        this.AngleVertex = transform.ApplyTransform(this.AngleVertex);
×
107
                        this.DimensionArc = transform.ApplyTransform(this.DimensionArc);
×
108
                }
×
109

110
                /// <inheritdoc/>
111
                public override BoundingBox GetBoundingBox()
112
                {
1✔
113
                        return new BoundingBox(this.FirstPoint, this.SecondPoint);
1✔
114
                }
1✔
115
        }
116
}
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