geometrix 1.0.12 → 1.0.14
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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -363,6 +363,7 @@ declare class Contour extends AContour {
|
|
|
363
363
|
addSegStrokeAP(aa: number, al: number): this;
|
|
364
364
|
addSegStrokeR(rx: number, ry: number): this;
|
|
365
365
|
addSegStrokeRP(ra: number, rl: number): this;
|
|
366
|
+
addSegStrokeAifBig(ax: number, ay: number, minLength: number, secondNfirst: boolean): this;
|
|
366
367
|
addSegArc(iRadius: number, iLarge: boolean, iCcw: boolean): this;
|
|
367
368
|
addSegArc2(): this;
|
|
368
369
|
addSegArc3(iTangentAngle1: number, firstNlast: boolean): this;
|
package/dist/index.js
CHANGED
|
@@ -1813,6 +1813,22 @@ var Contour = class _Contour extends AContour {
|
|
|
1813
1813
|
this.addPointRP(ra, rl).addSegStroke();
|
|
1814
1814
|
return this;
|
|
1815
1815
|
}
|
|
1816
|
+
addSegStrokeAifBig(ax, ay, minLength, secondNfirst) {
|
|
1817
|
+
const p0 = this.getLastPoint();
|
|
1818
|
+
const ppLength = Math.sqrt((ax - p0.cx) ** 2 + (ay - p0.cy) ** 2);
|
|
1819
|
+
if (ppLength > minLength) {
|
|
1820
|
+
this.addPointA(ax, ay).addSegStroke();
|
|
1821
|
+
} else if (secondNfirst) {
|
|
1822
|
+
const preType = this.segments[this.segments.length - 1].sType;
|
|
1823
|
+
if (preType === 0 /* eStroke */) {
|
|
1824
|
+
this.segments.pop();
|
|
1825
|
+
this.addPointA(ax, ay).addSegStroke();
|
|
1826
|
+
} else {
|
|
1827
|
+
throw `err186: addSegStrokeA-ifBig used after a not eStroke ${preType} at segment ${this.segments.length}`;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
return this;
|
|
1831
|
+
}
|
|
1816
1832
|
addSegArc(iRadius, iLarge, iCcw) {
|
|
1817
1833
|
if (this.points.length !== 1) {
|
|
1818
1834
|
throw `err954: contour addSegArc with unexpected points.length ${this.points.length}`;
|
|
@@ -2280,7 +2296,8 @@ var Contour = class _Contour extends AContour {
|
|
|
2280
2296
|
pt2 = pt3;
|
|
2281
2297
|
pt3 = pt;
|
|
2282
2298
|
const extrem = theMax ? pt2.cx > extremX - epsilon : pt2.cx < extremX + epsilon;
|
|
2283
|
-
|
|
2299
|
+
const lastExtrem = theMax ? pt1.cx > extremX - epsilon : pt1.cx < extremX + epsilon;
|
|
2300
|
+
if (extrem && !lastExtrem) {
|
|
2284
2301
|
const vx = pt1.cx - pt2.cx;
|
|
2285
2302
|
const vy = pt1.cy - pt2.cy;
|
|
2286
2303
|
const ux = pt3.cx - pt2.cx;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geometrix",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "The 2D geometry engine of the parametrix",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@eslint/js": "^9.10.0",
|
|
71
71
|
"@types/eslint__js": "^8.42.3",
|
|
72
|
-
"@types/node": "^22.13.
|
|
73
|
-
"eslint": "^9.
|
|
74
|
-
"eslint-config-prettier": "^10.
|
|
72
|
+
"@types/node": "^22.13.10",
|
|
73
|
+
"eslint": "^9.22.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.1",
|
|
75
75
|
"npm-run-all2": "^7.0.2",
|
|
76
|
-
"prettier": "^3.5.
|
|
76
|
+
"prettier": "^3.5.3",
|
|
77
77
|
"rimraf": "^6.0.1",
|
|
78
|
-
"tsup": "^8.
|
|
79
|
-
"typescript": "^5.
|
|
80
|
-
"typescript-eslint": "^8.
|
|
81
|
-
"vitest": "^3.0.
|
|
78
|
+
"tsup": "^8.4.0",
|
|
79
|
+
"typescript": "^5.8.2",
|
|
80
|
+
"typescript-eslint": "^8.26.0",
|
|
81
|
+
"vitest": "^3.0.8"
|
|
82
82
|
}
|
|
83
83
|
}
|