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

DomCR / ACadSharp / 14236523766

03 Apr 2025 06:34AM UTC coverage: 76.047% (-0.3%) from 76.343%
14236523766

Pull #525

github

web-flow
Merge 2c17d6670 into 04434c5d6
Pull Request #525: Issue-524 Explode Hatch

5581 of 8048 branches covered (69.35%)

Branch coverage included in aggregate %.

6 of 126 new or added lines in 17 files covered. (4.76%)

12 existing lines in 6 files now uncovered.

22069 of 28311 relevant lines covered (77.95%)

74168.99 hits per line

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

0.0
/src/ACadSharp/Entities/Hatch.BoundaryPath.Spline.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using CSUtilities.Extensions;
4
using System.Collections.Generic;
5
using System.Linq;
6

7
namespace ACadSharp.Entities
8
{
9
        public partial class Hatch
10
        {
11
                public partial class BoundaryPath
12
                {
13
                        public class Spline : Edge
14
                        {
15
                                /// <inheritdoc/>
16
                                public override EdgeType Type => EdgeType.Spline;
×
17

18
                                /// <summary>
19
                                /// Degree.
20
                                /// </summary>
21
                                [DxfCodeValue(94)]
22
                                public int Degree { get; set; }
×
23

24
                                /// <summary>
25
                                /// Rational.
26
                                /// </summary>
27
                                [DxfCodeValue(73)]
28
                                public bool Rational { get; set; }
×
29

30
                                /// <summary>
31
                                /// Periodic.
32
                                /// </summary>
33
                                [DxfCodeValue(74)]
34
                                public bool Periodic { get; set; }
×
35

36
                                /// <summary>
37
                                /// Number of knots.
38
                                /// </summary>
39
                                [DxfCodeValue(95)]
40
                                public List<double> Knots { get; set; } = new List<double>();
×
41

42
                                /// <remarks>
43
                                /// Position values are only X and Y, Z represents the weight.
44
                                /// </remarks>
45
                                [DxfCodeValue(96)]
46
                                //42        Weights(optional, default = 1)        ??
47
                                public List<XYZ> ControlPoints { get; set; } = new List<XYZ>();
×
48

49
                                /// <remarks>
50
                                /// Number of fit data.
51
                                /// </remarks>
52
                                [DxfCodeValue(97)]
53
                                public List<XY> FitPoints { get; set; } = new List<XY>();
×
54

55
                                /// <summary>
56
                                /// Start tangent.
57
                                /// </summary>
58
                                [DxfCodeValue(12, 22)]
59
                                public XY StartTangent { get; set; }
×
60

61
                                /// <summary>
62
                                /// End tangent.
63
                                /// </summary>
64
                                [DxfCodeValue(13, 23)]
65
                                public XY EndTangent { get; set; }
×
66

67
                                /// <inheritdoc/>
68
                                public override Entity ToEntity()
NEW
69
                                {
×
NEW
70
                                        Entities.Spline spline = new();
×
71
                                        
NEW
72
                                        spline.Degree = this.Degree;
×
NEW
73
                                        spline.Flags = this.Periodic ? spline.Flags.AddFlag(SplineFlags.Periodic) : spline.Flags;
×
NEW
74
                                        spline.Flags = this.Rational ? spline.Flags.AddFlag(SplineFlags.Rational) : spline.Flags;
×
75
                                        
NEW
76
                                        spline.StartTangent = this.StartTangent.Convert<XYZ>();
×
NEW
77
                                        spline.EndTangent = this.EndTangent.Convert<XYZ>();
×
78

NEW
79
                                        spline.ControlPoints.AddRange(this.ControlPoints);
×
NEW
80
                                        spline.Weights.AddRange(this.ControlPoints.Select(x => x.Z));
×
NEW
81
                                        spline.FitPoints.AddRange(this.FitPoints.Select(x => x.Convert<XYZ>()));
×
82

NEW
83
                                        return spline;
×
NEW
84
                                }
×
85

86
                                /// <inheritdoc/>
87
                                public override BoundingBox GetBoundingBox()
88
                                {
×
89
                                        return BoundingBox.FromPoints(this.ControlPoints);
×
90
                                }
×
91
                        }
92
                }
93
        }
94
}
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