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

DomCR / ACadSharp / 13723607028

07 Mar 2025 03:14PM UTC coverage: 75.346% (-0.8%) from 76.11%
13723607028

Pull #457

github

web-flow
Merge 1ebca662a into a1ba04cda
Pull Request #457: Geometric transform

5484 of 8001 branches covered (68.54%)

Branch coverage included in aggregate %.

150 of 519 new or added lines in 40 files covered. (28.9%)

283 existing lines in 12 files now uncovered.

21823 of 28241 relevant lines covered (77.27%)

74185.34 hits per line

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

59.18
/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,352✔
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,062✔
43

44
                /// <summary>
45
                /// The current elevation of the object.
46
                /// </summary>
47
                [DxfCodeValue(38)]
48
                public double Elevation { get; set; } = 0.0;
7,623✔
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,632✔
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,632✔
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,121✔
67

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

88
                /// <inheritdoc/>
89
                IEnumerable<IVertex> IPolyline.Vertices { get { return this.Vertices; } }
114✔
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
                {
1✔
100
                        if (this.Vertices.Count < 2)
1!
101
                        {
1✔
102
                                return BoundingBox.Null;
1✔
103
                        }
104

105
                        XYZ first = (XYZ)this.Vertices[0].Location;
×
106
                        XYZ second = (XYZ)this.Vertices[1].Location;
×
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));
×
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));
×
110

111
                        for (int i = 2; i < this.Vertices.Count; i++)
×
112
                        {
×
113
                                XYZ curr = (XYZ)this.Vertices[i].Location;
×
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));
×
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));
×
117
                        }
×
118

119
                        return new BoundingBox(min, max);
×
120
                }
1✔
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