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

DomCR / ACadSharp / 14214082189

02 Apr 2025 07:34AM UTC coverage: 75.523% (-0.8%) from 76.343%
14214082189

Pull #457

github

web-flow
Merge b2c68aa3f into 04434c5d6
Pull Request #457: Geometric transform

5606 of 8150 branches covered (68.79%)

Branch coverage included in aggregate %.

282 of 716 new or added lines in 47 files covered. (39.39%)

318 existing lines in 23 files now uncovered.

22348 of 28864 relevant lines covered (77.43%)

72757.24 hits per line

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

87.76
/src/ACadSharp/Entities/LwPolyLine.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using CSUtilities.Extensions;
4
using System;
5
using System.Collections.Generic;
6

7
namespace ACadSharp.Entities
8
{
9
        /// <summary>
10
        /// Represents a <see cref="LwPolyline"/> entity
11
        /// </summary>
12
        /// <remarks>
13
        /// Object name <see cref="DxfFileToken.EntityLwPolyline"/> <br/>
14
        /// Dxf class name <see cref="DxfSubclassMarker.LwPolyline"/>
15
        /// </remarks>
16
        [DxfName(DxfFileToken.EntityLwPolyline)]
17
        [DxfSubClass(DxfSubclassMarker.LwPolyline)]
18
        public partial class LwPolyline : Entity, IPolyline
19
        {
20
                /// <inheritdoc/>
21
                public override ObjectType ObjectType => ObjectType.LWPOLYLINE;
1✔
22

23
                /// <inheritdoc/>
24
                public override string ObjectName => DxfFileToken.EntityLwPolyline;
812✔
25

26
                /// <inheritdoc/>
27
                public override string SubclassMarker => DxfSubclassMarker.LwPolyline;
31,226✔
28

29
                /// <summary>
30
                /// Polyline flags.
31
                /// </summary>
32
                [DxfCodeValue(70)]
33
                public LwPolylineFlags Flags { get; set; }
9,363✔
34

35
                /// <summary>
36
                /// Constant width
37
                /// </summary>
38
                /// <remarks>
39
                /// Not used if variable width (codes 40 and/or 41) is set
40
                /// </remarks>
41
                [DxfCodeValue(43)]
42
                public double ConstantWidth { get; set; } = 0.0;
11,068✔
43

44
                /// <summary>
45
                /// The current elevation of the object.
46
                /// </summary>
47
                [DxfCodeValue(38)]
48
                public double Elevation { get; set; } = 0.0;
7,629✔
49

50
                /// <summary>
51
                /// Specifies the distance a 2D object is extruded above or below its elevation.
52
                /// </summary>
53
                [DxfCodeValue(39)]
54
                public double Thickness { get; set; } = 0.0;
7,638✔
55

56
                /// <summary>
57
                /// Specifies the three-dimensional normal unit vector for the object.
58
                /// </summary>
59
                [DxfCodeValue(210, 220, 230)]
60
                public XYZ Normal { get; set; } = XYZ.AxisZ;
7,638✔
61

62
                /// <summary>
63
                /// Vertices that form this LwPolyline
64
                /// </summary>
65
                [DxfCodeValue(DxfReferenceType.Count, 90)]
66
                public List<Vertex> Vertices { get; set; } = new List<Vertex>();
124,212✔
67

68
                /// <inheritdoc/>
69
                public bool IsClosed
70
                {
71
                        get
72
                        {
6✔
73
                                return this.Flags.HasFlag(LwPolylineFlags.Closed);
6✔
74
                        }
6✔
75
                        set
76
                        {
11✔
77
                                if (value)
11!
78
                                {
×
79
                                        this.Flags = this.Flags.AddFlag(LwPolylineFlags.Closed);
×
80
                                }
×
81
                                else
82
                                {
11✔
83
                                        this.Flags = this.Flags.RemoveFlag(LwPolylineFlags.Closed);
11✔
84
                                }
11✔
85
                        }
11✔
86
                }
87

88
                /// <inheritdoc/>
89
                IEnumerable<IVertex> IPolyline.Vertices { get { return this.Vertices; } }
132✔
90

91
                /// <inheritdoc/>
92
                public IEnumerable<Entity> Explode()
93
                {
3✔
94
                        return Polyline.Explode(this);
3✔
95
                }
3✔
96

97
                /// <inheritdoc/>
98
                public override BoundingBox GetBoundingBox()
99
                {
9✔
100
                        if (this.Vertices.Count < 2)
9✔
101
                        {
1✔
102
                                return BoundingBox.Null;
1✔
103
                        }
104

105
                        XYZ first = (XYZ)this.Vertices[0].Location;
8✔
106
                        XYZ second = (XYZ)this.Vertices[1].Location;
8✔
107

108
                        XYZ min = new XYZ(System.Math.Min(first.X, second.X), System.Math.Min(first.Y, second.Y), System.Math.Min(first.Z, second.Z));
8✔
109
                        XYZ max = new XYZ(System.Math.Max(first.X, second.X), System.Math.Max(first.Y, second.Y), System.Math.Max(first.Z, second.Z));
8✔
110

111
                        for (int i = 2; i < this.Vertices.Count; i++)
48✔
112
                        {
16✔
113
                                XYZ curr = (XYZ)this.Vertices[i].Location;
16✔
114

115
                                min = new XYZ(System.Math.Min(min.X, curr.X), System.Math.Min(min.Y, curr.Y), System.Math.Min(min.Z, curr.Z));
16✔
116
                                max = new XYZ(System.Math.Max(max.X, curr.X), System.Math.Max(max.Y, curr.Y), System.Math.Max(max.Z, curr.Z));
16✔
117
                        }
16✔
118

119
                        return new BoundingBox(min, max);
8✔
120
                }
9✔
121

122
                /// <inheritdoc/>
123
                public override void ApplyTransform(Transform transform)
NEW
124
                {
×
NEW
125
                        throw new NotImplementedException();
×
126
                }
127
        }
128
}
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