@mlightcad/geometry-engine 3.0.3 → 3.0.4

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 (159) hide show
  1. package/package.json +2 -2
  2. package/dist/geometry-engine.js +0 -10702
  3. package/dist/geometry-engine.umd.cjs +0 -4
  4. package/lib/geometry/AcGeArea2d.d.ts +0 -61
  5. package/lib/geometry/AcGeArea2d.d.ts.map +0 -1
  6. package/lib/geometry/AcGeArea2d.js +0 -174
  7. package/lib/geometry/AcGeArea2d.js.map +0 -1
  8. package/lib/geometry/AcGeCatmullRomCurve3d.d.ts +0 -146
  9. package/lib/geometry/AcGeCatmullRomCurve3d.d.ts.map +0 -1
  10. package/lib/geometry/AcGeCatmullRomCurve3d.js +0 -358
  11. package/lib/geometry/AcGeCatmullRomCurve3d.js.map +0 -1
  12. package/lib/geometry/AcGeCircArc2d.d.ts +0 -132
  13. package/lib/geometry/AcGeCircArc2d.d.ts.map +0 -1
  14. package/lib/geometry/AcGeCircArc2d.js +0 -473
  15. package/lib/geometry/AcGeCircArc2d.js.map +0 -1
  16. package/lib/geometry/AcGeCircArc3d.d.ts +0 -138
  17. package/lib/geometry/AcGeCircArc3d.d.ts.map +0 -1
  18. package/lib/geometry/AcGeCircArc3d.js +0 -447
  19. package/lib/geometry/AcGeCircArc3d.js.map +0 -1
  20. package/lib/geometry/AcGeCurve2d.d.ts +0 -85
  21. package/lib/geometry/AcGeCurve2d.d.ts.map +0 -1
  22. package/lib/geometry/AcGeCurve2d.js +0 -213
  23. package/lib/geometry/AcGeCurve2d.js.map +0 -1
  24. package/lib/geometry/AcGeCurve3d.d.ts +0 -27
  25. package/lib/geometry/AcGeCurve3d.d.ts.map +0 -1
  26. package/lib/geometry/AcGeCurve3d.js +0 -29
  27. package/lib/geometry/AcGeCurve3d.js.map +0 -1
  28. package/lib/geometry/AcGeEllipseArc2d.d.ts +0 -105
  29. package/lib/geometry/AcGeEllipseArc2d.d.ts.map +0 -1
  30. package/lib/geometry/AcGeEllipseArc2d.js +0 -292
  31. package/lib/geometry/AcGeEllipseArc2d.js.map +0 -1
  32. package/lib/geometry/AcGeEllipseArc3d.d.ts +0 -142
  33. package/lib/geometry/AcGeEllipseArc3d.d.ts.map +0 -1
  34. package/lib/geometry/AcGeEllipseArc3d.js +0 -459
  35. package/lib/geometry/AcGeEllipseArc3d.js.map +0 -1
  36. package/lib/geometry/AcGeLine2d.d.ts +0 -56
  37. package/lib/geometry/AcGeLine2d.d.ts.map +0 -1
  38. package/lib/geometry/AcGeLine2d.js +0 -125
  39. package/lib/geometry/AcGeLine2d.js.map +0 -1
  40. package/lib/geometry/AcGeLine3d.d.ts +0 -134
  41. package/lib/geometry/AcGeLine3d.d.ts.map +0 -1
  42. package/lib/geometry/AcGeLine3d.js +0 -291
  43. package/lib/geometry/AcGeLine3d.js.map +0 -1
  44. package/lib/geometry/AcGeLoop2d.d.ts +0 -59
  45. package/lib/geometry/AcGeLoop2d.d.ts.map +0 -1
  46. package/lib/geometry/AcGeLoop2d.js +0 -141
  47. package/lib/geometry/AcGeLoop2d.js.map +0 -1
  48. package/lib/geometry/AcGeNurbsCurve.d.ts +0 -73
  49. package/lib/geometry/AcGeNurbsCurve.d.ts.map +0 -1
  50. package/lib/geometry/AcGeNurbsCurve.js +0 -172
  51. package/lib/geometry/AcGeNurbsCurve.js.map +0 -1
  52. package/lib/geometry/AcGePolyline2d.d.ts +0 -90
  53. package/lib/geometry/AcGePolyline2d.d.ts.map +0 -1
  54. package/lib/geometry/AcGePolyline2d.js +0 -224
  55. package/lib/geometry/AcGePolyline2d.js.map +0 -1
  56. package/lib/geometry/AcGeShape.d.ts +0 -12
  57. package/lib/geometry/AcGeShape.d.ts.map +0 -1
  58. package/lib/geometry/AcGeShape.js +0 -22
  59. package/lib/geometry/AcGeShape.js.map +0 -1
  60. package/lib/geometry/AcGeShape2d.d.ts +0 -31
  61. package/lib/geometry/AcGeShape2d.d.ts.map +0 -1
  62. package/lib/geometry/AcGeShape2d.js +0 -51
  63. package/lib/geometry/AcGeShape2d.js.map +0 -1
  64. package/lib/geometry/AcGeShape3d.d.ts +0 -33
  65. package/lib/geometry/AcGeShape3d.d.ts.map +0 -1
  66. package/lib/geometry/AcGeShape3d.js +0 -52
  67. package/lib/geometry/AcGeShape3d.js.map +0 -1
  68. package/lib/geometry/AcGeSpline3d.d.ts +0 -99
  69. package/lib/geometry/AcGeSpline3d.d.ts.map +0 -1
  70. package/lib/geometry/AcGeSpline3d.js +0 -350
  71. package/lib/geometry/AcGeSpline3d.js.map +0 -1
  72. package/lib/geometry/index.d.ts +0 -15
  73. package/lib/geometry/index.d.ts.map +0 -1
  74. package/lib/geometry/index.js +0 -15
  75. package/lib/geometry/index.js.map +0 -1
  76. package/lib/index.d.ts +0 -4
  77. package/lib/index.d.ts.map +0 -1
  78. package/lib/index.js +0 -4
  79. package/lib/index.js.map +0 -1
  80. package/lib/math/AcGeBox2d.d.ts +0 -173
  81. package/lib/math/AcGeBox2d.d.ts.map +0 -1
  82. package/lib/math/AcGeBox2d.js +0 -289
  83. package/lib/math/AcGeBox2d.js.map +0 -1
  84. package/lib/math/AcGeBox3d.d.ts +0 -195
  85. package/lib/math/AcGeBox3d.d.ts.map +0 -1
  86. package/lib/math/AcGeBox3d.js +0 -378
  87. package/lib/math/AcGeBox3d.js.map +0 -1
  88. package/lib/math/AcGeEuler.d.ts +0 -133
  89. package/lib/math/AcGeEuler.d.ts.map +0 -1
  90. package/lib/math/AcGeEuler.js +0 -358
  91. package/lib/math/AcGeEuler.js.map +0 -1
  92. package/lib/math/AcGeMatrix2d.d.ts +0 -203
  93. package/lib/math/AcGeMatrix2d.d.ts.map +0 -1
  94. package/lib/math/AcGeMatrix2d.js +0 -393
  95. package/lib/math/AcGeMatrix2d.js.map +0 -1
  96. package/lib/math/AcGeMatrix3d.d.ts +0 -279
  97. package/lib/math/AcGeMatrix3d.d.ts.map +0 -1
  98. package/lib/math/AcGeMatrix3d.js +0 -1037
  99. package/lib/math/AcGeMatrix3d.js.map +0 -1
  100. package/lib/math/AcGePlane.d.ts +0 -131
  101. package/lib/math/AcGePlane.d.ts.map +0 -1
  102. package/lib/math/AcGePlane.js +0 -218
  103. package/lib/math/AcGePlane.js.map +0 -1
  104. package/lib/math/AcGePoint.d.ts +0 -4
  105. package/lib/math/AcGePoint.d.ts.map +0 -1
  106. package/lib/math/AcGePoint.js +0 -2
  107. package/lib/math/AcGePoint.js.map +0 -1
  108. package/lib/math/AcGePoint2d.d.ts +0 -17
  109. package/lib/math/AcGePoint2d.d.ts.map +0 -1
  110. package/lib/math/AcGePoint2d.js +0 -40
  111. package/lib/math/AcGePoint2d.js.map +0 -1
  112. package/lib/math/AcGePoint3d.d.ts +0 -18
  113. package/lib/math/AcGePoint3d.d.ts.map +0 -1
  114. package/lib/math/AcGePoint3d.js +0 -43
  115. package/lib/math/AcGePoint3d.js.map +0 -1
  116. package/lib/math/AcGeQuaternion.d.ts +0 -230
  117. package/lib/math/AcGeQuaternion.d.ts.map +0 -1
  118. package/lib/math/AcGeQuaternion.js +0 -666
  119. package/lib/math/AcGeQuaternion.js.map +0 -1
  120. package/lib/math/AcGeVector.d.ts +0 -9
  121. package/lib/math/AcGeVector.d.ts.map +0 -1
  122. package/lib/math/AcGeVector.js +0 -2
  123. package/lib/math/AcGeVector.js.map +0 -1
  124. package/lib/math/AcGeVector2d.d.ts +0 -361
  125. package/lib/math/AcGeVector2d.d.ts.map +0 -1
  126. package/lib/math/AcGeVector2d.js +0 -622
  127. package/lib/math/AcGeVector2d.js.map +0 -1
  128. package/lib/math/AcGeVector3d.d.ts +0 -493
  129. package/lib/math/AcGeVector3d.d.ts.map +0 -1
  130. package/lib/math/AcGeVector3d.js +0 -868
  131. package/lib/math/AcGeVector3d.js.map +0 -1
  132. package/lib/math/index.d.ts +0 -14
  133. package/lib/math/index.d.ts.map +0 -1
  134. package/lib/math/index.js +0 -14
  135. package/lib/math/index.js.map +0 -1
  136. package/lib/util/AcGeConstants.d.ts +0 -19
  137. package/lib/util/AcGeConstants.d.ts.map +0 -1
  138. package/lib/util/AcGeConstants.js +0 -25
  139. package/lib/util/AcGeConstants.js.map +0 -1
  140. package/lib/util/AcGeGeometryUtil.d.ts +0 -16
  141. package/lib/util/AcGeGeometryUtil.d.ts.map +0 -1
  142. package/lib/util/AcGeGeometryUtil.js +0 -56
  143. package/lib/util/AcGeGeometryUtil.js.map +0 -1
  144. package/lib/util/AcGeMathUtil.d.ts +0 -203
  145. package/lib/util/AcGeMathUtil.d.ts.map +0 -1
  146. package/lib/util/AcGeMathUtil.js +0 -585
  147. package/lib/util/AcGeMathUtil.js.map +0 -1
  148. package/lib/util/AcGeNurbsUtil.d.ts +0 -34
  149. package/lib/util/AcGeNurbsUtil.d.ts.map +0 -1
  150. package/lib/util/AcGeNurbsUtil.js +0 -218
  151. package/lib/util/AcGeNurbsUtil.js.map +0 -1
  152. package/lib/util/AcGeTol.d.ts +0 -91
  153. package/lib/util/AcGeTol.d.ts.map +0 -1
  154. package/lib/util/AcGeTol.js +0 -83
  155. package/lib/util/AcGeTol.js.map +0 -1
  156. package/lib/util/index.d.ts +0 -6
  157. package/lib/util/index.d.ts.map +0 -1
  158. package/lib/util/index.js +0 -6
  159. package/lib/util/index.js.map +0 -1
