@mlightcad/geometry-engine 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/geometry-engine.js +10186 -0
  4. package/dist/geometry-engine.umd.cjs +4 -0
  5. package/lib/geometry/AcGeArea2d.d.ts +61 -0
  6. package/lib/geometry/AcGeArea2d.d.ts.map +1 -0
  7. package/lib/geometry/AcGeArea2d.js +174 -0
  8. package/lib/geometry/AcGeArea2d.js.map +1 -0
  9. package/lib/geometry/AcGeCircArc2d.d.ts +108 -0
  10. package/lib/geometry/AcGeCircArc2d.d.ts.map +1 -0
  11. package/lib/geometry/AcGeCircArc2d.js +412 -0
  12. package/lib/geometry/AcGeCircArc2d.js.map +1 -0
  13. package/lib/geometry/AcGeCircArc3d.d.ts +138 -0
  14. package/lib/geometry/AcGeCircArc3d.d.ts.map +1 -0
  15. package/lib/geometry/AcGeCircArc3d.js +447 -0
  16. package/lib/geometry/AcGeCircArc3d.js.map +1 -0
  17. package/lib/geometry/AcGeCurve2d.d.ts +85 -0
  18. package/lib/geometry/AcGeCurve2d.d.ts.map +1 -0
  19. package/lib/geometry/AcGeCurve2d.js +213 -0
  20. package/lib/geometry/AcGeCurve2d.js.map +1 -0
  21. package/lib/geometry/AcGeCurve3d.d.ts +27 -0
  22. package/lib/geometry/AcGeCurve3d.d.ts.map +1 -0
  23. package/lib/geometry/AcGeCurve3d.js +29 -0
  24. package/lib/geometry/AcGeCurve3d.js.map +1 -0
  25. package/lib/geometry/AcGeEllipseArc2d.d.ts +105 -0
  26. package/lib/geometry/AcGeEllipseArc2d.d.ts.map +1 -0
  27. package/lib/geometry/AcGeEllipseArc2d.js +292 -0
  28. package/lib/geometry/AcGeEllipseArc2d.js.map +1 -0
  29. package/lib/geometry/AcGeEllipseArc3d.d.ts +141 -0
  30. package/lib/geometry/AcGeEllipseArc3d.d.ts.map +1 -0
  31. package/lib/geometry/AcGeEllipseArc3d.js +442 -0
  32. package/lib/geometry/AcGeEllipseArc3d.js.map +1 -0
  33. package/lib/geometry/AcGeLine2d.d.ts +56 -0
  34. package/lib/geometry/AcGeLine2d.d.ts.map +1 -0
  35. package/lib/geometry/AcGeLine2d.js +125 -0
  36. package/lib/geometry/AcGeLine2d.js.map +1 -0
  37. package/lib/geometry/AcGeLine3d.d.ts +134 -0
  38. package/lib/geometry/AcGeLine3d.d.ts.map +1 -0
  39. package/lib/geometry/AcGeLine3d.js +291 -0
  40. package/lib/geometry/AcGeLine3d.js.map +1 -0
  41. package/lib/geometry/AcGeLoop2d.d.ts +59 -0
  42. package/lib/geometry/AcGeLoop2d.d.ts.map +1 -0
  43. package/lib/geometry/AcGeLoop2d.js +141 -0
  44. package/lib/geometry/AcGeLoop2d.js.map +1 -0
  45. package/lib/geometry/AcGePolyline2d.d.ts +90 -0
  46. package/lib/geometry/AcGePolyline2d.d.ts.map +1 -0
  47. package/lib/geometry/AcGePolyline2d.js +224 -0
  48. package/lib/geometry/AcGePolyline2d.js.map +1 -0
  49. package/lib/geometry/AcGeShape.d.ts +12 -0
  50. package/lib/geometry/AcGeShape.d.ts.map +1 -0
  51. package/lib/geometry/AcGeShape.js +22 -0
  52. package/lib/geometry/AcGeShape.js.map +1 -0
  53. package/lib/geometry/AcGeShape2d.d.ts +31 -0
  54. package/lib/geometry/AcGeShape2d.d.ts.map +1 -0
  55. package/lib/geometry/AcGeShape2d.js +51 -0
  56. package/lib/geometry/AcGeShape2d.js.map +1 -0
  57. package/lib/geometry/AcGeShape3d.d.ts +33 -0
  58. package/lib/geometry/AcGeShape3d.d.ts.map +1 -0
  59. package/lib/geometry/AcGeShape3d.js +52 -0
  60. package/lib/geometry/AcGeShape3d.js.map +1 -0
  61. package/lib/geometry/AcGeSpline3d.d.ts +77 -0
  62. package/lib/geometry/AcGeSpline3d.d.ts.map +1 -0
  63. package/lib/geometry/AcGeSpline3d.js +221 -0
  64. package/lib/geometry/AcGeSpline3d.js.map +1 -0
  65. package/lib/geometry/index.d.ts +13 -0
  66. package/lib/geometry/index.d.ts.map +1 -0
  67. package/lib/geometry/index.js +13 -0
  68. package/lib/geometry/index.js.map +1 -0
  69. package/lib/index.d.ts +4 -0
  70. package/lib/index.d.ts.map +1 -0
  71. package/lib/index.js +4 -0
  72. package/lib/index.js.map +1 -0
  73. package/lib/math/AcGeBox2d.d.ts +173 -0
  74. package/lib/math/AcGeBox2d.d.ts.map +1 -0
  75. package/lib/math/AcGeBox2d.js +289 -0
  76. package/lib/math/AcGeBox2d.js.map +1 -0
  77. package/lib/math/AcGeBox3d.d.ts +195 -0
  78. package/lib/math/AcGeBox3d.d.ts.map +1 -0
  79. package/lib/math/AcGeBox3d.js +378 -0
  80. package/lib/math/AcGeBox3d.js.map +1 -0
  81. package/lib/math/AcGeEuler.d.ts +133 -0
  82. package/lib/math/AcGeEuler.d.ts.map +1 -0
  83. package/lib/math/AcGeEuler.js +358 -0
  84. package/lib/math/AcGeEuler.js.map +1 -0
  85. package/lib/math/AcGeMatrix2d.d.ts +203 -0
  86. package/lib/math/AcGeMatrix2d.d.ts.map +1 -0
  87. package/lib/math/AcGeMatrix2d.js +393 -0
  88. package/lib/math/AcGeMatrix2d.js.map +1 -0
  89. package/lib/math/AcGeMatrix3d.d.ts +279 -0
  90. package/lib/math/AcGeMatrix3d.d.ts.map +1 -0
  91. package/lib/math/AcGeMatrix3d.js +1037 -0
  92. package/lib/math/AcGeMatrix3d.js.map +1 -0
  93. package/lib/math/AcGePlane.d.ts +131 -0
  94. package/lib/math/AcGePlane.d.ts.map +1 -0
  95. package/lib/math/AcGePlane.js +218 -0
  96. package/lib/math/AcGePlane.js.map +1 -0
  97. package/lib/math/AcGePoint.d.ts +4 -0
  98. package/lib/math/AcGePoint.d.ts.map +1 -0
  99. package/lib/math/AcGePoint.js +2 -0
  100. package/lib/math/AcGePoint.js.map +1 -0
  101. package/lib/math/AcGePoint2d.d.ts +17 -0
  102. package/lib/math/AcGePoint2d.d.ts.map +1 -0
  103. package/lib/math/AcGePoint2d.js +40 -0
  104. package/lib/math/AcGePoint2d.js.map +1 -0
  105. package/lib/math/AcGePoint3d.d.ts +18 -0
  106. package/lib/math/AcGePoint3d.d.ts.map +1 -0
  107. package/lib/math/AcGePoint3d.js +43 -0
  108. package/lib/math/AcGePoint3d.js.map +1 -0
  109. package/lib/math/AcGeQuaternion.d.ts +230 -0
  110. package/lib/math/AcGeQuaternion.d.ts.map +1 -0
  111. package/lib/math/AcGeQuaternion.js +666 -0
  112. package/lib/math/AcGeQuaternion.js.map +1 -0
  113. package/lib/math/AcGeVector.d.ts +9 -0
  114. package/lib/math/AcGeVector.d.ts.map +1 -0
  115. package/lib/math/AcGeVector.js +2 -0
  116. package/lib/math/AcGeVector.js.map +1 -0
  117. package/lib/math/AcGeVector2d.d.ts +361 -0
  118. package/lib/math/AcGeVector2d.d.ts.map +1 -0
  119. package/lib/math/AcGeVector2d.js +622 -0
  120. package/lib/math/AcGeVector2d.js.map +1 -0
  121. package/lib/math/AcGeVector3d.d.ts +493 -0
  122. package/lib/math/AcGeVector3d.d.ts.map +1 -0
  123. package/lib/math/AcGeVector3d.js +868 -0
  124. package/lib/math/AcGeVector3d.js.map +1 -0
  125. package/lib/math/index.d.ts +14 -0
  126. package/lib/math/index.d.ts.map +1 -0
  127. package/lib/math/index.js +14 -0
  128. package/lib/math/index.js.map +1 -0
  129. package/lib/util/AcGeConstants.d.ts +19 -0
  130. package/lib/util/AcGeConstants.d.ts.map +1 -0
  131. package/lib/util/AcGeConstants.js +25 -0
  132. package/lib/util/AcGeConstants.js.map +1 -0
  133. package/lib/util/AcGeGeometryUtil.d.ts +16 -0
  134. package/lib/util/AcGeGeometryUtil.d.ts.map +1 -0
  135. package/lib/util/AcGeGeometryUtil.js +56 -0
  136. package/lib/util/AcGeGeometryUtil.js.map +1 -0
  137. package/lib/util/AcGeMathUtil.d.ts +203 -0
  138. package/lib/util/AcGeMathUtil.d.ts.map +1 -0
  139. package/lib/util/AcGeMathUtil.js +585 -0
  140. package/lib/util/AcGeMathUtil.js.map +1 -0
  141. package/lib/util/AcGeTol.d.ts +91 -0
  142. package/lib/util/AcGeTol.d.ts.map +1 -0
  143. package/lib/util/AcGeTol.js +83 -0
  144. package/lib/util/AcGeTol.js.map +1 -0
  145. package/lib/util/index.d.ts +5 -0
  146. package/lib/util/index.d.ts.map +1 -0
  147. package/lib/util/index.js +5 -0
  148. package/lib/util/index.js.map +1 -0
  149. package/package.json +42 -0
