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

DomCR / ACadSharp / 16263272139

14 Jul 2025 09:33AM UTC coverage: 75.046% (+0.03%) from 75.014%
16263272139

Pull #710

github

web-flow
Merge b348803a5 into 9d213afc7
Pull Request #710: dimension reference points

5861 of 8589 branches covered (68.24%)

Branch coverage included in aggregate %.

49 of 58 new or added lines in 7 files covered. (84.48%)

4 existing lines in 3 files now uncovered.

23308 of 30279 relevant lines covered (76.98%)

81438.94 hits per line

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

85.0
/src/ACadSharp/Entities/DimensionLinear.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using System;
4

5
namespace ACadSharp.Entities
6
{
7
        /// <summary>
8
        /// Represents a <see cref="DimensionLinear"/> entity.
9
        /// </summary>
10
        /// <remarks>
11
        /// Object name <see cref="DxfFileToken.EntityDimension"/> <br/>
12
        /// Dxf class name <see cref="DxfSubclassMarker.LinearDimension"/>
13
        /// </remarks>
14
        [DxfName(DxfFileToken.EntityDimension)]
15
        [DxfSubClass(DxfSubclassMarker.LinearDimension)]
16
        public class DimensionLinear : DimensionAligned
17
        {
18
                /// <inheritdoc/>
19
                public override double Measurement
20
                {
21
                        get
22
                        {
48✔
23
                                var angle = new XYZ(System.Math.Cos(this.Rotation), System.Math.Sin(this.Rotation), 0.0);
48✔
24
                                double dot = Math.Abs(angle.Dot((this.SecondPoint - this.FirstPoint).Normalize()));
48✔
25
                                return base.Measurement * dot;
48✔
26
                        }
48✔
27
                }
28

29
                /// <inheritdoc/>
30
                public override string ObjectName => DxfFileToken.EntityDimension;
1,741✔
31

32
                /// <inheritdoc/>
33
                public override ObjectType ObjectType => ObjectType.DIMENSION_LINEAR;
17✔
34

35
                /// <inheritdoc/>
36
                public override double Offset
37
                {
38
                        get
NEW
39
                        {
×
NEW
40
                                return base.Offset;
×
NEW
41
                        }
×
42
                        set
43
                        {
15✔
44
                                var transform = Transform.CreateRotation(this.Normal, this.Rotation);
15✔
45
                                XYZ axisY = transform.ApplyTransform(XYZ.AxisY).Normalize();
15✔
46

47
                                this.DefinitionPoint = this.SecondPoint + axisY * value;
15✔
48
                        }
15✔
49
                }
50

51
                /// <summary>
52
                /// Angle of rotated, horizontal, or vertical dimensions.
53
                /// </summary>
54
                /// <value>
55
                /// Value in radians.
56
                /// </value>
57
                [DxfCodeValue(DxfReferenceType.IsAngle, 50)]
58
                public double Rotation { get; set; }
860✔
59

60
                /// <inheritdoc/>
61
                public override string SubclassMarker => DxfSubclassMarker.LinearDimension;
2✔
62

63
                /// <inheritdoc/>
64
                public DimensionLinear() : base(DimensionType.Linear)
693✔
65
                {
693✔
66
                }
693✔
67
        }
68
}
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

© 2025 Coveralls, Inc