@@ -1,73 +0,0 @@
1
- import { AcGePoint3d, AcGePoint3dLike } from '../math';
2
- /**
3
- * Type for NURBS knot parameterization
4
- */
5
- export type AcGeKnotParameterizationType = 'Uniform' | 'Chord' | 'SqrtChord';
6
- /**
7
- * A NURBS curve implementation that can be used by other curve classes
8
- */
9
- export declare class AcGeNurbsCurve {
10
- private _degree;
11
- private _knots;
12
- private _controlPoints;
13
- private _weights;
14
- constructor(degree: number, knots: number[], controlPoints: AcGePoint3dLike[], weights?: number[]);
15
- /**
16
- * Get the degree of the NURBS curve
17
- */
18
- degree(): number;
19
- /**
20
- * Get the knot vector
21
- */
22
- knots(): number[];
23
- /**
24
- * Get the control points
25
- */
26
- controlPoints(): AcGePoint3dLike[];
27
- /**
28
- * Get the weights
29
- */
30
- weights(): number[];
31
- /**
32
- * Calculate a point on the curve at parameter u
33
- */
34
- point(u: number): number[];
35
- /**
36
- * Calculate curve length using numerical integration
37
- */
38
- length(): number;
39
- /**
40
- * Create a NURBS curve from control points and knots
41
- */
42
- static byKnotsControlPointsWeights(degree: number, knots: number[], controlPoints: AcGePoint3dLike[], weights?: number[]): AcGeNurbsCurve;
43
- /**
44
- * Create a NURBS curve from fit points using interpolation
45
- */
46
- static byPoints(points: number[][], degree: number, parameterization?: AcGeKnotParameterizationType): AcGeNurbsCurve;
47
- /**
48
- * Get the valid parameter range for this curve
49
- */
50
- getParameterRange(): {
51
- start: number;
52
- end: number;
53
- };
54
- /**
55
- * Get points along the curve
56
- * @param divisions - Number of divisions to create
57
- * @returns Array of points along the curve
58
- */
59
- getPoints(divisions: number): number[][];
60
- /**
61
- * Check if the curve is closed by comparing start and end points
62
- */
63
- isClosed(tolerance?: number): boolean;
64
- /**
65
- * Create fit points for a closed NURBS curve using Catmull-Rom interpolation
66
- */
67
- static createFitPointsForClosedCurve(points: AcGePoint3dLike[]): AcGePoint3d[];
68
- /**
69
- * Create a closed NURBS curve using Catmull-Rom interpolation for smooth closure
70
- */
71
- static createClosedCurve(points: AcGePoint3dLike[], degree: number, parameterization?: AcGeKnotParameterizationType): AcGeNurbsCurve;
72
- }
73
- //# sourceMappingURL=AcGeNurbsCurve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGeNurbsCurve.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeNurbsCurve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAUtD;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAA;AAE5E;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,MAAM,CAA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
@@ -1,172 +0,0 @@
1
- var __read = (this && this.__read) || function (o, n) {
2
- var m = typeof Symbol === "function" && o[Symbol.iterator];
3
- if (!m) return o;
4
- var i = m.call(o), r, ar = [], e;
5
- try {
6
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
- }
8
- catch (error) { e = { error: error }; }
9
- finally {
10
- try {
11
- if (r && !r.done && (m = i["return"])) m.call(i);
12
- }
13
- finally { if (e) throw e.error; }
14
- }
15
- return ar;
16
- };
17
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
18
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
19
- if (ar || !(i in from)) {
20
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
21
- ar[i] = from[i];
22
- }
23
- }
24
- return to.concat(ar || Array.prototype.slice.call(from));
25
- };
26
- import { calculateCurveLength, evaluateNurbsPoint, generateChordKnots, generateSqrtChordKnots, generateUniformKnots } from '../util';
27
- import { AcGeCatmullRomCurve3d } from './AcGeCatmullRomCurve3d';
28
- /**
29
- * A NURBS curve implementation that can be used by other curve classes
30
- */
31
- var AcGeNurbsCurve = /** @class */ (function () {
32
- function AcGeNurbsCurve(degree, knots, controlPoints, weights) {
33
- this._degree = degree;
34
- this._knots = __spreadArray([], __read(knots), false);
35
- this._controlPoints = controlPoints.map(function (p) { return ({ x: p.x, y: p.y, z: p.z }); });
36
- this._weights = weights
37
- ? __spreadArray([], __read(weights), false) : new Array(controlPoints.length).fill(1.0);
38
- }
39
- /**
40
- * Get the degree of the NURBS curve
41
- */
42
- AcGeNurbsCurve.prototype.degree = function () {
43
- return this._degree;
44
- };
45
- /**
46
- * Get the knot vector
47
- */
48
- AcGeNurbsCurve.prototype.knots = function () {
49
- return __spreadArray([], __read(this._knots), false);
50
- };
51
- /**
52
- * Get the control points
53
- */
54
- AcGeNurbsCurve.prototype.controlPoints = function () {
55
- return this._controlPoints.map(function (p) { return ({ x: p.x, y: p.y, z: p.z }); });
56
- };
57
- /**
58
- * Get the weights
59
- */
60
- AcGeNurbsCurve.prototype.weights = function () {
61
- return __spreadArray([], __read(this._weights), false);
62
- };
63
- /**
64
- * Calculate a point on the curve at parameter u
65
- */
66
- AcGeNurbsCurve.prototype.point = function (u) {
67
- // Convert AcGePoint3dLike[] to number[][] for utility functions
68
- var controlPointsArray = this._controlPoints.map(function (p) { return [p.x, p.y, p.z]; });
69
- return evaluateNurbsPoint(u, this._degree, this._knots, controlPointsArray, this._weights);
70
- };
71
- /**
72
- * Calculate curve length using numerical integration
73
- */
74
- AcGeNurbsCurve.prototype.length = function () {
75
- // Convert AcGePoint3dLike[] to number[][] for utility functions
76
- var controlPointsArray = this._controlPoints.map(function (p) { return [p.x, p.y, p.z]; });
77
- return calculateCurveLength(this._degree, this._knots, controlPointsArray, this._weights);
78
- };
79
- /**
80
- * Create a NURBS curve from control points and knots
81
- */
82
- AcGeNurbsCurve.byKnotsControlPointsWeights = function (degree, knots, controlPoints, weights) {
83
- return new AcGeNurbsCurve(degree, knots, controlPoints, weights);
84
- };
85
- /**
86
- * Create a NURBS curve from fit points using interpolation
87
- */
88
- AcGeNurbsCurve.byPoints = function (points, degree, parameterization) {
89
- if (parameterization === void 0) { parameterization = 'Uniform'; }
90
- // Generate knots based on parameterization type
91
- var knots;
92
- switch (parameterization) {
93
- case 'Chord':
94
- knots = generateChordKnots(degree, points);
95
- break;
96
- case 'SqrtChord':
97
- knots = generateSqrtChordKnots(degree, points);
98
- break;
99
- case 'Uniform':
100
- default:
101
- knots = generateUniformKnots(degree, points.length);
102
- break;
103
- }
104
- // Convert number[][] to AcGePoint3dLike[] for control points
105
- var controlPoints = points.map(function (p) { return ({ x: p[0], y: p[1], z: p[2] }); });
106
- var weights = new Array(controlPoints.length).fill(1.0);
107
- return new AcGeNurbsCurve(degree, knots, controlPoints, weights);
108
- };
109
- /**
110
- * Get the valid parameter range for this curve
111
- */
112
- AcGeNurbsCurve.prototype.getParameterRange = function () {
113
- var startParam = this._knots[this._degree];
114
- var endParam = this._knots[this._knots.length - this._degree - 1];
115
- return { start: startParam, end: endParam };
116
- };
117
- /**
118
- * Get points along the curve
119
- * @param divisions - Number of divisions to create
120
- * @returns Array of points along the curve
121
- */
122
- AcGeNurbsCurve.prototype.getPoints = function (divisions) {
123
- var points = [];
124
- var _a = this.getParameterRange(), start = _a.start, end = _a.end;
125
- for (var i = 0; i <= divisions; i++) {
126
- var t = start + (end - start) * (i / divisions);
127
- points.push(this.point(t));
128
- }
129
- return points;
130
- };
131
- /**
132
- * Check if the curve is closed by comparing start and end points
133
- */
134
- AcGeNurbsCurve.prototype.isClosed = function (tolerance) {
135
- if (tolerance === void 0) { tolerance = 1e-6; }
136
- var _a = this.getParameterRange(), start = _a.start, end = _a.end;
137
- var startPoint = this.point(start);
138
- var endPoint = this.point(end);
139
- var dx = startPoint[0] - endPoint[0];
140
- var dy = startPoint[1] - endPoint[1];
141
- var dz = startPoint[2] - endPoint[2];
142
- return Math.sqrt(dx * dx + dy * dy + dz * dz) < tolerance;
143
- };
144
- /**
145
- * Create fit points for a closed NURBS curve using Catmull-Rom interpolation
146
- */
147
- AcGeNurbsCurve.createFitPointsForClosedCurve = function (points) {
148
- if (points.length < 4) {
149
- throw new Error('At least 4 points are required for a closed NURBS curve');
150
- }
151
- // Create a closed Catmull-Rom curve
152
- var catmullRomCurve = new AcGeCatmullRomCurve3d(points, true, 'centripetal');
153
- // Get points along the curve for NURBS interpolation
154
- // Use more divisions for smoother curve
155
- var divisions = Math.max(50, points.length * 2);
156
- return catmullRomCurve.getPoints(divisions);
157
- };
158
- /**
159
- * Create a closed NURBS curve using Catmull-Rom interpolation for smooth closure
160
- */
161
- AcGeNurbsCurve.createClosedCurve = function (points, degree, parameterization) {
162
- if (parameterization === void 0) { parameterization = 'Chord'; }
163
- var curvePoints = this.createFitPointsForClosedCurve(points);
164
- // Convert AcGePoint3d[] back to number[][]
165
- var nurbsPoints = curvePoints.map(function (point) { return [point.x, point.y, point.z]; });
166
- // Create NURBS curve from the interpolated points
167
- return AcGeNurbsCurve.byPoints(nurbsPoints, degree, parameterization);
168
- };
169
- return AcGeNurbsCurve;
170
- }());
171
- export { AcGeNurbsCurve };
172
- //# sourceMappingURL=AcGeNurbsCurve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGeNurbsCurve.js","sourceRoot":"","sources":["../../src/geometry/AcGeNurbsCurve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAO/D;;GAEG;AACH;IAME,wBACE,MAAc,EACd,KAAe,EACf,aAAgC,EAChC,OAAkB;QAElB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,MAAM,4BAAO,KAAK,SAAC,CAAA;QACxB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAA5B,CAA4B,CAAC,CAAA;QAC1E,IAAI,CAAC,QAAQ,GAAG,OAAO;YACrB,CAAC,0BAAK,OAAO,UACb,CAAC,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/C,CAAC;IAED;;OAEG;IACH,+BAAM,GAAN;QACE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,8BAAK,GAAL;QACE,gCAAW,IAAI,CAAC,MAAM,UAAC;IACzB,CAAC;IAED;;OAEG;IACH,sCAAa,GAAb;QACE,OAAO,IAAI,CAAC,cAAc,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AApC,UACE,MAAyB;QAEzB,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;QAC5E,CAAC;QAED,oCAAoC;QACpC,IAAM,eAAe,GAAG,IAAI,qBAAqB,CAC/C,MAAM,EACN,IAAI,EACJ,aAAa,CACd,CAAA;QAED,qDAAqD;QACrD,wCAAwC;QACxC,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACjD,OAAO,eAAe,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IAC7C,CAAC;IAED;;OAEG;IACI,gCAAiB,GAAxB,UACE,MAAyB,EACzB,MAAc,EACd,gBAAwD;QAAxD,iCAAA,EAAA,0BAAwD;QAExD,IAAM,WAAW,GAAG,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAA;QAE9D,2CAA2C;QAC3C,IAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAA3B,CAA2B,CAAC,CAAA;QAEzE,kDAAkD;QAClD,OAAO,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACvE,CAAC;IACH,qBAAC;AAAD,CAAC,AAvMD,IAuMC"}
@@ -1,90 +0,0 @@
1
- import { AcGeBox2d, AcGeMatrix2d, AcGePoint2d, AcGePoint3d } from '../math';
2
- import { AcGeCurve2d } from './AcGeCurve2d';
3
- /**
4
- * The class represents one vertex of the polyline geometry.
5
- */
6
- export interface AcGePolyline2dVertex {
7
- x: number;
8
- y: number;
9
- /**
10
- * The bulge factor used to indicate how much of an arc segment is present at this vertex.
11
- * The bulge factor is the tangent of one fourth the included angle for an arc segment, made
12
- * negative if the arc goes clockwise from the start point to the endpoint. A bulge of 0 indicates a
13
- * straight segment, and a bulge of 1 is a semicircle. Get more details from the following links.
14
- * - https://ezdxf.readthedocs.io/en/stable/dxfentities/lwpolyline.html
15
- * - https://www.afralisp.net/archive/lisp/Bulges1.htm
16
- */
17
- bulge?: number;
18
- }
19
- /**
20
- * The class represents the polyline geometry.
21
- */
22
- export declare class AcGePolyline2d<T extends AcGePolyline2dVertex = AcGePolyline2dVertex> extends AcGeCurve2d {
23
- private _closed;
24
- private _vertices;
25
- constructor(vertices?: Array<T> | null, closed?: boolean);
26
- /**
27
- * The number of vertices in the polyline
28
- */
29
- get numberOfVertices(): number;
30
- /**
31
- * @inheritdoc
32
- */
33
- get closed(): boolean;
34
- /**
35
- * Start point of this polyline
36
- */
37
- get startPoint(): AcGePoint2d;
38
- /**
39
- * End point of this polyline
40
- */
41
- get endPoint(): AcGePoint2d;
42
- /**
43
- * @inheritdoc
44
- */
45
- get length(): number;
46
- /**
47
- * Set the polyline to be closed (that is, there is a segment drawn from the last vertex to the first)
48
- * if 'value' is true. Set the polyline to be open (no segment between the last and first vertices) if
49
- * 'value' is false.
50
- */
51
- set closed(value: boolean);
52
- /**
53
- * This function adds a vertex to the polyline. If index is 0, the vertex will become the first
54
- * vertex of the polyline. If index is the value returned by this.numberOfVertices, then the vertex
55
- * will become the last vertex of the polyline. Otherwise the vertex will be added just before the
56
- * index vertex.
57
- *
58
- * @param index Input index (0 based) before which to insert the vertex
59
- * @param vertex Input vertex location point
60
- */
61
- addVertexAt(index: number, vertex: T): void;
62
- /**
63
- * Get the 2d location of the vertex index in the polyline's own object coordinate system (OCS).
64
- *
65
- * @param index Input index (0 based) of the vertex
66
- */
67
- getPointAt(index: number): AcGePoint2d;
68
- /**
69
- * @inheritdoc
70
- */
71
- calculateBoundingBox(): AcGeBox2d;
72
- /**
73
- * @inheritdoc
74
- */
75
- transform(_matrix: AcGeMatrix2d): this;
76
- /**
77
- * Return an array of points to draw this polyline.
78
- * @param numPoints Input the nubmer of points returned for arc segmentation
79
- * @param elevation Input z value of points returned
80
- * @returns Return an array of point
81
- */
82
- getPoints3d(numPoints: number, elevation: number): AcGePoint3d[];
83
- /**
84
- * Return an array of points to draw this polyline.
85
- * @param numPoints Input the nubmer of points returned for arc segmentation
86
- * @returns Return an array of point
87
- */
88
- getPoints(numPoints: number): AcGePoint2d[];
89
- }
90
- //# sourceMappingURL=AcGePolyline2d.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGePolyline2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGePolyline2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,cAAc,CACzB,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,CACrD,SAAQ,WAAW;IACnB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAU;gBAEf,QAAQ,GAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAW,EAAE,MAAM,GAAE,OAAe;IAMrE;;OAEG;IACH,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,WAAW,CAM5B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAY1B;IAED;;OAEG;IACH,IAAI,MAAM,WAqBT;IAED;;;;OAIG;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAGxB;IAED;;;;;;;;OAQG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IASpC;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAKtC;;OAEG;IACH,oBAAoB,IAAI,SAAS;IAKjC;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,YAAY;IAM/B;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAShD;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE;CA+B5C"}
@@ -1,224 +0,0 @@
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 { AcGeBox2d, AcGePoint2d, AcGePoint3d } from '../math';
17
- import { AcGeCircArc2d } from './AcGeCircArc2d';
18
- import { AcGeCurve2d } from './AcGeCurve2d';
19
- /**
20
- * The class represents the polyline geometry.
21
- */
22
- var AcGePolyline2d = /** @class */ (function (_super) {
23
- __extends(AcGePolyline2d, _super);
24
- function AcGePolyline2d(vertices, closed) {
25
- if (vertices === void 0) { vertices = null; }
26
- if (closed === void 0) { closed = false; }
27
- var _this = _super.call(this) || this;
28
- _this._vertices = vertices ? vertices : new Array();
29
- _this._closed = closed;
30
- return _this;
31
- }
32
- Object.defineProperty(AcGePolyline2d.prototype, "numberOfVertices", {
33
- /**
34
- * The number of vertices in the polyline
35
- */
36
- get: function () {
37
- return this._vertices.length;
38
- },
39
- enumerable: false,
40
- configurable: true
41
- });
42
- Object.defineProperty(AcGePolyline2d.prototype, "closed", {
43
- /**
44
- * @inheritdoc
45
- */
46
- get: function () {
47
- return this._closed;
48
- },
49
- /**
50
- * Set the polyline to be closed (that is, there is a segment drawn from the last vertex to the first)
51
- * if 'value' is true. Set the polyline to be open (no segment between the last and first vertices) if
52
- * 'value' is false.
53
- */
54
- set: function (value) {
55
- this._closed = value;
56
- this._boundingBoxNeedsUpdate = true;
57
- },
58
- enumerable: false,
59
- configurable: true
60
- });
61
- Object.defineProperty(AcGePolyline2d.prototype, "startPoint", {
62
- /**
63
- * Start point of this polyline
64
- */
65
- get: function () {
66
- if (this.numberOfVertices > 0) {
67
- var vertex = this._vertices[0];
68
- return new AcGePoint2d(vertex.x, vertex.y);
69
- }
70
- throw new Error('Start point does not exist in an empty polyline.');
71
- },
72
- enumerable: false,
73
- configurable: true
74
- });
75
- Object.defineProperty(AcGePolyline2d.prototype, "endPoint", {
76
- /**
77
- * End point of this polyline
78
- */
79
- get: function () {
80
- var length = this.numberOfVertices;
81
- if (length > 0) {
82
- if (this.closed) {
83
- var vertex = this._vertices[0];
84
- return new AcGePoint2d(vertex.x, vertex.y);
85
- }
86
- else {
87
- var vertex = this._vertices[length - 1];
88
- return new AcGePoint2d(vertex.x, vertex.y);
89
- }
90
- }
91
- throw new Error('End point does not exist in an empty polyline.');
92
- },
93
- enumerable: false,
94
- configurable: true
95
- });
96
- Object.defineProperty(AcGePolyline2d.prototype, "length", {
97
- /**
98
- * @inheritdoc
99
- */
100
- get: function () {
101
- var length = 0;
102
- var vertexArraylength = this._vertices.length;
103
- for (var index = 0; index < vertexArraylength; ++index) {
104
- var vertex = this._vertices[index];
105
- var nextVertex = null;
106
- if (index < vertexArraylength - 1) {
107
- nextVertex = this._vertices[index + 1];
108
- }
109
- else if (index == vertexArraylength - 1 && this.closed) {
110
- nextVertex = this._vertices[0];
111
- }
112
- if (nextVertex) {
113
- if (vertex.bulge) {
114
- var arc = new AcGeCircArc2d(vertex, nextVertex, vertex.bulge);
115
- length += arc.length;
116
- }
117
- else {
118
- length += new AcGePoint2d(vertex.x, vertex.y).distanceTo(nextVertex);
119
- }
120
- }
121
- }
122
- return length;
123
- },
124
- enumerable: false,
125
- configurable: true
126
- });
127
- /**
128
- * This function adds a vertex to the polyline. If index is 0, the vertex will become the first
129
- * vertex of the polyline. If index is the value returned by this.numberOfVertices, then the vertex
130
- * will become the last vertex of the polyline. Otherwise the vertex will be added just before the
131
- * index vertex.
132
- *
133
- * @param index Input index (0 based) before which to insert the vertex
134
- * @param vertex Input vertex location point
135
- */
136
- AcGePolyline2d.prototype.addVertexAt = function (index, vertex) {
137
- if (index <= 0) {
138
- this._vertices.unshift(vertex);
139
- }
140
- else {
141
- this._vertices.splice(index, 0, vertex);
142
- }
143
- this._boundingBoxNeedsUpdate = true;
144
- };
145
- /**
146
- * Get the 2d location of the vertex index in the polyline's own object coordinate system (OCS).
147
- *
148
- * @param index Input index (0 based) of the vertex
149
- */
150
- AcGePolyline2d.prototype.getPointAt = function (index) {
151
- var vertex = this._vertices[index];
152
- return new AcGePoint2d(vertex.x, vertex.y);
153
- };
154
- /**
155
- * @inheritdoc
156
- */
157
- AcGePolyline2d.prototype.calculateBoundingBox = function () {
158
- var points = this.getPoints(100);
159
- return new AcGeBox2d().setFromPoints(points);
160
- };
161
- /**
162
- * @inheritdoc
163
- */
164
- AcGePolyline2d.prototype.transform = function (_matrix) {
165
- // TODO: implement it
166
- this._boundingBoxNeedsUpdate = true;
167
- return this;
168
- };
169
- /**
170
- * Return an array of points to draw this polyline.
171
- * @param numPoints Input the nubmer of points returned for arc segmentation
172
- * @param elevation Input z value of points returned
173
- * @returns Return an array of point
174
- */
175
- AcGePolyline2d.prototype.getPoints3d = function (numPoints, elevation) {
176
- var points = [];
177
- var tmp = this.getPoints(numPoints);
178
- tmp.forEach(function (point) {
179
- return points.push(new AcGePoint3d().set(point.x, point.y, elevation));
180
- });
181
- return points;
182
- };
183
- /**
184
- * Return an array of points to draw this polyline.
185
- * @param numPoints Input the nubmer of points returned for arc segmentation
186
- * @returns Return an array of point
187
- */
188
- AcGePolyline2d.prototype.getPoints = function (numPoints) {
189
- var points = [];
190
- var length = this._vertices.length;
191
- for (var index = 0; index < length; ++index) {
192
- var vertex = this._vertices[index];
193
- if (vertex.bulge) {
194
- var nextVertex = null;
195
- if (index < length - 1) {
196
- nextVertex = this._vertices[index + 1];
197
- }
198
- else if (index == length - 1 && this.closed) {
199
- nextVertex = this._vertices[0];
200
- }
201
- // In theory, nextVertex should be always not null
202
- if (nextVertex) {
203
- var arc = new AcGeCircArc2d(vertex, nextVertex, vertex.bulge);
204
- var arcPoints = arc.getPoints(numPoints);
205
- var length_1 = arcPoints.length;
206
- for (var i = 0; i < length_1; ++i) {
207
- var point = arcPoints[i];
208
- points.push(new AcGePoint2d(point.x, point.y));
209
- }
210
- }
211
- }
212
- else {
213
- points.push(new AcGePoint2d(vertex.x, vertex.y));
214
- if (index == length - 1 && this.closed) {
215
- points.push(points[0]);
216
- }
217
- }
218
- }
219
- return points;
220
- };
221
- return AcGePolyline2d;
222
- }(AcGeCurve2d));
223
- export { AcGePolyline2d };
224
- //# sourceMappingURL=AcGePolyline2d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGePolyline2d.js","sourceRoot":"","sources":["../../src/geometry/AcGePolyline2d.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAgB,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAmB3C;;GAEG;AACH;IAEU,kCAAW;IAInB,wBAAY,QAAgC,EAAE,MAAuB;QAAzD,yBAAA,EAAA,eAAgC;QAAE,uBAAA,EAAA,cAAuB;QACnE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI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AE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;oBAChD,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;gBAChD,IAAI,KAAK,IAAI,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;oBACvC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IACH,qBAAC;AAAD,CAAC,AA1LD,CAEU,WAAW,GAwLpB"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Abstract base class for all kinds of geometries.
3
- */
4
- export declare abstract class AcGeShape {
5
- protected _boundingBoxNeedsUpdate: boolean;
6
- /**
7
- * When this is set, it calculates the bounding box of this shape and resets this property to false.
8
- * Default is false.
9
- */
10
- get boundingBoxNeedUpdate(): boolean;
11
- }
12
- //# sourceMappingURL=AcGeShape.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGeShape.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeShape.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,8BAAsB,SAAS;IAC7B,SAAS,CAAC,uBAAuB,EAAE,OAAO,CAAQ;IAElD;;;OAGG;IACH,IAAI,qBAAqB,YAExB;CACF"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Abstract base class for all kinds of geometries.
3
- */
4
- var AcGeShape = /** @class */ (function () {
5
- function AcGeShape() {
6
- this._boundingBoxNeedsUpdate = false;
7
- }
8
- Object.defineProperty(AcGeShape.prototype, "boundingBoxNeedUpdate", {
9
- /**
10
- * When this is set, it calculates the bounding box of this shape and resets this property to false.
11
- * Default is false.
12
- */
13
- get: function () {
14
- return this._boundingBoxNeedsUpdate;
15
- },
16
- enumerable: false,
17
- configurable: true
18
- });
19
- return AcGeShape;
20
- }());
21
- export { AcGeShape };
22
- //# sourceMappingURL=AcGeShape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGeShape.js","sourceRoot":"","sources":["../../src/geometry/AcGeShape.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAAA;QACY,4BAAuB,GAAY,KAAK,CAAA;IASpD,CAAC;IAHC,sBAAI,4CAAqB;QAJzB;;;WAGG;aACH;YACE,OAAO,IAAI,CAAC,uBAAuB,CAAA;QACrC,CAAC;;;OAAA;IACH,gBAAC;AAAD,CAAC,AAVD,IAUC"}
@@ -1,31 +0,0 @@
1
- import { AcGeBox2d, AcGeMatrix2d, AcGeVector2dLike } from '../math';
2
- import { AcGeShape } from './AcGeShape';
3
- /**
4
- * Abstract base class for all kinds of 2d shapes.
5
- */
6
- export declare abstract class AcGeShape2d extends AcGeShape {
7
- /**
8
- * The bounding box of this shape
9
- */
10
- private _box?;
11
- /**
12
- * Return new shape translated by given vector.
13
- */
14
- translate(v: AcGeVector2dLike): this;
15
- /**
16
- * Transforms the entity by applying the input matrix.
17
- * @param matrix Input transformation matrix
18
- */
19
- abstract transform(matrix: AcGeMatrix2d): this;
20
- /**
21
- * The bounding box of this shape. Because it is a time-consuming operation to calculate the bounding
22
- * box of one shape, the bounding box value is cached. It will be calculated again lazily once there
23
- * are any changes to properties of this shape.
24
- */
25
- get box(): AcGeBox2d;
26
- /**
27
- * Return true if this shape contains the specified shape
28
- */
29
- protected abstract calculateBoundingBox(): AcGeBox2d;
30
- }
31
- //# sourceMappingURL=AcGeShape2d.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcGeShape2d.d.ts","sourceRoot":"","sources":["../../src/geometry/AcGeShape2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;GAEG;AACH,8BAAsB,WAAY,SAAQ,SAAS;IACjD;;OAEG;IACH,OAAO,CAAC,IAAI,CAAC,CAAW;IAExB;;OAEG;IACH,SAAS,CAAC,CAAC,EAAE,gBAAgB,GAAG,IAAI;IAIpC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAE9C;;;;OAIG;IACH,IAAI,GAAG,cAMN;IAED;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,oBAAoB,IAAI,SAAS;CACrD"}