@@ -0,0 +1,213 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { AcGePoint2d } from '../math/AcGePoint2d';
17
+ import { AcGeShape2d } from './AcGeShape2d';
18
+ /**
19
+ * Abstract base class for all 2d curves. Any class that is derived from this class represents
20
+ * a 2d curve.
21
+ */
22
+ var AcGeCurve2d = /** @class */ (function (_super) {
23
+ __extends(AcGeCurve2d, _super);
24
+ function AcGeCurve2d() {
25
+ var _this = _super.call(this) || this;
26
+ _this.arcLengthDivisions = 100;
27
+ return _this;
28
+ }
29
+ Object.defineProperty(AcGeCurve2d.prototype, "startPoint", {
30
+ /**
31
+ * Start point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates
32
+ * of end point.
33
+ */
34
+ get: function () {
35
+ return this.getPoint(0);
36
+ },
37
+ enumerable: false,
38
+ configurable: true
39
+ });
40
+ Object.defineProperty(AcGeCurve2d.prototype, "endPoint", {
41
+ /**
42
+ * End point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates
43
+ * of end point.
44
+ */
45
+ get: function () {
46
+ return this.getPoint(1);
47
+ },
48
+ enumerable: false,
49
+ configurable: true
50
+ });
51
+ Object.defineProperty(AcGeCurve2d.prototype, "length", {
52
+ /**
53
+ * Length of this curve.
54
+ */
55
+ get: function () {
56
+ return this.getLength();
57
+ },
58
+ enumerable: false,
59
+ configurable: true
60
+ });
61
+ /**
62
+ * Return the point for a given position on the curve according to the arc length.
63
+ * @param t Input a position on the curve according to the arc length. Must be in the range [0, 1].
64
+ * @returns Return the point for a given position on the curve according to the arc length.
65
+ */
66
+ AcGeCurve2d.prototype.getPoint = function (_t) {
67
+ throw new Error('AcGeCurve2d: .getPoint() not implemented.');
68
+ };
69
+ /**
70
+ * Return a point for a given position on the curve according to the arc length.
71
+ * @param u Input a position on the curve according to the arc length. Must be in the range [0, 1].
72
+ * @returns Return a point for a given position on the curve according to the arc length.
73
+ */
74
+ AcGeCurve2d.prototype.getPointAt = function (u) {
75
+ var t = this.getUtoTmapping(u);
76
+ return this.getPoint(t);
77
+ };
78
+ /**
79
+ * Return a set of divisions + 1 points using `getPoint(t)`.
80
+ * @param divisions Input number of pieces to divide the curve into. Default is 5.
81
+ * @returns Return a set of divisions + 1 points using `getPoint(t)`
82
+ */
83
+ AcGeCurve2d.prototype.getPoints = function (divisions) {
84
+ if (divisions === void 0) { divisions = 5; }
85
+ var points = [];
86
+ for (var d = 0; d <= divisions; d++) {
87
+ points.push(this.getPoint(d / divisions));
88
+ }
89
+ return points;
90
+ };
91
+ /**
92
+ * Return a set of divisions + 1 equi-spaced points using `getPointAt(u)`.
93
+ * @param divisions Input number of pieces to divide the curve into. Default is 5.
94
+ * @returns Return a set of divisions + 1 equi-spaced points using `getPointAt(u)`.
95
+ */
96
+ AcGeCurve2d.prototype.getSpacedPoints = function (divisions) {
97
+ if (divisions === void 0) { divisions = 5; }
98
+ var points = [];
99
+ for (var d = 0; d <= divisions; d++) {
100
+ points.push(this.getPointAt(d / divisions));
101
+ }
102
+ return points;
103
+ };
104
+ /**
105
+ * Get total curve arc length.
106
+ * @returns Return total curve arc length.
107
+ */
108
+ AcGeCurve2d.prototype.getLength = function () {
109
+ var lengths = this.getLengths();
110
+ return lengths[lengths.length - 1];
111
+ };
112
+ /**
113
+ * Get list of cumulative segment lengths.
114
+ * @param divisions Input number of pieces to divide the curve into.
115
+ * @returns Return list of cumulative segment lengths.
116
+ */
117
+ AcGeCurve2d.prototype.getLengths = function (divisions) {
118
+ if (divisions === void 0) { divisions = this.arcLengthDivisions; }
119
+ var cache = [];
120
+ var current, last = this.getPoint(0);
121
+ var sum = 0;
122
+ cache.push(0);
123
+ for (var p = 1; p <= divisions; p++) {
124
+ current = this.getPoint(p / divisions);
125
+ sum += current.distanceTo(last);
126
+ cache.push(sum);
127
+ last = current;
128
+ }
129
+ return cache;
130
+ };
131
+ /**
132
+ * Given `u` in the range (0 .. 1), returns t also in the range ( 0 .. 1 ). `u` and `t` can then be used to
133
+ * give you points which are equidistant from the ends of the curve, using `getPoint`.
134
+ */
135
+ AcGeCurve2d.prototype.getUtoTmapping = function (u, distance) {
136
+ var arcLengths = this.getLengths();
137
+ var i = 0;
138
+ var il = arcLengths.length;
139
+ var targetArcLength; // The targeted u distance value to get
140
+ if (distance) {
141
+ targetArcLength = distance;
142
+ }
143
+ else {
144
+ targetArcLength = u * arcLengths[il - 1];
145
+ }
146
+ // binary search for the index with largest value smaller than target u distance
147
+ var low = 0, high = il - 1, comparison;
148
+ while (low <= high) {
149
+ i = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats
150
+ comparison = arcLengths[i] - targetArcLength;
151
+ if (comparison < 0) {
152
+ low = i + 1;
153
+ }
154
+ else if (comparison > 0) {
155
+ high = i - 1;
156
+ }
157
+ else {
158
+ high = i;
159
+ break;
160
+ // DONE
161
+ }
162
+ }
163
+ i = high;
164
+ if (arcLengths[i] === targetArcLength) {
165
+ return i / (il - 1);
166
+ }
167
+ // we could get finer grain at lengths, or use simple interpolation between two points
168
+ var lengthBefore = arcLengths[i];
169
+ var lengthAfter = arcLengths[i + 1];
170
+ var segmentLength = lengthAfter - lengthBefore;
171
+ // determine where we are between the 'before' and 'after' points
172
+ var segmentFraction = (targetArcLength - lengthBefore) / segmentLength;
173
+ // add that fractional amount to t
174
+ var t = (i + segmentFraction) / (il - 1);
175
+ return t;
176
+ };
177
+ /**
178
+ * Return a unit vector tangent at `t`. If the derived curve does not implement its tangent derivation,
179
+ * two points a small delta apart will be used to find its gradient which seems to give a reasonable
180
+ * approximation.
181
+ * @param t Input a position on the curve. Must be in the range [ 0, 1 ].
182
+ * @returns Return a unit vector tangent at `t`.
183
+ */
184
+ AcGeCurve2d.prototype.getTangent = function (t) {
185
+ var delta = 0.0001;
186
+ var t1 = t - delta;
187
+ var t2 = t + delta;
188
+ // Capping in case of danger
189
+ if (t1 < 0)
190
+ t1 = 0;
191
+ if (t2 > 1)
192
+ t2 = 1;
193
+ var pt1 = this.getPoint(t1);
194
+ var pt2 = this.getPoint(t2);
195
+ var tangent = new AcGePoint2d();
196
+ tangent.copy(pt2).sub(pt1).normalize();
197
+ return tangent;
198
+ };
199
+ /**
200
+ * Return tangent at a point which is equidistant to the ends of the curve from the point given in
201
+ * `getTangent`.
202
+ * @param u Input a position on the curve according to the arc length. Must be in the range [0, 1].
203
+ * @returns Return tangent at a point which is equidistant to the ends of the curve from the point
204
+ * given in `getTangent`.
205
+ */
206
+ AcGeCurve2d.prototype.getTangentAt = function (u) {
207
+ var t = this.getUtoTmapping(u);
208
+ return this.getTangent(t);
209
+ };
210
+ return AcGeCurve2d;
211
+ }(AcGeShape2d));
212
+ export { AcGeCurve2d };
213
+ //# sourceMappingURL=AcGeCurve2d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcGeCurve2d.js","sourceRoot":"","sources":["../../src/geometry/A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+ * Abstract base class for all 3d curves. Any class that is derived from this class represents
5
+ * a 3d curve.
6
+ */
7
+ export declare abstract class AcGeCurve3d extends AcGeShape3d {
8
+ /**
9
+ * Return true if its start point is identical to its end point. Otherwise, return false.
10
+ */
11
+ abstract get closed(): boolean;
12
+ /**
13
+ * Start point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates
14
+ * of end point.
15
+ */
16
+ abstract get startPoint(): AcGePoint3d;
17
+ /**
18
+ * End point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates
19
+ * of end point.
20
+ */
21
+ abstract get endPoint(): AcGePoint3d;
22
+ /**
23
+ * Length of this curve.
24
+ */
25
+ abstract get length(): number;
26
+ }
27
+ //# sourceMappingURL=AcGeCurve3d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcGeCurve3d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeCurve3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;GAGG;AACH,8BAAsB,WAAY,SAAQ,WAAW;IACnD;;OAEG;IACH,QAAQ,KAAK,MAAM,IAAI,OAAO,CAAA;IAE9B;;;OAGG;IACH,QAAQ,KAAK,UAAU,IAAI,WAAW,CAAA;IAEtC;;;OAGG;IACH,QAAQ,KAAK,QAAQ,IAAI,WAAW,CAAA;IAEpC;;OAEG;IACH,QAAQ,KAAK,MAAM,IAAI,MAAM,CAAA;CAC9B"}
@@ -0,0 +1,29 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { AcGeShape3d } from './AcGeShape3d';
17
+ /**
18
+ * Abstract base class for all 3d curves. Any class that is derived from this class represents
19
+ * a 3d curve.
20
+ */
21
+ var AcGeCurve3d = /** @class */ (function (_super) {
22
+ __extends(AcGeCurve3d, _super);
23
+ function AcGeCurve3d() {
24
+ return _super !== null && _super.apply(this, arguments) || this;
25
+ }
26
+ return AcGeCurve3d;
27
+ }(AcGeShape3d));
28
+ export { AcGeCurve3d };
29
+ //# sourceMappingURL=AcGeCurve3d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcGeCurve3d.js","sourceRoot":"","sources":["../../src/geometry/AcGeCurve3d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;GAGG;AACH;IAA0C,+BAAW;IAArD;;IAsBA,CAAC;IAAD,kBAAC;AAAD,CAAC,AAtBD,CAA0C,WAAW,GAsBpD"}
@@ -0,0 +1,105 @@
1
+ import { AcGeBox2d, AcGeMatrix2d, AcGePoint2d, AcGePoint3d, AcGePointLike } from '../math';
2
+ import { AcGeCurve2d } from './AcGeCurve2d';
3
+ /**
4
+ * Class representing a 3d ellipse arc defined by center, normal, majorAxis, majorAxisRadius,
5
+ * minorAxisRadius, startAngle, and endAngle.
6
+ * - The majorAxis vector represents half the major axis of the ellipse (that is, from the center
7
+ * point to the start point of the ellipse) and is the zero angle for startAngle and endAngle.
8
+ * - Positive angles are counter-clockwise when looking down the normal vector (that is, right-hand
9
+ * rule). A startAngle of 0 and endAngle of 2pi will produce a closed Ellipse.
10
+ * - If startAngle is equal to 0 and endAngle is equal to 2 * Math.PI, it represents a full 3d ellipse.
11
+ */
12
+ export declare class AcGeEllipseArc2d extends AcGeCurve2d {
13
+ private _center;
14
+ private _majorAxisRadius;
15
+ private _minorAxisRadius;
16
+ private _startAngle;
17
+ private _endAngle;
18
+ private _clockwise;
19
+ private _rotation;
20
+ /**
21
+ * Construct an instance of the ellipse arc.
22
+ * @param center Center point of the ellipse.
23
+ * @param majorAxisRadius Major axis radius of the ellipse.
24
+ * @param minorAxisRadius Minor axis radius of the ellipse.
25
+ * @param startAngle Start angle of the ellipse arc in radians.
26
+ * @param endAngle End angle of the ellipse arc in radians.
27
+ * @param clockwise The flag Whether the ellipse arc is drawn clockwise. Default is false.
28
+ * @param rotation The rotation angle of the ellipse in radians, counterclockwise from the positive X
29
+ * axis (optional). Default is 0.
30
+ */
31
+ constructor(center: AcGePointLike, majorAxisRadius: number, minorAxisRadius: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number);
32
+ /**
33
+ * Center of the ellipse in 3d space
34
+ */
35
+ get center(): AcGePoint3d;
36
+ set center(value: AcGePointLike);
37
+ /**
38
+ * Major axis radius of the ellipse
39
+ */
40
+ get majorAxisRadius(): number;
41
+ set majorAxisRadius(value: number);
42
+ /**
43
+ * Minor axis radius of the ellipse
44
+ */
45
+ get minorAxisRadius(): number;
46
+ set minorAxisRadius(value: number);
47
+ /**
48
+ * Start angle of the ellipse arc in radians in the range -pi to pi.
49
+ */
50
+ get startAngle(): number;
51
+ set startAngle(value: number);
52
+ /**
53
+ * End angle of the ellipse arc in radians in the range -pi to pi.
54
+ */
55
+ get endAngle(): number;
56
+ set endAngle(value: number);
57
+ /**
58
+ * The flag Whether the ellipse arc is drawn clockwise. Default is false.
59
+ */
60
+ get clockwise(): boolean;
61
+ set clockwise(value: boolean);
62
+ /**
63
+ * The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional).
64
+ * Default is 0.
65
+ */
66
+ get rotation(): number;
67
+ set rotation(value: number);
68
+ /**
69
+ * Return angle between endAngle and startAngle in range 0 to 2*PI
70
+ */
71
+ get deltaAngle(): number;
72
+ /**
73
+ * Return true if the arc is a large arc whose delta angle value is greater than PI.
74
+ */
75
+ get isLargeArc(): 0 | 1;
76
+ /**
77
+ * Compute the bounding box of the 3D ellipse arc.
78
+ * The bounding box is defined by its minimum and maximum x, y, and z coordinates.
79
+ * @returns Return bounding box containing the min and max coordinates
80
+ */
81
+ calculateBoundingBox(): AcGeBox2d;
82
+ /**
83
+ * Return true if its start point is identical to its end point. Otherwise, return false.
84
+ */
85
+ get closed(): boolean;
86
+ /**
87
+ * Return the point for a given position on the curve according to the arc length.
88
+ * @param t Input a position on the curve according to the arc length. Must be in the range [ 0, 1 ].
89
+ * @returns Return the point for a given position on the curve according to the arc length.
90
+ */
91
+ getPoint(t: number): AcGePoint2d;
92
+ /**
93
+ * @inheritdoc
94
+ */
95
+ transform(_matrix: AcGeMatrix2d): this;
96
+ /**
97
+ * @inheritdoc
98
+ */
99
+ copy(value: AcGeEllipseArc2d): this;
100
+ /**
101
+ * @inheritdoc
102
+ */
103
+ clone(): AcGeEllipseArc2d;
104
+ }
105
+ //# sourceMappingURL=AcGeEllipseArc2d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcGeEllipseArc2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeEllipseArc2d.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAE/C,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,UAAU,CAAU;IAG5B,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;;;;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