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

DomCR / ACadSharp / 17737836230

15 Sep 2025 03:12PM UTC coverage: 2.092% (-76.2%) from 78.245%
17737836230

push

github

web-flow
Merge pull request #790 from DomCR/addflag-refactor

addflag refactor

141 of 9225 branches covered (1.53%)

Branch coverage included in aggregate %.

0 of 93 new or added lines in 10 files covered. (0.0%)

24910 existing lines in 372 files now uncovered.

724 of 32119 relevant lines covered (2.25%)

5.76 hits per line

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

0.0
/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)]
UNCOV
22
                public XYZ AngleVertex { get; set; }
×
23

24
                /// <summary>
25
                /// Gets the center point of the measured arc.
26
                /// </summary>
27
                public XYZ Center
28
                {
29
                        get
UNCOV
30
                        {
×
UNCOV
31
                                Line3D l1 = LineExtensions.CreateFromPoints<Line3D, XYZ>(this.DefinitionPoint, this.AngleVertex);
×
UNCOV
32
                                Line3D l2 = LineExtensions.CreateFromPoints<Line3D, XYZ>(this.FirstPoint, this.SecondPoint);
×
33

UNCOV
34
                                return l1.FindIntersection(l2);
×
UNCOV
35
                        }
×
36
                }
37

38
                /// <summary>
39
                /// Point defining dimension arc for angular dimensions (in OCS).
40
                /// </summary>
41
                [DxfCodeValue(16, 26, 36)]
UNCOV
42
                public XYZ DimensionArc { get; set; }
×
43

44
                /// <summary>
45
                /// Definition point for linear and angular dimensions (in WCS).
46
                /// </summary>
47
                [DxfCodeValue(13, 23, 33)]
UNCOV
48
                public XYZ FirstPoint { get; set; }
×
49

50
                /// <inheritdoc/>
51
                public override double Measurement
52
                {
53
                        get
UNCOV
54
                        {
×
UNCOV
55
                                var v1 = this.SecondPoint - this.FirstPoint;
×
UNCOV
56
                                var v2 = this.DefinitionPoint - this.AngleVertex;
×
57

UNCOV
58
                                return v1.AngleBetweenVectors(v2);
×
UNCOV
59
                        }
×
60
                }
61

62
                /// <inheritdoc/>
UNCOV
63
                public override string ObjectName => DxfFileToken.EntityDimension;
×
64

65
                /// <inheritdoc/>
UNCOV
66
                public override ObjectType ObjectType => ObjectType.DIMENSION_ANG_2_Ln;
×
67

68
                /// <summary>
69
                /// Definition point offset relative to the <see cref="Center"/>.
70
                /// </summary>
71
                public virtual double Offset
72
                {
73
                        get { return this.SecondPoint.DistanceFrom(this.DefinitionPoint); }
×
74
                        set
UNCOV
75
                        {
×
UNCOV
76
                                XYZ dir = this.SecondPoint - this.FirstPoint;
×
UNCOV
77
                                XYZ v = XYZ.Cross(this.Normal, dir).Normalize(); //Perpendicular to SecondPoint
×
78

UNCOV
79
                                this.DefinitionPoint = this.SecondPoint + v * value;
×
UNCOV
80
                        }
×
81
                }
82

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

89
                /// <inheritdoc/>
UNCOV
90
                public override string SubclassMarker => DxfSubclassMarker.Angular2LineDimension;
×
91

92
                /// <summary>
93
                /// Default constructor.
94
                /// </summary>
UNCOV
95
                public DimensionAngular2Line() : base(DimensionType.Angular)
×
UNCOV
96
                {
×
UNCOV
97
                }
×
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()
UNCOV
112
                {
×
UNCOV
113
                        return new BoundingBox(this.FirstPoint, this.SecondPoint);
×
UNCOV
114
                }
×
115

116
                /// <inheritdoc/>
117
                /// <remarks>
118
                /// For <see cref="DimensionAngular2Line"/> the generation of the block is not yet implemented.
119
                /// </remarks>
120
                public override void UpdateBlock()
UNCOV
121
                {
×
122
                        //Needs a lot more investigation
UNCOV
123
                        return;
×
124

125
                        base.UpdateBlock();
126

127
                        var v1 = this.SecondPoint - this.FirstPoint;
128
                        var v2 = this.DefinitionPoint - this.AngleVertex;
129

130
                        this._block.Entities.Add(createDefinitionPoint(FirstPoint));
131
                        this._block.Entities.Add(createDefinitionPoint(SecondPoint));
132
                        this._block.Entities.Add(createDefinitionPoint(AngleVertex));
133
                        this._block.Entities.Add(createDefinitionPoint(DefinitionPoint));
134

135
                        if (this.Center.IsNaN())
136
                        {
137
                                return;
138
                        }
139

140
                        var startAngle = XYZ.AxisX.AngleBetweenVectors(this.AngleVertex);
141
                        var endAngle = XYZ.AxisX.AngleBetweenVectors(this.FirstPoint);
142

143
                        this._block.Entities.Add(new Arc(this.Center, this.Offset, startAngle, endAngle));
UNCOV
144
                }
×
145
        }
146
}
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