geometrix 1.0.13 → 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 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}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geometrix",
3
- "version": "1.0.13",
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.8",
73
- "eslint": "^9.21.0",
74
- "eslint-config-prettier": "^10.0.2",
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.2",
76
+ "prettier": "^3.5.3",
77
77
  "rimraf": "^6.0.1",
78
78
  "tsup": "^8.4.0",
79
- "typescript": "^5.7.3",
80
- "typescript-eslint": "^8.25.0",
81
- "vitest": "^3.0.7"
79
+ "typescript": "^5.8.2",
80
+ "typescript-eslint": "^8.26.0",
81
+ "vitest": "^3.0.8"
82
82
  }
83
83
  }