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

DomCR / ACadSharp / 29143042407

11 Jul 2026 06:34AM UTC coverage: 2.912% (-73.0%) from 75.918%
29143042407

push

github

web-flow
Merge pull request #1146 from ilCosmico/acds-read-payload-anchor

Read the AcDs payload area offset from the data segment header

264 of 12999 branches covered (2.03%)

Branch coverage included in aggregate %.

0 of 30 new or added lines in 1 file covered. (0.0%)

31243 existing lines in 465 files now uncovered.

1337 of 41984 relevant lines covered (3.18%)

5.38 hits per line

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

0.0
/src/ACadSharp/Entities/ModelerGeometry.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using System;
4
using System.Collections.Generic;
5
using System.Text;
6

7
namespace ACadSharp.Entities
8
{
9
        /// <summary>
10
        /// Represents a <see cref="ModelerGeometry"/> entity.
11
        /// </summary>
12
        [DxfSubClass(DxfSubclassMarker.ModelerGeometry)]
13
        public abstract partial class ModelerGeometry : Entity
14
        {
UNCOV
15
                public XYZ Point { get; set; }
×
16

UNCOV
17
                public List<Silhouette> Silhouettes { get; } = new();
×
18

19
                /// <inheritdoc/>
UNCOV
20
                public override string SubclassMarker => DxfSubclassMarker.ModelerGeometry;
×
21

UNCOV
22
                public List<Wire> Wires { get; } = new();
×
23

24
                [DxfCodeValue(2)]
UNCOV
25
                internal Guid Guid { get; set; }
×
26

27
                /// <summary>
28
                /// Gets or sets the modeler format version used in the drawing.
29
                /// </summary>
30
                [DxfCodeValue(70)]
UNCOV
31
                public short ModelerFormatVersion { get; set; }
×
32

33
                [DxfCodeValue(1)]
34
                //[DxfCodeValue(3)]
UNCOV
35
                public StringBuilder ProprietaryData { get; } = new();
×
36

37
                /// <summary>
38
                /// Raw ACIS payload that describes the geometry of this entity.
39
                /// </summary>
40
                /// <remarks>
41
                /// The payload is binary SAB when it starts with the "ACIS BinaryFile" signature
42
                /// (check <see cref="IsBinaryAcisData"/>), plain SAT text bytes otherwise.
43
                /// In R2013+ files the modeler geometry is stored apart from the entity
44
                /// (ACDSDATA section in DXF, AcDs data section in DWG) and this property is
45
                /// the only carrier of the geometry; older versions embed it in the entity
46
                /// itself.
47
                /// </remarks>
UNCOV
48
                public byte[] AcisData { get; set; }
×
49

50
                /// <summary>
51
                /// Flag that indicates if <see cref="AcisData"/> contains a binary SAB
52
                /// payload instead of SAT text.
53
                /// </summary>
54
                public bool IsBinaryAcisData
55
                {
56
                        get
UNCOV
57
                        {
×
UNCOV
58
                                if (this.AcisData == null || this.AcisData.Length < _acisBinarySignature.Length)
×
UNCOV
59
                                {
×
UNCOV
60
                                        return false;
×
61
                                }
62

UNCOV
63
                                for (int i = 0; i < _acisBinarySignature.Length; i++)
×
UNCOV
64
                                {
×
UNCOV
65
                                        if (this.AcisData[i] != _acisBinarySignature[i])
×
UNCOV
66
                                        {
×
UNCOV
67
                                                return false;
×
68
                                        }
UNCOV
69
                                }
×
70

UNCOV
71
                                return true;
×
UNCOV
72
                        }
×
73
                }
74

75
                /// <summary>
76
                /// Gets the SAT text carried by <see cref="AcisData"/>.
77
                /// </summary>
78
                /// <returns>The SAT content as a string, or null when the payload is empty or binary SAB.</returns>
79
                public string GetAcisText()
UNCOV
80
                {
×
UNCOV
81
                        if (this.AcisData == null || this.AcisData.Length == 0 || this.IsBinaryAcisData)
×
UNCOV
82
                        {
×
UNCOV
83
                                return null;
×
84
                        }
85

UNCOV
86
                        return Encoding.ASCII.GetString(this.AcisData);
×
UNCOV
87
                }
×
88

89
                //Signature that marks the start of a binary SAB payload
UNCOV
90
                private static readonly byte[] _acisBinarySignature = Encoding.ASCII.GetBytes("ACIS BinaryFile");
×
91

92
                /// <inheritdoc/>
93
                public override void ApplyTransform(Transform transform)
94
                {
×
95
                }
×
96

97
                /// <inheritdoc/>
98
                public override BoundingBox GetBoundingBox()
99
                {
×
100
                        return BoundingBox.Null;
×
101
                }
×
102
        }
103
}
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