geometrix 1.0.14 → 1.0.15
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 -1
- package/dist/index.js +19 -16
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -363,11 +363,11 @@ 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;
|
|
367
366
|
addSegArc(iRadius: number, iLarge: boolean, iCcw: boolean): this;
|
|
368
367
|
addSegArc2(): this;
|
|
369
368
|
addSegArc3(iTangentAngle1: number, firstNlast: boolean): this;
|
|
370
369
|
addSeg2Arcs(ita1: number, ita2: number): this;
|
|
370
|
+
addSegStrokeAifBig(ax: number, ay: number, minLength: number, secondNfirst: boolean): this;
|
|
371
371
|
addCornerPointed(): this;
|
|
372
372
|
addCornerRounded(iRadius: number): this;
|
|
373
373
|
addCornerWidened(iRadius: number): this;
|
package/dist/index.js
CHANGED
|
@@ -1813,22 +1813,6 @@ 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
|
-
}
|
|
1832
1816
|
addSegArc(iRadius, iLarge, iCcw) {
|
|
1833
1817
|
if (this.points.length !== 1) {
|
|
1834
1818
|
throw `err954: contour addSegArc with unexpected points.length ${this.points.length}`;
|
|
@@ -1975,6 +1959,25 @@ var Contour = class _Contour extends AContour {
|
|
|
1975
1959
|
}
|
|
1976
1960
|
return this;
|
|
1977
1961
|
}
|
|
1962
|
+
addSegStrokeAifBig(ax, ay, minLength, secondNfirst) {
|
|
1963
|
+
const p0 = this.getLastPoint();
|
|
1964
|
+
const ppLength = Math.sqrt((ax - p0.cx) ** 2 + (ay - p0.cy) ** 2);
|
|
1965
|
+
if (ppLength > minLength) {
|
|
1966
|
+
this.addPointA(ax, ay).addSegStroke();
|
|
1967
|
+
} else if (secondNfirst) {
|
|
1968
|
+
const preSeg = this.segments[this.segments.length - 1];
|
|
1969
|
+
if (preSeg.sType === 0 /* eStroke */) {
|
|
1970
|
+
this.segments.pop();
|
|
1971
|
+
this.addPointA(ax, ay).addSegStroke();
|
|
1972
|
+
} else if (preSeg.sType === 1 /* eArc */) {
|
|
1973
|
+
this.segments.pop();
|
|
1974
|
+
this.addPointA(ax, ay).addSegArc(preSeg.radius, preSeg.arcLarge, preSeg.arcCcw);
|
|
1975
|
+
} else {
|
|
1976
|
+
throw `err186: addSegStrokeA-ifBig used after eStart or eCorner ${preSeg.sType} at segment ${this.segments.length}`;
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
return this;
|
|
1980
|
+
}
|
|
1978
1981
|
addCornerPointed() {
|
|
1979
1982
|
const seg = new Segment1(2 /* ePointed */, 0, 0, 0);
|
|
1980
1983
|
this.addSeg(seg);
|