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

DomCR / ACadSharp / 17809288271

17 Sep 2025 08:03PM UTC coverage: 78.387% (-0.04%) from 78.424%
17809288271

Pull #795

github

web-flow
Merge 65195f5ec into 8a4aed335
Pull Request #795: Polyface mesh clone fix

6674 of 9251 branches covered (72.14%)

Branch coverage included in aggregate %.

2 of 3 new or added lines in 2 files covered. (66.67%)

13 existing lines in 3 files now uncovered.

25851 of 32242 relevant lines covered (80.18%)

108734.53 hits per line

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

72.97
/src/ACadSharp/Entities/PolyfaceMesh.cs
1
using ACadSharp.Attributes;
2
using System;
3
using System.Collections.Generic;
4

5
namespace ACadSharp.Entities
6
{
7
        /// <summary>
8
        /// Represents a <see cref="PolyfaceMesh"/> entity.
9
        /// </summary>
10
        /// <remarks>
11
        /// Object name <see cref="DxfFileToken.EntityPolyline"/> <br/>
12
        /// Dxf class name <see cref="DxfSubclassMarker.PolyfaceMesh"/>
13
        /// </remarks>
14
        [DxfName(DxfFileToken.EntityPolyline)]
15
        [DxfSubClass(DxfSubclassMarker.PolyfaceMesh)]
16
        public class PolyfaceMesh : Polyline
17
        {
18
                /// <inheritdoc/>
19
                public override ObjectType ObjectType { get { return ObjectType.POLYLINE_PFACE; } }
3✔
20

21
                /// <inheritdoc/>
22
                public override string ObjectName => DxfFileToken.EntityPolyline;
975✔
23

24
                /// <inheritdoc/>
25
                public override string SubclassMarker => DxfSubclassMarker.PolyfaceMesh;
484✔
26

27
                /// <summary>
28
                /// Face records with the triangle indexes.
29
                /// </summary>
30
                public CadObjectCollection<VertexFaceRecord> Faces { get; private set; }
1,473✔
31

32
                /// <inheritdoc/>
33
                public PolyfaceMesh() : base()
367✔
34
                {
367✔
35
                        this.Faces = new CadObjectCollection<VertexFaceRecord>(this);
367✔
36
                }
367✔
37

38
                /// <inheritdoc/>
39
                public override IEnumerable<Entity> Explode()
40
                {
×
41
                        throw new System.NotImplementedException();
×
42
                }
43

44
                /// <inheritdoc/>
45
                public override CadObject Clone()
46
                {
3✔
47
                        PolyfaceMesh clone = (PolyfaceMesh)base.Clone();
3✔
48

49
                        clone.Faces = new SeqendCollection<VertexFaceRecord>(clone);
3✔
50
                        foreach (VertexFaceRecord v in this.Faces)
9!
51
                        {
×
NEW
52
                                clone.Faces.Add((VertexFaceRecord)v.Clone());
×
53
                        }
×
54

55
                        return clone;
3✔
56
                }
3✔
57

58
                protected override void verticesOnAdd(object sender, CollectionChangedEventArgs e)
59
                {
1,745✔
60
                        if (e.Item is not VertexFaceMesh)
1,745!
61
                        {
×
62
                                this.Vertices.Remove((Vertex)e.Item);
×
63
                                throw new ArgumentException($"Wrong vertex type {e.Item.SubclassMarker} for {this.SubclassMarker}");
×
64
                        }
65
                }
1,745✔
66

67
                internal override void AssignDocument(CadDocument doc)
68
                {
376✔
69
                        base.AssignDocument(doc);
376✔
70
                        doc.RegisterCollection(this.Faces);
376✔
71
                }
376✔
72

73
                internal override void UnassignDocument()
74
                {
26✔
75
                        this.Document.UnregisterCollection(this.Faces);
26✔
76
                        base.UnassignDocument();
26✔
77
                }
26✔
78
        }
79
}
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