geometrix 0.5.48 → 0.5.50
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 +11 -1
- package/dist/index.js +8 -2
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,16 @@ declare function withinZeroPi(ia: number): number;
|
|
|
45
45
|
declare function withinHPiHPi(ia: number): number;
|
|
46
46
|
declare function orientedArc(aStart: number, aStop: number, ccw: boolean): number;
|
|
47
47
|
declare function isWithin(aNew: number, aStart: number, aStop: number, ccw: boolean): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Calculate the coordiantes [X,Y] of B, starting from A[x,y] and translate with angle aAB and length lAB
|
|
50
|
+
*
|
|
51
|
+
* @param ax: X-coordiante of point A
|
|
52
|
+
* @param ay: Y-coordiante of point A
|
|
53
|
+
* @param aAB: angle of translation vector AB in radian
|
|
54
|
+
* @param lAB: length of translation vector AB
|
|
55
|
+
* @returns [Bx, By] coordinates of point B
|
|
56
|
+
*/
|
|
57
|
+
declare function pointCoord(ax: number, ay: number, aAB: number, lAB: number): [number, number];
|
|
48
58
|
declare function ffix(ifloat: number): string;
|
|
49
59
|
|
|
50
60
|
declare function rightTriLaFromLbLc(ilb: number, ilc: number): number;
|
|
@@ -675,4 +685,4 @@ declare function version_details(appPackage: tPackage): string[];
|
|
|
675
685
|
|
|
676
686
|
declare function checkImpPages(pages: tAllPageDef): [boolean, string];
|
|
677
687
|
|
|
678
|
-
export { Contour, ContourCircle, DesignParam, DxfSeg, DxfWrite, EBVolume, EExtrude, EFormat, Figure, Line, PSeg, PType, PaxPath, Point, SegDbg, SegEnum, Segment1, Segment2, ShapePoint, Transform3d, Vector, aBFromLaLbAa, aCFromAaAb, aCFromLaLbLc, adjustCenter, adjustInit, adjustRect, adjustScale, adjustTranslate, adjustZero, arcSeg1To2, arcSeg2To1, bisector, canvas2point, canvasTranslatePolar, checkGeom, checkImpPages, circleCenter, colors, contour, contourCircle, copyLayers, createParamFile, ctrOblong, ctrRectRot, ctrRectRot2, ctrRectangle, ctrTrapezoid, ctrTrapezoidRot2, degToRad, designParam, dxfSegArc, dxfSegCircle, dxfSegLine, dxfWriter, ffix, figure, fileBin, fileBinContent, fileMime, fileSuffix, fileTextContent, fround, gSegDbg, initGeom, initLayers, isActiveCorner, isAddPoint, isCorner, isSeg, isWithin, lbFromLaAaAb, lcFromLaLbAc, line, linePP, makeCorner, mergeFaces, midArcPoint, oneDesignParam, orientedArc, pCheckbox, pDropdown, pNumber, pSectionSeparator, paramListToVal, parseParamFile, paxCircle, paxPath, point, point2canvas, pointMinMax, prefixLog, radToDeg, radius2canvas, rightTriLaFromLbLc, rightTriLbFromLaLc, roundZero, type tAffine, type tAllLink, type tAllPageDef, type tBVolume, type tCanvasAdjust, type tCartesian, type tContour, type tDependencies, type tDesignParamList, type tDesignParamOne, type tExtrude, type tFigures, type tGeom, type tGeomFunc, type tInherit, type tLayers, type tOuterInner, type tPackage, type tPageDef, type tParam, type tParamChanged, type tParamDef, type tParamVal, type tParamValInFile, type tPaxContour, type tPaxContourCircle, type tPaxContourPath, type tPaxFace, type tPaxSeg, type tPaxSegArc, type tPaxSegSt, type tPolar, type tPosiOrien, type tSimTime, type tSubDesign, type tSubInst, type tT3dMatrix, type tVec3, type tVec4, type tVolume, tolerance, transform3d, vector, version_details, withinHPiHPi, withinPiPi, withinZero2Pi, withinZeroPi, zeroPDef };
|
|
688
|
+
export { Contour, ContourCircle, DesignParam, DxfSeg, DxfWrite, EBVolume, EExtrude, EFormat, Figure, Line, PSeg, PType, PaxPath, Point, SegDbg, SegEnum, Segment1, Segment2, ShapePoint, Transform3d, Vector, aBFromLaLbAa, aCFromAaAb, aCFromLaLbLc, adjustCenter, adjustInit, adjustRect, adjustScale, adjustTranslate, adjustZero, arcSeg1To2, arcSeg2To1, bisector, canvas2point, canvasTranslatePolar, checkGeom, checkImpPages, circleCenter, colors, contour, contourCircle, copyLayers, createParamFile, ctrOblong, ctrRectRot, ctrRectRot2, ctrRectangle, ctrTrapezoid, ctrTrapezoidRot2, degToRad, designParam, dxfSegArc, dxfSegCircle, dxfSegLine, dxfWriter, ffix, figure, fileBin, fileBinContent, fileMime, fileSuffix, fileTextContent, fround, gSegDbg, initGeom, initLayers, isActiveCorner, isAddPoint, isCorner, isSeg, isWithin, lbFromLaAaAb, lcFromLaLbAc, line, linePP, makeCorner, mergeFaces, midArcPoint, oneDesignParam, orientedArc, pCheckbox, pDropdown, pNumber, pSectionSeparator, paramListToVal, parseParamFile, paxCircle, paxPath, point, point2canvas, pointCoord, pointMinMax, prefixLog, radToDeg, radius2canvas, rightTriLaFromLbLc, rightTriLbFromLaLc, roundZero, type tAffine, type tAllLink, type tAllPageDef, type tBVolume, type tCanvasAdjust, type tCartesian, type tContour, type tDependencies, type tDesignParamList, type tDesignParamOne, type tExtrude, type tFigures, type tGeom, type tGeomFunc, type tInherit, type tLayers, type tOuterInner, type tPackage, type tPageDef, type tParam, type tParamChanged, type tParamDef, type tParamVal, type tParamValInFile, type tPaxContour, type tPaxContourCircle, type tPaxContourPath, type tPaxFace, type tPaxSeg, type tPaxSegArc, type tPaxSegSt, type tPolar, type tPosiOrien, type tSimTime, type tSubDesign, type tSubInst, type tT3dMatrix, type tVec3, type tVec4, type tVolume, tolerance, transform3d, vector, version_details, withinHPiHPi, withinPiPi, withinZero2Pi, withinZeroPi, zeroPDef };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/angle_utils.ts
|
|
2
2
|
var tolerance = 10 ** -4;
|
|
3
3
|
function degToRad(degrees) {
|
|
4
|
-
return degrees *
|
|
4
|
+
return degrees * Math.PI / 180;
|
|
5
5
|
}
|
|
6
6
|
function radToDeg(rad) {
|
|
7
|
-
return rad /
|
|
7
|
+
return 180 * rad / Math.PI;
|
|
8
8
|
}
|
|
9
9
|
function roundZero(ix) {
|
|
10
10
|
let rx = ix;
|
|
@@ -61,6 +61,11 @@ function isWithin(aNew, aStart, aStop, ccw) {
|
|
|
61
61
|
}
|
|
62
62
|
return rYes;
|
|
63
63
|
}
|
|
64
|
+
function pointCoord(ax, ay, aAB, lAB) {
|
|
65
|
+
const rBx = ax + lAB * Math.cos(aAB);
|
|
66
|
+
const rBy = ay + lAB * Math.sin(aAB);
|
|
67
|
+
return [rBx, rBy];
|
|
68
|
+
}
|
|
64
69
|
function ffix(ifloat) {
|
|
65
70
|
return ifloat.toFixed(2);
|
|
66
71
|
}
|
|
@@ -4710,6 +4715,7 @@ export {
|
|
|
4710
4715
|
paxPath,
|
|
4711
4716
|
point,
|
|
4712
4717
|
point2canvas,
|
|
4718
|
+
pointCoord,
|
|
4713
4719
|
pointMinMax,
|
|
4714
4720
|
prefixLog,
|
|
4715
4721
|
radToDeg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geometrix",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.50",
|
|
4
4
|
"description": "The 2D geometry engine of the parametrix",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -60,24 +60,24 @@
|
|
|
60
60
|
"test:unit": "vitest",
|
|
61
61
|
"test:unit:once": "vitest --run",
|
|
62
62
|
"ci": "run-s check build pretty lint test:unit:once",
|
|
63
|
-
"clean": "
|
|
63
|
+
"clean": "rimraf dist node_modules"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@zip.js/zip.js": "^2.7.52",
|
|
67
67
|
"json5": "^2.2.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@eslint/js": "^9.
|
|
70
|
+
"@eslint/js": "^9.10.0",
|
|
71
71
|
"@types/eslint__js": "^8.42.3",
|
|
72
|
-
"@types/node": "^22.
|
|
73
|
-
"eslint": "^9.
|
|
72
|
+
"@types/node": "^22.7.7",
|
|
73
|
+
"eslint": "^9.13.0",
|
|
74
74
|
"eslint-config-prettier": "^9.1.0",
|
|
75
|
-
"npm-run-
|
|
75
|
+
"npm-run-all2": "^6.2.4",
|
|
76
76
|
"prettier": "^3.3.3",
|
|
77
|
-
"
|
|
78
|
-
"tsup": "^8.
|
|
79
|
-
"typescript": "^5.6.
|
|
80
|
-
"typescript-eslint": "^8.
|
|
81
|
-
"vitest": "^2.
|
|
77
|
+
"rimraf": "^6.0.1",
|
|
78
|
+
"tsup": "^8.3.0",
|
|
79
|
+
"typescript": "^5.6.3",
|
|
80
|
+
"typescript-eslint": "^8.10.0",
|
|
81
|
+
"vitest": "^2.1.3"
|
|
82
82
|
}
|
|
83
83
|
}
|